From f7afa09a76cb973f63ac3727c6803b83a3f7e724 Mon Sep 17 00:00:00 2001 From: CodingPhoenixx Date: Fri, 13 Feb 2026 15:52:07 +0100 Subject: [PATCH] Reworked Navbar --- flightscore/src/components/nav-bar.css | 132 ++++++++++++++----------- flightscore/src/components/nav-bar.ts | 50 +++++++--- flightscore/src/components/ui-link.css | 21 ++-- 3 files changed, 131 insertions(+), 72 deletions(-) diff --git a/flightscore/src/components/nav-bar.css b/flightscore/src/components/nav-bar.css index bc9fb06..6ea5418 100644 --- a/flightscore/src/components/nav-bar.css +++ b/flightscore/src/components/nav-bar.css @@ -1,76 +1,98 @@ nav { - backdrop-filter: blur(10px); - background: var(--color-bg-nav); - border-bottom: 1px solid var(--color-border); - display: flex; - justify-content: space-between; - align-items: center; - padding: 0.75rem 1.5rem; - position: sticky; - top: 0; - z-index: 100; + backdrop-filter: blur(18px) saturate(180%); + -webkit-backdrop-filter: blur(18px) saturate(180%); + background: var(--color-bg-nav); + border-bottom: 1px solid var(--color-border); + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 2rem; + height: 3.5rem; + position: sticky; + top: 0; + z-index: 100; + transition: background 0.3s ease; } .brand { - font-weight: 700; - font-size: 1.1rem; - user-select: none; - width: fit-content; - display: flex; - justify-content: center; - align-items: center; - padding-right: 1rem; - + display: flex; + align-items: center; + gap: 0.65rem; + user-select: none; + cursor: default; } .brand img { - width: auto; - height: 2rem; - padding-right: 1rem; + width: auto; + height: 1.6rem; + flex-shrink: 0; +} + +.brand span { + font-weight: 700; + font-size: 1.05rem; + letter-spacing: -0.02em; + background: linear-gradient( + 135deg, + var(--color-text) 0%, + var(--color-accent) 100% + ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; } .links { - display: flex; - gap: 1.25rem; - align-items: center; + display: flex; + gap: 1.75rem; + align-items: center; } -.links a { - text-decoration: none; +.theme-toggle { + position: relative; + display: grid; + place-items: center; + width: 2.25rem; + height: 2.25rem; + padding: 0; + margin-left: 0.5rem; + background: transparent; + border: 1px solid var(--color-border); + border-radius: 0.5rem; + color: var(--color-text); + cursor: pointer; + transition: + border-color 0.25s ease, + color 0.25s ease, + background 0.25s ease, + transform 0.2s ease; + overflow: hidden; } -a { - color: var(--color-text); - font-weight: 500; - position: relative; +.theme-toggle:hover { + border-color: var(--color-accent); + color: var(--color-accent); + background: color-mix(in srgb, var(--color-accent) 8%, transparent); + transform: scale(1.05); } -a::after { - content: ''; - position: absolute; - bottom: -6px; - left: 0; - width: 0%; - height: 2px; - background: var(--color-accent); - transition: 0.3s ease; +.theme-toggle:active { + transform: scale(0.95); } -a:hover::after { - width: 100%; +.icon { + position: absolute; + width: 1.1rem; + height: 1.1rem; + opacity: 0; + transform: rotate(-90deg) scale(0.6); + transition: + opacity 0.35s ease, + transform 0.35s ease; + pointer-events: none; } -button { - background: none; - border: 1px solid var(--color-border); - border-radius: 5px; - padding: 0.4rem 0.6rem; - color: var(--color-text); - cursor: pointer; - transition: all 0.3s ease; -} - -button:hover { - border-color: var(--color-accent); - color: var(--color-accent); +.icon.visible { + opacity: 1; + transform: rotate(0deg) scale(1); } \ No newline at end of file diff --git a/flightscore/src/components/nav-bar.ts b/flightscore/src/components/nav-bar.ts index ab4332b..b571e7b 100644 --- a/flightscore/src/components/nav-bar.ts +++ b/flightscore/src/components/nav-bar.ts @@ -23,24 +23,52 @@ export class NavBar extends LitElement { localStorage.setItem('theme', this.theme); } - navigate(path: string) { - this.dispatchEvent( - new CustomEvent('nav', { detail: { path }, bubbles: true, composed: true }) - ); - } - render() { return html` diff --git a/flightscore/src/components/ui-link.css b/flightscore/src/components/ui-link.css index b9253d7..9c5c3e4 100644 --- a/flightscore/src/components/ui-link.css +++ b/flightscore/src/components/ui-link.css @@ -2,20 +2,29 @@ a { position: relative; color: var(--color-text); font-weight: 500; + font-size: 0.9rem; + letter-spacing: 0.01em; text-decoration: none; - transition: color 0.25s ease; display: inline-block; + padding: 0.25rem 0; + transition: color 0.25s ease; } a::after { - content: ''; + content: ""; position: absolute; - left: 0; - bottom: -2px; - width: 0%; + left: 50%; + bottom: -1px; + width: 0; height: 2px; background: var(--color-accent); - transition: width 0.3s ease; + border-radius: 1px; + transform: translateX(-50%); + transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1); +} + +a:hover { + color: var(--color-accent); } a:hover::after,