Skip to content

Commit 76a19a4

Browse files
feat: enhance navigation accessibility and styling by adding active state indicators and improving CSS for better visual clarity
1 parent 567ec9f commit 76a19a4

3 files changed

Lines changed: 78 additions & 40 deletions

File tree

assets/css/style.css

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,26 @@ a:hover {
196196
color: #f8fafc;
197197
}
198198

199+
.nav-desktop a.is-active {
200+
color: #f8fafc;
201+
font-weight: 700;
202+
padding: 0.4rem 0.85rem;
203+
margin: 0 -0.15rem;
204+
border-radius: 999px;
205+
background: rgba(255, 255, 255, 0.14);
206+
border: 1px solid rgba(255, 255, 255, 0.28);
207+
box-shadow:
208+
0 0 0 1px rgba(103, 232, 249, 0.22),
209+
0 6px 20px rgba(0, 0, 0, 0.25);
210+
text-decoration: none;
211+
}
212+
213+
.nav-desktop a.is-active:hover {
214+
color: #fff;
215+
background: rgba(255, 255, 255, 0.2);
216+
text-decoration: none;
217+
}
218+
199219
.nav-cta {
200220
display: flex;
201221
align-items: center;
@@ -267,6 +287,16 @@ a:hover {
267287
border-bottom: none;
268288
}
269289

290+
.nav-panel a.is-active {
291+
color: #ecfeff;
292+
font-weight: 700;
293+
border-left: 3px solid #67e8f9;
294+
padding-left: 0.75rem;
295+
margin-left: -0.05rem;
296+
background: rgba(255, 255, 255, 0.06);
297+
border-radius: 0 8px 8px 0;
298+
}
299+
270300
@media (min-width: 768px) {
271301
.nav-desktop {
272302
display: flex;
@@ -287,9 +317,9 @@ main {
287317
z-index: 1;
288318
}
289319

290-
/* Inner pages: default content band over the matrix */
320+
/* Inner pages: light content band over dark matrix */
291321
main > .section:not(.section-alt):not(.section-tint):not(.home-intro):not(.home-cta):not(.page-hero) {
292-
background: rgba(248, 250, 252, 0.9);
322+
background: rgba(248, 250, 252, 0.96);
293323
backdrop-filter: blur(12px);
294324
}
295325

@@ -305,13 +335,8 @@ main > .section:not(.section-alt):not(.section-tint):not(.home-intro):not(.home-
305335
position: relative;
306336
overflow: hidden;
307337
z-index: 1;
308-
background: linear-gradient(
309-
145deg,
310-
rgba(12, 18, 34, 0.78) 0%,
311-
rgba(30, 27, 75, 0.74) 42%,
312-
rgba(14, 116, 144, 0.68) 100%
313-
);
314-
background-size: 200% 200%;
338+
background: var(--brand-hero-grad);
339+
background-size: var(--brand-hero-grad-size);
315340
animation: hero-gradient 14s ease infinite;
316341
}
317342

@@ -1105,13 +1130,9 @@ main > .section:not(.section-alt):not(.section-tint):not(.home-intro):not(.home-
11051130
}
11061131

11071132
.page-hero--mesh {
1108-
background: linear-gradient(
1109-
155deg,
1110-
rgba(30, 27, 75, 0.78) 0%,
1111-
rgba(49, 46, 129, 0.72) 50%,
1112-
rgba(14, 116, 144, 0.68) 100%
1113-
);
1114-
backdrop-filter: blur(8px);
1133+
background: var(--brand-hero-grad);
1134+
background-size: var(--brand-hero-grad-size);
1135+
animation: hero-gradient 14s ease infinite;
11151136
padding-bottom: 3rem;
11161137
margin-bottom: 0;
11171138
}
@@ -1120,18 +1141,32 @@ main > .section:not(.section-alt):not(.section-tint):not(.home-intro):not(.home-
11201141
content: "";
11211142
position: absolute;
11221143
inset: 0;
1123-
background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.4), transparent 55%);
1144+
background:
1145+
radial-gradient(ellipse 80% 50% at 20% 40%, rgba(79, 70, 229, 0.38), transparent 58%),
1146+
radial-gradient(ellipse 60% 40% at 80% 60%, rgba(6, 182, 212, 0.3), transparent 52%),
1147+
radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.25), transparent 55%);
11241148
pointer-events: none;
11251149
}
11261150

1151+
.page-hero--mesh .container {
1152+
position: relative;
1153+
z-index: 1;
1154+
}
1155+
11271156
.page-hero--mesh h1 {
1128-
color: #f8fafc;
1157+
color: #ffffff;
11291158
position: relative;
1159+
text-shadow:
1160+
0 2px 28px rgba(0, 0, 0, 0.55),
1161+
0 1px 3px rgba(0, 0, 0, 0.65);
11301162
}
11311163

11321164
.page-hero--mesh .lead {
1133-
color: rgba(226, 232, 240, 0.9);
1165+
color: #e2e8f0;
1166+
font-weight: 500;
11341167
position: relative;
1168+
max-width: 42rem;
1169+
text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
11351170
}
11361171

11371172
.page-hero h1 {

assets/js/main.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,6 @@
287287
});
288288
}
289289

290-
function headerBandBottom() {
291-
var el = document.querySelector(".site-header");
292-
if (!el) return 0;
293-
var r = el.getBoundingClientRect();
294-
return Math.ceil(r.bottom);
295-
}
296-
297290
function randomBit() {
298291
return Math.random() < 0.5 ? "1" : "0";
299292
}
@@ -302,23 +295,17 @@
302295
var v = viewportSize();
303296
var w = pageBg ? v.w : canvas.clientWidth || v.w;
304297
var h = pageBg ? v.h : canvas.clientHeight || 420;
305-
var headerBottom = pageBg ? headerBandBottom() : 0;
306-
/* Fade trails toward page base (light) so black digits read on white gutters */
307-
ctx.fillStyle = pageBg ? "rgba(241, 245, 249, 0.16)" : "rgba(3, 7, 18, 0.07)";
298+
/* Dark trail so white glyphs stay readable with screen blend on dark body */
299+
ctx.fillStyle = pageBg ? "rgba(2, 6, 14, 0.17)" : "rgba(3, 7, 18, 0.07)";
308300
ctx.fillRect(0, 0, w, h);
309301

310302
ctx.font =
311303
"bold 15px ui-monospace, SFMono-Regular, Menlo, Consolas, 'Cascadia Code', monospace";
312304
for (var i = 0; i < drops.length; i++) {
313305
var x = i * cell + Math.floor(cell * 0.35);
314306
var y = drops[i];
315-
var inHeader = pageBg && headerBottom > 0 && y >= 0 && y <= headerBottom;
316-
/* Header band: bright 0/1 for the strip under .site-header. Elsewhere: black on light areas. */
317-
if (inHeader) {
318-
ctx.fillStyle = "rgba(255, 255, 255, 0.96)";
319-
} else {
320-
ctx.fillStyle = "rgba(15, 23, 42, 0.78)";
321-
}
307+
var g = 248 - (i % 5) * 8;
308+
ctx.fillStyle = "rgba(" + g + ", 255, " + (245 - (i % 3) * 6) + ", 0.9)";
322309
ctx.fillText(randomBit(), x, y);
323310
drops[i] = y + cell * 0.85 + Math.random() * 12;
324311
if (drops[i] > h + 48 && Math.random() > 0.965) {
@@ -384,10 +371,26 @@
384371
});
385372
}
386373

374+
function markActiveNav() {
375+
var p = (location.pathname || "").replace(/\\/g, "/").toLowerCase();
376+
var slug = "home";
377+
if (p.indexOf("download.html") !== -1) slug = "download";
378+
else if (p.indexOf("about.html") !== -1) slug = "about";
379+
else if (p.indexOf("docs.html") !== -1) slug = "docs";
380+
381+
document.querySelectorAll("a[data-nav]").forEach(function (a) {
382+
if (a.getAttribute("data-nav") === slug) {
383+
a.classList.add("is-active");
384+
a.setAttribute("aria-current", "page");
385+
}
386+
});
387+
}
388+
387389
document.querySelectorAll("[data-matrix]").forEach(function (el) {
388390
startMatrix(el);
389391
});
390392
document.querySelectorAll("[data-tilt]").forEach(wireTilt);
391393
wireDashboardPreview();
394+
markActiveNav();
392395
initGsapAnimations();
393396
})();

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
<span>SentraCore</span>
3737
</a>
3838
<nav class="nav-desktop" aria-label="Primary">
39-
<a href="index.html">Home</a>
40-
<a href="pages/download.html">Download</a>
41-
<a href="pages/about.html">About</a>
42-
<a href="pages/docs.html">Docs</a>
39+
<a href="index.html" data-nav="home">Home</a>
40+
<a href="pages/download.html" data-nav="download">Download</a>
41+
<a href="pages/about.html" data-nav="about">About</a>
42+
<a href="pages/docs.html" data-nav="docs">Docs</a>
4343
</nav>
4444
<div class="nav-cta">
4545
<a class="btn btn-primary" href="#" data-auto-download="windows" data-download-track="header"

0 commit comments

Comments
 (0)