-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
167 lines (150 loc) · 5.77 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3Z0</title>
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
/* General Fade-in Animation */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.menu-toggle {
display: none;
font-size: 1.5rem;
cursor: pointer;
transition: transform 0.3s ease;
}
.menu-toggle:hover {
transform: rotate(90deg);
}
@media (max-width: 768px) {
.menu-toggle {
display: block;
}
.nav-links {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
background-color: var(--background);
padding: 1rem;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
opacity: 0;
transform: translateY(-10px);
transition: opacity 0.4s ease, transform 0.4s ease;
}
.nav-links.active {
display: flex;
flex-direction: column;
gap: 1rem;
opacity: 1;
transform: translateY(0);
}
}
/* Hero Section Animation */
.hero {
animation: fadeIn 1s ease-in-out;
}
/* Blog Cards Animation */
.post-card {
opacity: 0;
transform: translateY(20px);
animation: fadeIn 1.2s ease-in-out forwards;
transition: transform 0.3s ease-in-out;
}
/* Blog Card Hover Effect */
.post-card:hover {
transform: translateY(-10px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
</style>
</head>
<body>
<div id="navbar-container"></div>
<header class="hero">
<div class="hero-content">
<h1>Welcome to 3Z0</h1>
<p>Explore our collection of thoughtful articles and insights</p>
<a href="/blog" class="cta-button">Read Latest Posts</a>
</div>
</header>
<main class="featured-posts">
<h2>Featured Posts</h2>
<div class="posts-grid">
<article class="post-card">
<div class="post-image" style="background-image: url('https://images.unsplash.com/photo-1499750310107-5fef28a66643')"></div>
<div class="post-content">
<span class="category">Technology</span>
<h3>The Future of Web Development</h3>
<p>Exploring the latest trends and technologies shaping the web development landscape.</p>
<a href="/blogs/1" class="read-more">Read More</a>
</div>
</article>
<article class="post-card">
<div class="post-image" style="background-image: url('https://images.unsplash.com/photo-1516542076529-1ea3854896f2')"></div>
<div class="post-content">
<span class="category">Design</span>
<h3>Minimalist Design Principles</h3>
<p>Understanding the core principles of minimalist design and its impact.</p>
<a href="/blogs/2" class="read-more">Read More</a>
</div>
</article>
<article class="post-card">
<div class="post-image" style="background-image: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTpC1Fqff_cR1Gc9k9Sdqf024cYoD-H6LufLg&s')"></div>
<div class="post-content">
<span class="category">Finance</span>
<h3>Positivity Gambling</h3>
<p>Play more, win big.</p>
<a href="/blogs/7" class="read-more">Read More</a>
</div>
</article>
</div>
</main>
<div id="footer-container"></div>
<script>
function loadComponent(containerId, filePath) {
fetch(filePath)
.then(response => response.text())
.then(html => {
document.getElementById(containerId).innerHTML = html;
const currentPath = window.location.pathname;
document.querySelectorAll('#navbar-container .nav-links a').forEach(link => {
if (link.getAttribute('href') === currentPath) {
link.classList.add('active');
} else {
link.classList.remove('active');
}
});
})
.catch(error => console.error(`Error loading ${filePath}:`, error));
}
document.addEventListener("DOMContentLoaded", function () {
loadComponent('navbar-container', '/styling/navbar.html');
loadComponent('footer-container', '/styling/footer.html');
});
// Toggle menu functionality (executed after navbar loads)
document.addEventListener("DOMContentLoaded", function () {
document.body.addEventListener("click", function (event) {
if (event.target.closest(".menu-toggle")) {
const navLinks = document.querySelector(".nav-links");
if (navLinks) {
navLinks.classList.toggle("active");
}
}
});
});
</script>
</body>
</html>