Skip to content

Commit c599aea

Browse files
Add mobile responsive design with hamburger menu
1 parent d00ca4b commit c599aea

File tree

1 file changed

+100
-1
lines changed

1 file changed

+100
-1
lines changed

public/index.html

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,45 @@
6262
.nav-links a:hover {
6363
color: #fff;
6464
}
65+
.mobile-menu-btn {
66+
display: none;
67+
background: none;
68+
border: none;
69+
color: #fff;
70+
font-size: 24px;
71+
cursor: pointer;
72+
padding: 8px;
73+
}
74+
@media (max-width: 768px) {
75+
.header-content {
76+
padding: 0 20px;
77+
}
78+
.nav-links {
79+
display: none;
80+
position: absolute;
81+
top: 100%;
82+
left: 0;
83+
right: 0;
84+
background: #1e293b;
85+
border-top: 1px solid #334155;
86+
flex-direction: column;
87+
gap: 0;
88+
padding: 0;
89+
}
90+
.nav-links.active {
91+
display: flex;
92+
}
93+
.nav-links a {
94+
padding: 16px 20px;
95+
border-bottom: 1px solid #334155;
96+
}
97+
.mobile-menu-btn {
98+
display: block;
99+
}
100+
.header {
101+
position: relative;
102+
}
103+
}
65104
.hero {
66105
max-width: 1200px;
67106
margin: 0 auto;
@@ -78,6 +117,20 @@
78117
background-clip: text;
79118
line-height: 1.2;
80119
}
120+
@media (max-width: 768px) {
121+
.hero {
122+
padding: 40px 20px;
123+
}
124+
.hero h1 {
125+
font-size: 36px;
126+
}
127+
.hero .subtitle {
128+
font-size: 18px;
129+
}
130+
.hero .description {
131+
font-size: 16px;
132+
}
133+
}
81134
.hero .subtitle {
82135
font-size: 24px;
83136
color: #94a3b8;
@@ -134,6 +187,12 @@
134187
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
135188
gap: 24px;
136189
}
190+
@media (max-width: 768px) {
191+
.features {
192+
padding: 0 20px 40px;
193+
grid-template-columns: 1fr;
194+
}
195+
}
137196
.feature-card {
138197
background: #1e293b;
139198
border: 1px solid #334155;
@@ -174,6 +233,14 @@
174233
background: #1e293b;
175234
border-top: 1px solid #334155;
176235
}
236+
@media (max-width: 768px) {
237+
.resources {
238+
padding: 40px 20px;
239+
}
240+
.resource-grid {
241+
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
242+
}
243+
}
177244
.resources h2 {
178245
font-size: 32px;
179246
text-align: center;
@@ -226,12 +293,15 @@
226293
<div class="logo-icon">📊</div>
227294
<span>DataSetIQ</span>
228295
</div>
229-
<nav class="nav-links">
296+
<nav class="nav-links" id="navLinks">
230297
<a href="https://datasetiq.com">Home</a>
231298
<a href="https://datasetiq.com/docs">Documentation</a>
232299
<a href="https://datasetiq.com/pricing">Pricing</a>
233300
<a href="https://datasetiq.com/support">Support</a>
234301
</nav>
302+
<button class="mobile-menu-btn" id="mobileMenuBtn" aria-label="Toggle menu">
303+
304+
</button>
235305
</div>
236306
</header>
237307

@@ -296,5 +366,34 @@ <h2>Add-in Resources</h2>
296366
<a href="https://datasetiq.com/terms">Terms</a>
297367
</p>
298368
</footer>
369+
370+
<script>
371+
// Mobile menu toggle
372+
const mobileMenuBtn = document.getElementById('mobileMenuBtn');
373+
const navLinks = document.getElementById('navLinks');
374+
375+
if (mobileMenuBtn) {
376+
mobileMenuBtn.addEventListener('click', function() {
377+
navLinks.classList.toggle('active');
378+
this.textContent = navLinks.classList.contains('active') ? '✕' : '☰';
379+
});
380+
381+
// Close menu when clicking a link
382+
navLinks.querySelectorAll('a').forEach(link => {
383+
link.addEventListener('click', function() {
384+
navLinks.classList.remove('active');
385+
mobileMenuBtn.textContent = '☰';
386+
});
387+
});
388+
389+
// Close menu when clicking outside
390+
document.addEventListener('click', function(event) {
391+
if (!event.target.closest('.header-content')) {
392+
navLinks.classList.remove('active');
393+
mobileMenuBtn.textContent = '☰';
394+
}
395+
});
396+
}
397+
</script>
299398
</body>
300399
</html>

0 commit comments

Comments
 (0)