Skip to content

Commit f2452df

Browse files
authored
Merge pull request #9 from rmfisher26/visual-styles
Visual styles
2 parents 6ba24ce + 9f176b1 commit f2452df

File tree

2 files changed

+53
-27
lines changed

2 files changed

+53
-27
lines changed

src/components/Header.astro

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ const currentPath = Astro.url.pathname;
2323
aria-expanded="false"
2424
aria-controls="main-nav"
2525
>
26-
<svg class="icon-menu" width="22" height="22" viewBox="0 0 22 22" fill="none" aria-hidden="true">
27-
<line x1="3" y1="6" x2="19" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
28-
<line x1="3" y1="11" x2="19" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
29-
<line x1="3" y1="16" x2="19" y2="16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
30-
</svg>
31-
<svg class="icon-close" width="22" height="22" viewBox="0 0 22 22" fill="none" aria-hidden="true">
32-
<line x1="4" y1="4" x2="18" y2="18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
33-
<line x1="18" y1="4" x2="4" y2="18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
26+
<svg class="burger-icon" width="22" height="22" viewBox="0 0 22 22" fill="none" aria-hidden="true">
27+
<line class="bar bar-top" x1="3" y1="6" x2="19" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
28+
<line class="bar bar-mid" x1="3" y1="11" x2="19" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
29+
<line class="bar bar-bottom" x1="3" y1="16" x2="19" y2="16" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
3430
</svg>
3531
</button>
3632
</div>
@@ -43,17 +39,21 @@ const currentPath = Astro.url.pathname;
4339
top: 0;
4440
z-index: 200;
4541
background: var(--paper);
46-
border-bottom: 2px solid var(--ink);
42+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
4743
padding: 0 2rem;
4844
display: grid;
4945
grid-template-columns: 1fr auto 1fr;
5046
align-items: center;
5147
min-height: 72px;
52-
transition: box-shadow 0.25s ease;
48+
transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
5349
}
5450

5551
#site-header.scrolled {
56-
box-shadow: 0 4px 24px rgba(13, 15, 20, 0.07);
52+
background: rgba(255, 255, 255, 0.72);
53+
backdrop-filter: blur(16px);
54+
-webkit-backdrop-filter: blur(16px);
55+
border-bottom-color: rgba(0, 0, 0, 0.08);
56+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
5757
}
5858

5959
/* ── LOGO ── */
@@ -145,23 +145,30 @@ const currentPath = Astro.url.pathname;
145145
width: 40px;
146146
height: 40px;
147147
background: none;
148-
border: 1.5px solid var(--border);
148+
border: none;
149149
border-radius: 4px;
150150
cursor: pointer;
151151
color: var(--ink);
152-
transition: border-color 0.2s, background 0.2s;
152+
transition: background 0.2s;
153153
flex-shrink: 0;
154154
}
155155

156156
.menu-toggle:hover {
157-
border-color: var(--ink);
158157
background: rgba(13, 15, 20, 0.04);
159158
}
160159

161-
.icon-close { display: none; }
160+
/* ── BURGER ANIMATION ── */
161+
.bar {
162+
transform-box: fill-box; /* rotate around each line's own center */
163+
transform-origin: center;
164+
transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
165+
opacity 0.2s ease;
166+
}
162167

163-
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
164-
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
168+
/* Closed → open: bars converge at center then rotate into X */
169+
.menu-toggle[aria-expanded="true"] .bar-top { transform: translateY(5px) rotate(45deg); }
170+
.menu-toggle[aria-expanded="true"] .bar-mid { opacity: 0; transform: scaleX(0.2); }
171+
.menu-toggle[aria-expanded="true"] .bar-bottom { transform: translateY(-5px) rotate(-45deg); }
165172

166173
/* ── MOBILE ── */
167174
@media (max-width: 680px) {
@@ -174,38 +181,57 @@ const currentPath = Astro.url.pathname;
174181
nav {
175182
display: none;
176183
position: absolute;
177-
top: calc(100% + 2px); /* sits just below the border */
184+
top: 100%;
178185
left: 0;
179186
right: 0;
180187
flex-direction: column;
181188
gap: 0;
182-
background: var(--paper);
183-
border-bottom: 2px solid var(--ink);
184-
box-shadow: 0 8px 24px rgba(13, 15, 20, 0.08);
189+
background: #0a2d54;
190+
border-bottom: none;
191+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
185192
}
186193

187194
nav.open {
188195
display: flex;
189-
animation: slideDown 0.2s ease both;
196+
animation: menuSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
190197
}
191198

192-
@keyframes slideDown {
193-
from { opacity: 0; transform: translateY(-8px); }
199+
@keyframes menuSlide {
200+
from { opacity: 0; transform: translateY(-6px); }
194201
to { opacity: 1; transform: translateY(0); }
195202
}
196203

197204
nav a {
198205
padding: 1rem 1.5rem;
199-
border-top: 1px solid var(--border);
206+
border-top: 1px solid rgba(255, 255, 255, 0.1);
200207
font-size: 0.95rem;
201208
letter-spacing: 0.06em;
209+
color: rgba(255, 255, 255, 0.85);
210+
opacity: 0;
211+
transform: translateX(-8px);
212+
transition: background 0.2s, color 0.2s;
213+
}
214+
215+
nav.open a {
216+
animation: itemSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
217+
}
218+
219+
nav.open a:nth-child(1) { animation-delay: 0.06s; }
220+
nav.open a:nth-child(2) { animation-delay: 0.12s; }
221+
nav.open a:nth-child(3) { animation-delay: 0.18s; }
222+
223+
@keyframes itemSlide {
224+
from { opacity: 0; transform: translateX(-8px); }
225+
to { opacity: 1; transform: translateX(0); }
202226
}
203227

204228
nav a::after { display: none; }
205229

230+
nav a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
231+
206232
nav a.active {
207233
color: var(--accent);
208-
background: rgba(0, 200, 150, 0.05);
234+
background: rgba(255, 255, 255, 0.06);
209235
}
210236

211237
.tag-badge { display: none; }

src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--ink: #0d0f14;
33
--paper: #ffffff;
44
--accent: #469d9b;
5-
--accent2: #114c8b;
5+
--accent2: #0a2d54;
66
--muted: #8a8070;
77
--card: #ffffff;
88
--border: #d8d0c0;

0 commit comments

Comments
 (0)