Skip to content

Commit 65f6933

Browse files
committed
Improved mobile functionality.
1 parent 4424117 commit 65f6933

File tree

5 files changed

+158
-33
lines changed

5 files changed

+158
-33
lines changed

assets/about.css

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,41 @@ li, p {
1717
margin-bottom: 50px;
1818
}
1919

20-
/* Responsive Design */
20+
/* Enhanced Mobile Responsiveness */
2121
@media (max-width: 768px) {
2222
.story, .programming-journey, .education, .personal-growth, .philosophy {
2323
width: 90%;
24-
margin: 20px auto;
24+
margin: 15px auto;
25+
padding: 15px;
26+
}
27+
28+
/* Improved Typography for Mobile */
29+
p {
30+
font-size: clamp(14px, 3.5vw, 18px);
31+
margin-bottom: 15px;
32+
}
33+
34+
h2 {
35+
font-size: clamp(24px, 6vw, 32px);
36+
margin-bottom: 15px;
37+
}
38+
39+
/* Contact Section Mobile Optimization */
40+
#contact h2 {
41+
font-size: clamp(20px, 5vw, 28px);
42+
}
43+
44+
/* Adjust Section Spacing */
45+
.title {
46+
margin-bottom: 25px;
47+
}
48+
}
49+
50+
/* Additional Mobile Optimization */
51+
@media (max-width: 480px) {
52+
.story, .programming-journey, .education, .personal-growth, .philosophy {
53+
width: 95%;
54+
margin: 10px auto;
55+
padding: 12px;
2556
}
2657
}

assets/load/header.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<nav role="navigation" aria-label="Main navigation" class="main-nav">
2+
<button class="menu-toggle" aria-label="Toggle navigation menu">
3+
4+
</button>
25
<div class="nav-container">
36
<ul role="menubar">
47
<li role="none">

assets/load/universal.css

Lines changed: 87 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
--section-bg: rgba(65, 65, 65, 0.95);
1313
--transition-speed: 0.3s;
1414
--visited-link: #dfa843;
15-
1615
--highlight-color: #e7df69;
1716
--visited-color: #dfa843;
1817
--transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
@@ -79,6 +78,16 @@ header {
7978
z-index: 1000;
8079
}
8180

81+
.menu-toggle {
82+
display: none;
83+
font-size: 24px;
84+
background: none;
85+
border: none;
86+
color: var(--text-light);
87+
padding: 10px;
88+
cursor: pointer;
89+
}
90+
8291
.main-nav {
8392
background: rgba(30, 92, 143, 0.95);
8493
backdrop-filter: blur(10px);
@@ -170,32 +179,6 @@ nav ul li {
170179
border-color: var(--accent-color);
171180
}
172181

173-
@media screen and (max-width: 768px) {
174-
.nav-container {
175-
padding: 0 10px;
176-
}
177-
178-
nav ul {
179-
flex-wrap: wrap;
180-
justify-content: space-around;
181-
gap: 5px;
182-
}
183-
184-
nav ul li {
185-
margin: 5px;
186-
}
187-
188-
.nav-link {
189-
padding: 8px 12px;
190-
font-size: 24px;
191-
}
192-
193-
.nav-link img {
194-
width: 20px;
195-
height: 20px;
196-
}
197-
}
198-
199182
.nav-container::before,
200183
.nav-container::after {
201184
content: '';
@@ -221,7 +204,6 @@ nav ul li {
221204
right: 2%;
222205
}
223206

224-
225207
/* Section Styling */
226208
section {
227209
padding: 40px 20px;
@@ -300,7 +282,83 @@ canvas {
300282
filter: blur(1px);
301283
}
302284

303-
/* Responsive Design */
285+
/* Enhanced Mobile Styles */
286+
@media screen and (max-width: 768px) {
287+
/* Typography adjustments */
288+
h1 { font-size: clamp(2.5rem, 8vw, 4rem); }
289+
h2 { font-size: clamp(2rem, 6vw, 2.5rem); }
290+
h3 { font-size: clamp(1.5rem, 4vw, 2rem); }
291+
li, p { font-size: 16px; }
292+
293+
/* Mobile navigation */
294+
.menu-toggle {
295+
display: block;
296+
}
297+
298+
.main-nav {
299+
position: relative;
300+
}
301+
302+
.nav-container {
303+
padding: 0;
304+
}
305+
306+
nav ul {
307+
display: none;
308+
flex-direction: column;
309+
position: absolute;
310+
top: 100%;
311+
left: 0;
312+
width: 100%;
313+
background: rgba(30, 92, 143, 0.95);
314+
padding: 0;
315+
}
316+
317+
nav ul.show {
318+
display: flex;
319+
}
320+
321+
nav ul li {
322+
margin: 0;
323+
width: 100%;
324+
}
325+
326+
.nav-link {
327+
padding: 12px 16px;
328+
font-size: 20px;
329+
border-radius: 0;
330+
justify-content: flex-start;
331+
}
332+
333+
/* Section adjustments */
334+
section {
335+
max-width: 95%;
336+
padding: 20px 15px;
337+
margin: 10px auto;
338+
}
339+
340+
section.title {
341+
width: 90%;
342+
}
343+
344+
/* Contact section adjustments */
345+
section#contact p a {
346+
font-size: 20px;
347+
}
348+
349+
section#contact p a img {
350+
width: 30px;
351+
height: 30px;
352+
}
353+
354+
/* Navigation container decorative elements */
355+
.nav-container::before,
356+
.nav-container::after {
357+
display: none;
358+
}
359+
}
360+
361+
/* Existing media queries */
304362
@media screen and (min-width: 500px) {
305363
h1 {
306364
font-size: 4rem;

assets/load/universal.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ document.addEventListener("DOMContentLoaded", () => {
88
});
99

1010
document.addEventListener('DOMContentLoaded', () => {
11-
// Set active nav link based on current page
11+
const menuToggle = document.querySelector('.menu-toggle');
12+
const navMenu = document.querySelector('nav ul');
1213
const currentPage = window.location.pathname.split('/').pop();
1314
const navLinks = document.querySelectorAll('.nav-link');
1415

@@ -28,6 +29,21 @@ document.addEventListener('DOMContentLoaded', () => {
2829
img.style.transform = 'scale(1) rotate(0deg)';
2930
});
3031
});
32+
33+
menuToggle.addEventListener('click', () => {
34+
navMenu.classList.toggle('show');
35+
menuToggle.setAttribute('aria-expanded',
36+
menuToggle.getAttribute('aria-expanded') === 'true' ? 'false' : 'true'
37+
);
38+
});
39+
40+
// Close menu when clicking outside
41+
document.addEventListener('click', (e) => {
42+
if (!e.target.closest('.main-nav')) {
43+
navMenu.classList.remove('show');
44+
menuToggle.setAttribute('aria-expanded', 'false');
45+
}
46+
});
3147
});
3248

3349
// Include the 'matter-wrap' plugin

projects/projectsUniversal.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ document.addEventListener("DOMContentLoaded", () => {
88
});
99

1010
document.addEventListener('DOMContentLoaded', () => {
11-
// Set active nav link based on current page
11+
const menuToggle = document.querySelector('.menu-toggle');
12+
const navMenu = document.querySelector('nav ul');
1213
const currentPage = window.location.pathname.split('/').pop();
1314
const navLinks = document.querySelectorAll('.nav-link');
1415

@@ -28,8 +29,24 @@ document.addEventListener('DOMContentLoaded', () => {
2829
img.style.transform = 'scale(1) rotate(0deg)';
2930
});
3031
});
32+
33+
menuToggle.addEventListener('click', () => {
34+
navMenu.classList.toggle('show');
35+
menuToggle.setAttribute('aria-expanded',
36+
menuToggle.getAttribute('aria-expanded') === 'true' ? 'false' : 'true'
37+
);
38+
});
39+
40+
// Close menu when clicking outside
41+
document.addEventListener('click', (e) => {
42+
if (!e.target.closest('.main-nav')) {
43+
navMenu.classList.remove('show');
44+
menuToggle.setAttribute('aria-expanded', 'false');
45+
}
46+
});
3147
});
3248

49+
3350
// Include the 'matter-wrap' plugin
3451
Matter.use('matter-wrap');
3552

0 commit comments

Comments
 (0)