From 8530311069778a3d6497a4184f682ed8f7b6b66f Mon Sep 17 00:00:00 2001 From: Diaco Soltanpour Date: Fri, 9 Oct 2026 17:32:20 +0330 Subject: [PATCH] Slide the nav underline when changing tabs. Co-authored-by: Cursor --- slips/static/slips/css/style.css | 52 ++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/slips/static/slips/css/style.css b/slips/static/slips/css/style.css index 8825879..c0bf6cc 100644 --- a/slips/static/slips/css/style.css +++ b/slips/static/slips/css/style.css @@ -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 { -- 2.49.1