Slide the nav underline when changing tabs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-09 17:32:20 +03:30
parent 15adc57ba5
commit 8530311069

View File

@@ -119,6 +119,7 @@ html[lang="fa"] body {
top: 0;
z-index: 50;
overflow: hidden;
view-transition-name: navbar;
}
.nav-container {
@@ -156,6 +157,7 @@ html[lang="fa"] body {
}
.nav-link {
position: relative;
color: var(--navbar-muted);
text-decoration: none;
font-weight: 500;
@@ -167,8 +169,16 @@ html[lang="fa"] body {
color: var(--navbar-fg);
}
.nav-link.active {
border-bottom: 2px solid var(--navbar-accent);
.nav-link.active::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 2px;
background: var(--navbar-accent);
border-radius: 2px;
view-transition-name: nav-indicator;
}
.nav-actions {
@@ -218,6 +228,44 @@ html[lang="fa"] body {
max-width: var(--content-max);
margin: 2rem auto;
padding: 0 2rem;
view-transition-name: main;
}
@view-transition {
navigation: auto;
}
::view-transition-group(navbar),
::view-transition-old(navbar),
::view-transition-new(navbar) {
animation: none;
}
::view-transition-old(main) {
animation: 180ms ease both main-leave;
}
::view-transition-new(main) {
animation: 180ms ease both main-enter;
}
@keyframes main-leave {
to {
opacity: 0;
}
}
@keyframes main-enter {
from {
opacity: 0;
transform: translateY(6px);
}
}
@media (prefers-reduced-motion: reduce) {
@view-transition {
navigation: none;
}
}
.page-grid {