Event banner also a popup/flyout

This commit is contained in:
fraxle
2026-06-11 18:37:34 +01:00
parent 9a9684ba99
commit d075b522d8
5 changed files with 43 additions and 96 deletions
+26 -29
View File
@@ -5,27 +5,26 @@
/* ── EVENT BANNER ───────────────────────────────────────────────────── */
/* Animated slide-down banner for cosmic/weather/promo events. */
/* Open/close: grow vertically using grid-template-rows (silky smooth,
no max-height hack — it animates from 0fr → 1fr and back). */
/* Flyout: a fixed panel pinned to the very top of the screen that slides
down over everything (including the nav) and retracts upward on close. */
.event-banner-wrap {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1);
position: absolute;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
}
.event-banner-wrap > * {
overflow: hidden;
z-index: 9999;
display: flex;
justify-content: center;
padding: 0 14px;
transform: translateY(-130%);
transition: transform 0.5s cubic-bezier(0.34, 1.25, 0.64, 1);
/* The wrap is full-width but the panel is centred — keep the wrap itself
click-through so its transparent sides never block the nav beneath it.
Only the visible banner panel (.event-banner) captures clicks. */
pointer-events: none;
}
.event-banner-wrap.visible {
grid-template-rows: 1fr;
}
/* When closing, fade the content out before the row collapses */
.event-banner-wrap:not(.visible) .event-banner-stage {
opacity: 0;
transform: translateY(0);
}
/* Slide crossfade: both banners rendered simultaneously, fading into each other */
@@ -38,13 +37,13 @@
to { opacity: 0; }
}
/* Container that holds both slides during a crossfade */
/* Also fades in/out with the wrap open/close */
/* Container that holds both slides during a crossfade. Constrains the
flyout to a centred panel width and clips the absolute outgoing slide. */
.event-banner-stage {
opacity: 1;
transition: opacity 0.35s ease;
position: relative;
margin-bottom: 12px;
overflow: hidden;
width: 100%;
max-width: 720px;
}
/* True crossfade — outgoing slide sits absolutely on top and fades out */
@@ -52,11 +51,14 @@
display: flex;
align-items: center;
gap: 14px;
padding: 13px 18px;
border-radius: 4px;
padding: 14px 18px;
border-radius: 0 0 12px 12px; /* rounded bottom — it hangs from the top edge */
position: relative;
z-index: 1;
border-left: 4px solid rgba(255,255,255,0.25);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
cursor: pointer; /* whole banner is click-to-close */
pointer-events: auto; /* re-enable clicks on the panel itself */
}
.event-banner--outgoing {
position: absolute;
@@ -67,10 +69,6 @@
pointer-events: none;
animation: banner-fade-out 0.45s ease both;
}
.event-banner-stage {
position: relative;
overflow: hidden;
}
.event-banner-emoji {
font-size: 24px;
flex-shrink: 0;
@@ -285,8 +283,7 @@
/* ── EVENT BANNER — mobile fixes ────────────────────────────────────── */
@media (max-width: 640px) {
.event-banner-wrap {
margin-top: 0; /* JS pins the banner's top to the nav's bottom edge */
margin-bottom: 0;
padding: 0; /* full-bleed flyout on small screens */
}
.event-banner {
@@ -294,7 +291,7 @@
gap: 10px;
padding: 18px 12px 14px 14px;
margin-bottom: 0;
border-radius: 4px;
border-radius: 0 0 12px 12px;
}
.event-banner-emoji {