navbar transparente

This commit is contained in:
2026-11-23 11:07:22 +02:00
parent ffe58e124f
commit 55af32d270
2 changed files with 100 additions and 55 deletions
+92 -55
View File
@@ -3,27 +3,46 @@
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 40; z-index: 40;
background: #090909; background: rgba(9, 9, 9, 0.52);
color: #fff; color: #fff;
border-bottom: 1px solid #ffffff14; border-bottom: 1px solid transparent;
-webkit-backdrop-filter: saturate(140%) blur(14px);
backdrop-filter: saturate(140%) blur(14px);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
transition:
background-color 0.28s ease,
border-color 0.28s ease,
box-shadow 0.28s ease,
backdrop-filter 0.28s ease;
}
.tempo-header[data-scrolled],
.tempo-header[data-expanded] {
background: rgba(9, 9, 9, 0.88);
border-bottom-color: rgba(255, 255, 255, 0.08);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
} }
.tempo-header-inner { .tempo-header-inner {
display: grid; display: grid;
grid-template-columns: minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr) auto auto;
grid-template-rows: 71px; grid-template-rows: 56px;
align-items: center; align-items: center;
column-gap: 0.5rem; column-gap: 0.5rem;
max-width: 1600px; max-width: 1600px;
margin-inline: auto; margin-inline: auto;
padding-inline: 0.75rem; padding-inline: 0.75rem;
transition: grid-template-rows 0.28s ease;
} }
.tempo-logo-link { .tempo-logo-link {
grid-area: 1 / 1; grid-area: 1 / 1;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
width: 112px; width: 104px;
max-width: 100%; max-width: 100%;
border-radius: 0.25rem; border-radius: 0.25rem;
transition: opacity 0.2s ease;
}
.tempo-logo-link:hover {
opacity: 0.92;
} }
.tempo-header-logo { .tempo-header-logo {
width: 100%; width: 100%;
@@ -45,28 +64,29 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 0.4rem; gap: 0.35rem;
width: 100%; width: 100%;
min-height: 44px; min-height: 40px;
padding: 0.5rem 0.75rem; padding: 0.375rem 0.625rem;
border-radius: 0.5rem; border-radius: 0.5rem;
color: #e2e8f0; color: #e2e8f0;
font-size: 1rem; font-size: 0.9375rem;
line-height: 1.5; line-height: 1.4;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
transition: transition:
color 0.2s, color 0.2s ease,
background 0.2s; background-color 0.2s ease,
box-shadow 0.2s ease;
} }
.tempo-nav-trigger:hover, .tempo-nav-trigger:hover,
.tempo-nav-trigger[data-state='open'] { .tempo-nav-trigger[data-state='open'] {
background: #ffffff0d; background: rgba(255, 255, 255, 0.08);
color: #fff; color: #fff;
} }
.tempo-nav-trigger[data-current-group] { .tempo-nav-trigger[data-current-group] {
color: #fff; color: #fff;
background: #ffffff08; background: rgba(255, 255, 255, 0.05);
box-shadow: inset 0 -2px #ed1c24; box-shadow: inset 0 -2px #ed1c24;
} }
.tempo-nav-trigger > svg { .tempo-nav-trigger > svg {
@@ -93,14 +113,18 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.4rem; gap: 0.4rem;
min-height: 44px; min-height: 40px;
padding: 0.4rem; padding: 0.35rem 0.4rem;
border-radius: 0.5rem; border-radius: 0.5rem;
color: #e2e8f0; color: #e2e8f0;
font-size: 0.8125rem; font-size: 0.8125rem;
transition:
background-color 0.2s ease,
color 0.2s ease;
} }
.tempo-utility-button:hover { .tempo-utility-button:hover {
background: #ffffff10; background: rgba(255, 255, 255, 0.08);
color: #fff;
} }
.tempo-header-actions { .tempo-header-actions {
grid-area: 1 / 2; grid-area: 1 / 2;
@@ -112,22 +136,23 @@
.tempo-login-button { .tempo-login-button {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.45rem;
min-height: 44px; min-height: 40px;
padding: 0.5rem 0.625rem; padding: 0.4rem 0.625rem;
border: 1px solid #ffffff40; border: 1px solid rgba(255, 255, 255, 0.22);
border-radius: 0.5rem; border-radius: 0.5rem;
color: #fff; color: #fff;
font-size: 0.875rem; font-size: 0.8125rem;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
transition: transition:
background 0.2s, background-color 0.2s ease,
border-color 0.2s; border-color 0.2s ease,
color 0.2s ease;
} }
.tempo-login-button:hover { .tempo-login-button:hover {
background: #ffffff10; background: rgba(255, 255, 255, 0.08);
border-color: #ffffff80; border-color: rgba(255, 255, 255, 0.4);
} }
.tempo-login-button > span { .tempo-login-button > span {
max-width: clamp(2rem, calc(100vw - 18rem), 6rem); max-width: clamp(2rem, calc(100vw - 18rem), 6rem);
@@ -137,14 +162,17 @@
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 44px; width: 40px;
height: 44px; height: 40px;
flex-shrink: 0; flex-shrink: 0;
border-radius: 0.5rem; border-radius: 0.5rem;
color: #e2e8f0; color: #e2e8f0;
transition:
background-color 0.2s ease,
color 0.2s ease;
} }
.tempo-panel-summary:hover { .tempo-panel-summary:hover {
background: #ffffff10; background: rgba(255, 255, 255, 0.08);
color: #fff; color: #fff;
} }
.tempo-panel-count { .tempo-panel-count {
@@ -166,10 +194,10 @@
grid-area: 4 / 1 / auto / -1; grid-area: 4 / 1 / auto / -1;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 0.5rem; gap: 0.45rem;
min-height: 44px; min-height: 40px;
margin-bottom: 1rem; margin-bottom: 0.875rem;
padding: 0.5rem 0.875rem; padding: 0.45rem 0.8rem;
border: 1px solid #ed1c24; border: 1px solid #ed1c24;
border-radius: 0.5rem; border-radius: 0.5rem;
background: #ed1c24; background: #ed1c24;
@@ -177,26 +205,34 @@
font-size: 0.8125rem; font-size: 0.8125rem;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
transition: background 0.2s; transition:
background-color 0.2s ease,
border-color 0.2s ease,
transform 0.2s ease;
} }
.tempo-interest-button:hover { .tempo-interest-button:hover {
background: #c9151c; background: #c9151c;
border-color: #c9151c;
} }
.tempo-header-toggle { .tempo-header-toggle {
grid-area: 1 / 3; grid-area: 1 / 3;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 44px; width: 40px;
height: 44px; height: 40px;
border: 1px solid #ffffff33; border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 0.5rem; border-radius: 0.5rem;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
transition:
background-color 0.2s ease,
border-color 0.2s ease;
} }
.tempo-header-toggle:hover, .tempo-header-toggle:hover,
.tempo-header-toggle[aria-expanded='true'] { .tempo-header-toggle[aria-expanded='true'] {
background: #ffffff10; background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.32);
} }
.tempo-header[data-expanded] .tempo-primary-navigation { .tempo-header[data-expanded] .tempo-primary-navigation {
display: block; display: block;
@@ -220,11 +256,11 @@
@media (min-width: 640px) { @media (min-width: 640px) {
.tempo-header-inner { .tempo-header-inner {
grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-columns: minmax(0, 1fr) auto auto auto;
column-gap: 0.75rem; column-gap: 0.625rem;
padding-inline: 1.5rem; padding-inline: 1.25rem;
} }
.tempo-logo-link { .tempo-logo-link {
width: 132px; width: 116px;
} }
.tempo-interest-button { .tempo-interest-button {
display: inline-flex; display: inline-flex;
@@ -237,13 +273,13 @@
} }
@media (min-width: 1280px) { @media (min-width: 1280px) {
.tempo-header-inner { .tempo-header-inner {
grid-template-rows: minmax(71px, auto); grid-template-rows: minmax(56px, auto);
grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-columns: auto minmax(0, 1fr) auto auto auto;
column-gap: 0.25rem; column-gap: 0.375rem;
padding-inline: 1.25rem; padding-inline: 1.25rem;
} }
.tempo-logo-link { .tempo-logo-link {
width: 100px; width: 96px;
} }
.tempo-login-button > span { .tempo-login-button > span {
max-width: 3rem; max-width: 3rem;
@@ -260,13 +296,14 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
gap: 0; gap: 0.125rem;
} }
.tempo-nav-trigger { .tempo-nav-trigger {
justify-content: center; justify-content: center;
padding-inline: 0.25rem; min-height: 38px;
font-size: 1.125rem; padding: 0.375rem 0.5rem;
letter-spacing: 0.025em; font-size: 0.9375rem;
letter-spacing: 0.01em;
} }
.tempo-header-extras, .tempo-header-extras,
.tempo-header[data-expanded] .tempo-header-extras { .tempo-header[data-expanded] .tempo-header-extras {
@@ -274,7 +311,7 @@
grid-area: 1 / 3; grid-area: 1 / 3;
padding: 0 0.5rem 0 0; padding: 0 0.5rem 0 0;
border: 0; border: 0;
border-right: 1px solid #ffffff1a; border-right: 1px solid rgba(255, 255, 255, 0.1);
} }
.tempo-header-utilities { .tempo-header-utilities {
flex-wrap: nowrap; flex-wrap: nowrap;
@@ -291,21 +328,21 @@
} }
@media (min-width: 1440px) { @media (min-width: 1440px) {
.tempo-header-inner { .tempo-header-inner {
column-gap: 0.75rem; column-gap: 0.625rem;
padding-inline: 2rem; padding-inline: 1.75rem;
} }
.tempo-nav-trigger { .tempo-nav-trigger {
padding-inline: 0.375rem; padding-inline: 0.625rem;
font-size: 1.125rem; font-size: 1rem;
} }
.tempo-logo-link { .tempo-logo-link {
width: 132px; width: 112px;
} }
.tempo-login-button > span { .tempo-login-button > span {
max-width: 5rem; max-width: 5rem;
} }
.tempo-header-extras { .tempo-header-extras {
padding-right: 0.75rem; padding-right: 0.625rem;
} }
.tempo-primary-navigation > ul { .tempo-primary-navigation > ul {
gap: 0.125rem; gap: 0.125rem;
@@ -313,7 +350,7 @@
} }
@media (min-width: 1536px) { @media (min-width: 1536px) {
.tempo-header-inner { .tempo-header-inner {
column-gap: 1rem; column-gap: 0.875rem;
} }
.tempo-nav-trigger { .tempo-nav-trigger {
padding-inline: 0.75rem; padding-inline: 0.75rem;
@@ -88,11 +88,18 @@ export function PortalGroupedMenu() {
const currentItem = currentNavigationItem(groups, url); const currentItem = currentNavigationItem(groups, url);
const [loggingOut, setLoggingOut] = useState(false); const [loggingOut, setLoggingOut] = useState(false);
const [expanded, setExpanded] = useState(false); const [expanded, setExpanded] = useState(false);
const [scrolled, setScrolled] = useState(false);
const navigationId = useId(); const navigationId = useId();
const toolsId = useId(); const toolsId = useId();
const interestId = useId(); const interestId = useId();
const toggle = useRef<HTMLButtonElement>(null); const toggle = useRef<HTMLButtonElement>(null);
useEffect(() => router.on('navigate', () => setExpanded(false)), []); useEffect(() => router.on('navigate', () => setExpanded(false)), []);
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 8);
onScroll();
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
const items = (children: PortalNavItem[]) => const items = (children: PortalNavItem[]) =>
children.map((item) => children.map((item) =>
item.children ? ( item.children ? (
@@ -156,6 +163,7 @@ export function PortalGroupedMenu() {
className="tempo-header" className="tempo-header"
lang={language} lang={language}
data-expanded={expanded || undefined} data-expanded={expanded || undefined}
data-scrolled={scrolled || undefined}
onKeyDown={(event) => { onKeyDown={(event) => {
if ( if (
event.key === 'Escape' && event.key === 'Escape' &&