@@ -5,123 +5,149 @@ const navLinks = [
55 { href: ' https://www.pwnfuzz.com' , label: ' About' , external: true },
66];
77---
8+
89<header class =" site-header" id =" siteHeader" >
9- <head >
10- <link rel =" preconnect" href =" https://fonts.googleapis.com" >
11- <link rel =" preconnect" href =" https://fonts.gstatic.com" crossorigin >
12- <link href =" https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@700&display=swap" rel =" stylesheet" >
13- </head >
14- <div class =" header-inner" >
15- <a href =" /" class =" site-logo" ><span class =" logo-prompt" >> </span > <span class =" logo-mono" >PwnFuzz</span ><span > Labs</span ></a >
10+ <div class =" header-inner container" >
11+ <a href =" /" class =" site-logo" >
12+ <span class =" logo-text" >PwnFuzz</span >
13+ <span class =" logo-suffix" >Labs</span >
14+ </a >
1615 <nav class =" main-nav" >
1716 <ul >
1817 { navLinks .map (link => (
19- <li ><a href = { link .href } class = { Astro .url .pathname .startsWith (link .href ) && link .href !== ' /' ? ' active' : (Astro .url .pathname === link .href ? ' active' : ' ' )} target = { link .external ? ' _blank' : undefined } rel = { link .external ? ' noopener' : undefined } >{ link .label } </a ></li >
18+ <li >
19+ <a
20+ href = { link .href }
21+ class = { Astro .url .pathname .startsWith (link .href ) && link .href !== ' /' ? ' active' : (Astro .url .pathname === link .href ? ' active' : ' ' )}
22+ target = { link .external ? ' _blank' : undefined }
23+ rel = { link .external ? ' noopener' : undefined }
24+ >
25+ { link .label }
26+ </a >
27+ </li >
2028 ))}
2129 </ul >
2230 </nav >
2331 </div >
24- <style >
25- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@600;700&display=swap');
26- .site-header {
27- font-family: 'Inter', sans-serif;
28- background: var(--drac-bg-alt);
29- box-shadow: 0 2px 8px rgba(40,42,54,0.10);
30- border-bottom: 2px solid var(--drac-selection);
31- position: sticky;
32- top: 0;
33- z-index: 100;
34- }
32+ </header >
33+
34+ <style >
35+ .site-header {
36+ position: sticky;
37+ top: 0;
38+ z-index: 1000;
39+ width: 100%;
40+ background: rgba(255, 255, 255, 0.7); /* Light Glassy */
41+ backdrop-filter: blur(12px);
42+ -webkit-backdrop-filter: blur(12px);
43+ border-bottom: 1px solid rgba(226, 232, 240, 0.6); /* Subtle border */
44+ transition: transform 0.3s ease;
45+ }
46+
47+ .site-header.hide {
48+ transform: translateY(-100%);
49+ }
50+
51+ .header-inner {
52+ display: flex;
53+ align-items: center;
54+ justify-content: space-between;
55+ height: 70px;
56+ }
57+
58+ .site-logo {
59+ display: flex;
60+ align-items: center;
61+ gap: 0.3rem;
62+ font-family: var(--font-mono);
63+ font-weight: 700;
64+ font-size: 1.25rem;
65+ color: var(--fg-primary);
66+ text-decoration: none;
67+ letter-spacing: -0.03em;
68+ }
69+
70+ .logo-text {
71+ color: var(--fg-primary); /* Clean dark text */
72+ }
73+
74+ .logo-suffix {
75+ color: var(--fg-muted);
76+ font-size: 0.9em;
77+ font-weight: 500;
78+ }
79+
80+ .main-nav ul {
81+ display: flex;
82+ gap: 0.5rem; /* Reduced gap for pill spacing */
83+ list-style: none;
84+ margin: 0;
85+ padding: 0;
86+ }
87+
88+ .main-nav a {
89+ color: var(--fg-secondary);
90+ font-size: 0.9rem;
91+ font-weight: 500;
92+ padding: 0.5rem 1rem;
93+ border-radius: 20px; /* Pill shape */
94+ transition: all 0.2s ease;
95+ text-decoration: none;
96+ border: none;
97+ }
98+
99+ .main-nav a:hover {
100+ color: var(--fg-primary);
101+ background: rgba(0, 0, 0, 0.05); /* Subtle hover bg */
102+ }
103+
104+ .main-nav a.active {
105+ color: var(--fg-primary);
106+ background: rgba(0, 0, 0, 0.08); /* Active pill */
107+ font-weight: 600;
108+ }
109+
110+ /* Remove old underline styles */
111+ .main-nav a.active::after {
112+ display: none;
113+ }
114+
115+ @media (max-width: 768px) {
35116 .header-inner {
36- max-width: 1550px;
37- margin: 0 auto;
38- display: flex;
39- align-items: center;
40- justify-content: space-between;
41- padding: 0.7rem 1.5rem;
42- }
43- .site-logo {
44- font-weight: 700;
45- font-size: 1.4rem;
46- color: var(--drac-pink);
47- letter-spacing: 1px;
48- text-decoration: none;
49- display: flex;
50- align-items: center;
51- gap: 0.2em;
52- }
53- .logo-prompt {
54- font-family: 'JetBrains Mono', monospace;
55- color: var(--accent);
56- font-size: 1.3rem;
57- font-weight: 700;
58- margin-right: 0.1em;
59- user-select: none;
60- }
61- .logo-mono {
62- font-family: 'JetBrains Mono', monospace;
63- font-size: 1.35rem;
64- color: var(--drac-pink);
65- font-weight: 700;
66- letter-spacing: 0.5px;
67- }
68- .site-logo span {
69- font-weight: 600;
70- color: var(--drac-fg);
117+ flex-direction: column;
118+ height: auto;
119+ padding: 1rem;
120+ gap: 1rem;
71121 }
122+
72123 .main-nav ul {
73- display: flex;
74- gap: 2rem;
75- list-style: none;
76- margin: 0;
77- padding: 0;
124+ gap: 0.5rem;
125+ flex-wrap: wrap;
126+ justify-content: center;
78127 }
79- .main-nav a {
80- color: var(--drac-cyan);
81- text-decoration: none;
82- font-weight: 600;
83- font-size: 1rem;
84- padding-bottom: 2px;
85- border-bottom: 2px solid transparent;
86- transition: border 0.2s, color 0.2s;
128+ }
129+ </style >
130+
131+ <script >
132+ let lastScroll = 0;
133+ const header = document.getElementById('siteHeader');
134+
135+ window.addEventListener('scroll', () => {
136+ const currentScroll = window.scrollY;
137+
138+ if (currentScroll <= 0) {
139+ header?.classList.remove('hide');
140+ return;
87141 }
88- .main-nav a.active {
89- color: var(--accent);
90- border-bottom: 2px solid var(--accent);
142+
143+ if (currentScroll > lastScroll && currentScroll > 80) {
144+ // Scrolling down
145+ header?.classList.add('hide');
146+ } else {
147+ // Scrolling up
148+ header?.classList.remove('hide');
91149 }
92- @media (max-width: 700px) {
93- .header-inner {
94- flex-direction: column;
95- align-items: flex-start;
96- padding: 0.7rem 1rem;
97- }
98- .main-nav ul {
99- gap: 1.2rem;
100- flex-wrap: wrap;
101- }
102- .site-logo {
103- margin-bottom: 0.5rem;
104- }
105- }
106- .site-header.hide-on-scroll {
107- transform: translateY(-100%);
108- transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
109- }
110- .site-header {
111- transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
112- }
113- </style >
114- <script is:inline >
115- function onScroll() {
116- const header = document.getElementById('siteHeader');
117- if (window.scrollY === 0) {
118- header.classList.remove('hide-on-scroll');
119- } else {
120- header.classList.add('hide-on-scroll');
121- }
122- }
123- window.addEventListener('scroll', onScroll);
124- // Run once on load in case not at top
125- onScroll();
126- </script >
127- </header >
150+
151+ lastScroll = currentScroll;
152+ });
153+ </script >
0 commit comments