From 55af32d270400442458131535c159eb344746dbf Mon Sep 17 00:00:00 2001 From: Paulo Massingue Date: Mon, 23 Nov 2026 11:07:22 +0200 Subject: [PATCH] navbar transparente --- resources/css/tempo-header.css | 147 +++++++++++------- .../js/components/portal-grouped-menu.tsx | 8 + 2 files changed, 100 insertions(+), 55 deletions(-) diff --git a/resources/css/tempo-header.css b/resources/css/tempo-header.css index ddb0fb79..3436b8cb 100644 --- a/resources/css/tempo-header.css +++ b/resources/css/tempo-header.css @@ -3,27 +3,46 @@ position: sticky; top: 0; z-index: 40; - background: #090909; + background: rgba(9, 9, 9, 0.52); 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 { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; - grid-template-rows: 71px; + grid-template-rows: 56px; align-items: center; column-gap: 0.5rem; max-width: 1600px; margin-inline: auto; padding-inline: 0.75rem; + transition: grid-template-rows 0.28s ease; } .tempo-logo-link { grid-area: 1 / 1; display: inline-flex; align-items: center; - width: 112px; + width: 104px; max-width: 100%; border-radius: 0.25rem; + transition: opacity 0.2s ease; +} +.tempo-logo-link:hover { + opacity: 0.92; } .tempo-header-logo { width: 100%; @@ -45,28 +64,29 @@ display: flex; align-items: center; justify-content: space-between; - gap: 0.4rem; + gap: 0.35rem; width: 100%; - min-height: 44px; - padding: 0.5rem 0.75rem; + min-height: 40px; + padding: 0.375rem 0.625rem; border-radius: 0.5rem; color: #e2e8f0; - font-size: 1rem; - line-height: 1.5; + font-size: 0.9375rem; + line-height: 1.4; font-weight: 600; white-space: nowrap; transition: - color 0.2s, - background 0.2s; + color 0.2s ease, + background-color 0.2s ease, + box-shadow 0.2s ease; } .tempo-nav-trigger:hover, .tempo-nav-trigger[data-state='open'] { - background: #ffffff0d; + background: rgba(255, 255, 255, 0.08); color: #fff; } .tempo-nav-trigger[data-current-group] { color: #fff; - background: #ffffff08; + background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 -2px #ed1c24; } .tempo-nav-trigger > svg { @@ -93,14 +113,18 @@ display: flex; align-items: center; gap: 0.4rem; - min-height: 44px; - padding: 0.4rem; + min-height: 40px; + padding: 0.35rem 0.4rem; border-radius: 0.5rem; color: #e2e8f0; font-size: 0.8125rem; + transition: + background-color 0.2s ease, + color 0.2s ease; } .tempo-utility-button:hover { - background: #ffffff10; + background: rgba(255, 255, 255, 0.08); + color: #fff; } .tempo-header-actions { grid-area: 1 / 2; @@ -112,22 +136,23 @@ .tempo-login-button { display: inline-flex; align-items: center; - gap: 0.5rem; - min-height: 44px; - padding: 0.5rem 0.625rem; - border: 1px solid #ffffff40; + gap: 0.45rem; + min-height: 40px; + padding: 0.4rem 0.625rem; + border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 0.5rem; color: #fff; - font-size: 0.875rem; + font-size: 0.8125rem; font-weight: 600; white-space: nowrap; transition: - background 0.2s, - border-color 0.2s; + background-color 0.2s ease, + border-color 0.2s ease, + color 0.2s ease; } .tempo-login-button:hover { - background: #ffffff10; - border-color: #ffffff80; + background: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.4); } .tempo-login-button > span { max-width: clamp(2rem, calc(100vw - 18rem), 6rem); @@ -137,14 +162,17 @@ display: inline-flex; align-items: center; justify-content: center; - width: 44px; - height: 44px; + width: 40px; + height: 40px; flex-shrink: 0; border-radius: 0.5rem; color: #e2e8f0; + transition: + background-color 0.2s ease, + color 0.2s ease; } .tempo-panel-summary:hover { - background: #ffffff10; + background: rgba(255, 255, 255, 0.08); color: #fff; } .tempo-panel-count { @@ -166,10 +194,10 @@ grid-area: 4 / 1 / auto / -1; align-items: center; justify-content: center; - gap: 0.5rem; - min-height: 44px; - margin-bottom: 1rem; - padding: 0.5rem 0.875rem; + gap: 0.45rem; + min-height: 40px; + margin-bottom: 0.875rem; + padding: 0.45rem 0.8rem; border: 1px solid #ed1c24; border-radius: 0.5rem; background: #ed1c24; @@ -177,26 +205,34 @@ font-size: 0.8125rem; font-weight: 600; 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 { background: #c9151c; + border-color: #c9151c; } .tempo-header-toggle { grid-area: 1 / 3; display: inline-flex; align-items: center; justify-content: center; - width: 44px; - height: 44px; - border: 1px solid #ffffff33; + width: 40px; + height: 40px; + border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0.5rem; color: #fff; cursor: pointer; + transition: + background-color 0.2s ease, + border-color 0.2s ease; } .tempo-header-toggle:hover, .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 { display: block; @@ -220,11 +256,11 @@ @media (min-width: 640px) { .tempo-header-inner { grid-template-columns: minmax(0, 1fr) auto auto auto; - column-gap: 0.75rem; - padding-inline: 1.5rem; + column-gap: 0.625rem; + padding-inline: 1.25rem; } .tempo-logo-link { - width: 132px; + width: 116px; } .tempo-interest-button { display: inline-flex; @@ -237,13 +273,13 @@ } @media (min-width: 1280px) { .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; - column-gap: 0.25rem; + column-gap: 0.375rem; padding-inline: 1.25rem; } .tempo-logo-link { - width: 100px; + width: 96px; } .tempo-login-button > span { max-width: 3rem; @@ -260,13 +296,14 @@ display: flex; flex-wrap: wrap; align-items: center; - gap: 0; + gap: 0.125rem; } .tempo-nav-trigger { justify-content: center; - padding-inline: 0.25rem; - font-size: 1.125rem; - letter-spacing: 0.025em; + min-height: 38px; + padding: 0.375rem 0.5rem; + font-size: 0.9375rem; + letter-spacing: 0.01em; } .tempo-header-extras, .tempo-header[data-expanded] .tempo-header-extras { @@ -274,7 +311,7 @@ grid-area: 1 / 3; padding: 0 0.5rem 0 0; border: 0; - border-right: 1px solid #ffffff1a; + border-right: 1px solid rgba(255, 255, 255, 0.1); } .tempo-header-utilities { flex-wrap: nowrap; @@ -291,21 +328,21 @@ } @media (min-width: 1440px) { .tempo-header-inner { - column-gap: 0.75rem; - padding-inline: 2rem; + column-gap: 0.625rem; + padding-inline: 1.75rem; } .tempo-nav-trigger { - padding-inline: 0.375rem; - font-size: 1.125rem; + padding-inline: 0.625rem; + font-size: 1rem; } .tempo-logo-link { - width: 132px; + width: 112px; } .tempo-login-button > span { max-width: 5rem; } .tempo-header-extras { - padding-right: 0.75rem; + padding-right: 0.625rem; } .tempo-primary-navigation > ul { gap: 0.125rem; @@ -313,7 +350,7 @@ } @media (min-width: 1536px) { .tempo-header-inner { - column-gap: 1rem; + column-gap: 0.875rem; } .tempo-nav-trigger { padding-inline: 0.75rem; diff --git a/resources/js/components/portal-grouped-menu.tsx b/resources/js/components/portal-grouped-menu.tsx index 89115673..5d192a95 100644 --- a/resources/js/components/portal-grouped-menu.tsx +++ b/resources/js/components/portal-grouped-menu.tsx @@ -88,11 +88,18 @@ export function PortalGroupedMenu() { const currentItem = currentNavigationItem(groups, url); const [loggingOut, setLoggingOut] = useState(false); const [expanded, setExpanded] = useState(false); + const [scrolled, setScrolled] = useState(false); const navigationId = useId(); const toolsId = useId(); const interestId = useId(); const toggle = useRef(null); 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[]) => children.map((item) => item.children ? ( @@ -156,6 +163,7 @@ export function PortalGroupedMenu() { className="tempo-header" lang={language} data-expanded={expanded || undefined} + data-scrolled={scrolled || undefined} onKeyDown={(event) => { if ( event.key === 'Escape' &&