Refine navigation interactions and cards
Deploy / validate-dispatch (push) Successful in 1s
Deploy / scheduled-rebuild-dev (push) Skipped
Deploy / scheduled-rebuild-master (push) Skipped
Deploy / rollback-dev (push) Skipped
Deploy / rollback-master (push) Skipped
Deploy / changes (push) Successful in 3s
Deploy / app-quality (push) Successful in 1m11s
Deploy / secret-scan (push) Successful in 4s
Deploy / security-deps (push) Successful in 5s
Deploy / context (push) Successful in 1s
Deploy / app-image (push) Successful in 56s
Deploy / deploy-master (push) Skipped
Deploy / deploy-dev (push) Successful in 11s

This commit is contained in:
Per Hoener
2026-09-20 19:01:24 +02:00
parent 9714c175e5
commit e72ee1fdab
2 changed files with 22 additions and 9 deletions
+15 -3
View File
@@ -61,13 +61,25 @@ export default function Header({ siteName }: { siteName: string }) {
const expanded = openGroup === group.href;
const active = isNavigationItemActive(pathname, group.href) || group.children.some((item) => isNavigationItemActive(pathname, item.href));
const submenuId = `navigation-${group.href.slice(1)}`;
return <li className="navigation-group" data-active={active} data-expanded={expanded} key={group.href}>
return <li
className="navigation-group"
data-active={active}
data-expanded={expanded}
key={group.href}
onPointerEnter={(event) => {
if (event.pointerType === "mouse") setOpenGroup(group.href);
}}
onPointerLeave={(event) => {
if (event.pointerType === "mouse") {
setOpenGroup((currentGroup) => currentGroup === group.href ? null : currentGroup);
}
}}
>
<div className="navigation-group__heading">
<Link href={group.href} aria-current={pathname === group.href ? "page" : undefined} onClick={closeNavigation}>{group.label}</Link>
<button ref={(element) => { if (element) groupButtonRefs.current.set(group.href, element); else groupButtonRefs.current.delete(group.href); }} type="button" aria-expanded={expanded} aria-controls={submenuId} aria-label={`Unterseiten von ${group.label} ${expanded ? "schließen" : "öffnen"}`} onClick={() => setOpenGroup((current) => current === group.href ? null : group.href)}><span aria-hidden="true">⌄</span></button>
<button ref={(element) => { if (element) groupButtonRefs.current.set(group.href, element); else groupButtonRefs.current.delete(group.href); }} type="button" aria-expanded={expanded} aria-controls={submenuId} aria-label={`Unterseiten von ${group.label} ${expanded ? "schließen" : "öffnen"}`} onClick={() => setOpenGroup((current) => current === group.href ? null : group.href)}><span aria-hidden="true" className="navigation-chevron" /></button>
</div>
<ul className="navigation-submenu" id={submenuId}>
<li><Link href={group.href} aria-current={pathname === group.href ? "page" : undefined} onClick={closeNavigation}>Übersicht</Link></li>
{group.children.map((item) => <li key={item.href}><Link href={item.href} aria-current={pathname === item.href ? "page" : undefined} onClick={closeNavigation}>{item.label}</Link></li>)}
</ul>
</li>;
+7 -6
View File
@@ -19,10 +19,11 @@ a:focus-visible,button:focus-visible,summary:focus-visible { outline:3px solid w
.primary-navigation a:hover,.primary-navigation a[aria-current="page"],.navigation-group[data-active="true"]>.navigation-group__heading>a { color:var(--blue-700); }
.navigation-group { position:relative; }
.navigation-group__heading { display:flex; align-items:center; gap:.1rem; }
.navigation-group__heading button { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; padding:0; border:0; color:var(--blue-950); background:transparent; cursor:pointer; }
.navigation-group__heading button span { display:block; font-size:1.1rem; line-height:1; transition:transform .2s ease; }
.navigation-group[data-expanded="true"] .navigation-group__heading button span { transform:rotate(180deg); }
.navigation-submenu { display:none; position:absolute; top:calc(100% + .7rem); left:0; z-index:30; min-width:285px; padding:.55rem; border:1px solid var(--line); background:var(--paper); box-shadow:var(--shadow); }
.navigation-group__heading>a { display:inline-flex; align-items:center; min-height:44px; }
.navigation-group__heading button { display:inline-flex; align-items:center; justify-content:center; width:30px; height:44px; padding:0; border:0; color:var(--blue-950); background:transparent; cursor:pointer; }
.navigation-chevron { width:.5rem; height:.5rem; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transform-origin:center; transition:transform .2s ease; }
.navigation-group[data-expanded="true"] .navigation-chevron { transform:rotate(225deg); }
.navigation-submenu { display:none; position:absolute; top:100%; left:0; z-index:30; min-width:285px; padding:.55rem; border:1px solid var(--line); background:var(--paper); box-shadow:var(--shadow); }
.navigation-group:last-child .navigation-submenu { right:0; left:auto; }
.navigation-group[data-expanded="true"]>.navigation-submenu { display:grid; }
.navigation-submenu a { display:block; padding:.62rem .75rem; line-height:1.35; }
@@ -53,7 +54,7 @@ a:focus-visible,button:focus-visible,summary:focus-visible { outline:3px solid w
.section-heading{display:flex;align-items:end;justify-content:space-between;gap:2rem;margin-bottom:2rem}.section-heading h2{margin-bottom:0}.calendar-explainer{max-width:620px;margin:.6rem 0 0;color:var(--muted);font-size:.92rem}
.content-section{max-width:850px;padding-block:2.6rem;border-bottom:1px solid var(--line)}.content-section:first-of-type{padding-top:0}.content-section h2{font-size:clamp(1.7rem,3vw,2.4rem)}.content-section p,.content-section li,.prose p{font-size:1.03rem;color:#3f535b}.content-section li+li{margin-top:.45rem}
.link-list{display:flex;flex-wrap:wrap;gap:.7rem;margin-top:1.5rem}.link-list a{display:inline-flex;align-items:center;min-height:46px;padding:.65rem .9rem;border:1px solid var(--blue-800);color:var(--blue-800);font-weight:700;text-underline-offset:4px;transition:background-color .2s ease,color .2s ease,transform .2s ease}.link-list a:hover{color:white;background:var(--blue-800);transform:translateY(-2px)}
.navigation-hub{padding-top:clamp(3rem,6vw,5rem)}.navigation-hub__heading{max-width:720px;margin-bottom:1.7rem}.navigation-hub__heading h2{margin-bottom:.55rem}.navigation-hub__heading p{color:var(--muted)}.navigation-hub__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.navigation-hub__grid>a{display:flex;flex-direction:column;min-height:210px;padding:1.6rem;border:1px solid var(--line);background:white;text-decoration:none;transition:transform .2s ease,box-shadow .2s ease,background-color .2s ease}.navigation-hub__grid>a:hover{transform:translateY(-3px);background:#f1f4f0;box-shadow:var(--shadow)}.navigation-hub__grid h3{margin-bottom:.7rem;color:var(--blue-950)}.navigation-hub__grid p{margin-bottom:1.4rem;color:var(--muted)}.navigation-hub__grid>a>span{margin-top:auto;color:var(--blue-800);font-weight:700}
.navigation-hub{padding-top:clamp(3rem,6vw,5rem)}.navigation-hub__heading{max-width:720px;margin-bottom:1.7rem}.navigation-hub__heading h2{margin-bottom:.55rem}.navigation-hub__heading p{color:var(--muted)}.navigation-hub__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.navigation-hub__grid>a{display:flex;flex-direction:column;min-height:104px;padding:1rem;border:1px solid var(--line);background:white;text-decoration:none;transition:transform .2s ease,box-shadow .2s ease,background-color .2s ease}.navigation-hub__grid>a:hover{transform:translateY(-3px);background:#f1f4f0;box-shadow:var(--shadow)}.navigation-hub__grid h3{margin-bottom:.4rem;color:var(--blue-950)}.navigation-hub__grid p{margin-bottom:.8rem;color:var(--muted)}.navigation-hub__grid>a>span{margin-top:auto;color:var(--blue-800);font-weight:700}
.event-list{display:grid;gap:.75rem}.event-card{display:grid;grid-template-columns:80px 1fr;gap:1.4rem;padding:1.4rem;background:white;border:1px solid var(--line)}.event-date{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:80px;color:white;background:var(--blue-950);text-transform:uppercase}.event-date span{font-size:.75rem;letter-spacing:.08em}.event-date strong{font-size:1.8rem}.event-card h3{margin:.15rem 0 .4rem;font-size:1.3rem}.event-card h3 a{text-decoration:none}.event-card p{margin-bottom:.4rem;color:var(--muted)}.event-meta{font-size:.78rem;font-weight:700;color:var(--blue-700)!important}.archive-section{margin-top:5rem}
.news-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.news-card{padding:clamp(1.5rem,3vw,2.2rem);background:white;border:1px solid var(--line)}.news-card h2,.news-card h3{font-size:clamp(1.3rem,2.2vw,1.8rem)}.news-card h2 a,.news-card h3 a{text-decoration:none}.news-card p{color:var(--muted)}.news-date,.card-label{font-size:.72rem!important;text-transform:uppercase;letter-spacing:.12em;font-weight:700;color:var(--blue-700)!important}
.detail-list{display:grid;gap:0;margin:0}.detail-list div{display:grid;grid-template-columns:minmax(130px,.35fr) 1fr;gap:1rem;padding:1.2rem 0;border-bottom:1px solid var(--line)}.detail-list dt{font-size:.76rem;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);font-weight:700}.detail-list dd{margin:0;font-weight:600}
@@ -77,7 +78,7 @@ a:focus-visible,button:focus-visible,summary:focus-visible { outline:3px solid w
.editorial-warning{padding:1.4rem;margin-bottom:2.5rem;border:2px solid #a86a00;background:#fff7df}.editorial-warning p{margin:.4rem 0 0}
.prose h2{font-size:1.6rem}.prose p{max-width:720px}
@media(max-width:900px){.news-grid,.quick-grid--four,.data-grid,.people-grid,.fee-grid{grid-template-columns:repeat(2,1fr)}.discover-section{grid-template-columns:1fr}.discover-photo{min-height:420px}.feature-grid,.project-links{grid-template-columns:1fr}.feature-grid>a{min-height:auto}.feature-grid span{margin-bottom:1.5rem}}
@media(max-width:620px){h1{font-size:clamp(1.9rem,10vw,3.1rem);line-height:1.06}h2{font-size:clamp(1.55rem,7.8vw,2.1rem);line-height:1.1}.page-hero h1{font-size:clamp(1.85rem,8vw,2.75rem)}.news-grid,.quick-grid--four,.data-grid,.people-grid,.card-grid,.fee-grid,.playground-gallery__finished,.playground-gallery__archive-grid,.navigation-hub__grid{grid-template-columns:1fr}.page-hero{min-height:380px}.section-heading,.contact-band{align-items:flex-start;flex-direction:column}.event-card{grid-template-columns:64px 1fr;padding:1rem;gap:1rem}.detail-list div,.contact-panel{grid-template-columns:1fr;gap:.25rem}.contact-panel{gap:1.25rem}.portrait-image--mayor{max-width:220px}.history-timeline::before{left:7px}.history-timeline li{grid-template-columns:1fr;gap:.7rem;min-height:42vh;padding:2rem 0 2rem 2rem;transform:scale(.92);transform-origin:left center}.history-timeline li::before{left:0;top:2.8rem;transform:none}.history-timeline time{font-size:1.45rem}.discover-photo{min-height:300px}.document-embed{height:60vh}.playground-gallery__lead img{aspect-ratio:16 / 10}.navigation-hub__grid>a{min-height:180px}}
@media(max-width:620px){h1{font-size:clamp(1.9rem,10vw,3.1rem);line-height:1.06}h2{font-size:clamp(1.55rem,7.8vw,2.1rem);line-height:1.1}.page-hero h1{font-size:clamp(1.85rem,8vw,2.75rem)}.news-grid,.quick-grid--four,.data-grid,.people-grid,.card-grid,.fee-grid,.playground-gallery__finished,.playground-gallery__archive-grid,.navigation-hub__grid{grid-template-columns:1fr}.page-hero{min-height:380px}.section-heading,.contact-band{align-items:flex-start;flex-direction:column}.event-card{grid-template-columns:64px 1fr;padding:1rem;gap:1rem}.detail-list div,.contact-panel{grid-template-columns:1fr;gap:.25rem}.contact-panel{gap:1.25rem}.portrait-image--mayor{max-width:220px}.history-timeline::before{left:7px}.history-timeline li{grid-template-columns:1fr;gap:.7rem;min-height:42vh;padding:2rem 0 2rem 2rem;transform:scale(.92);transform-origin:left center}.history-timeline li::before{left:0;top:2.8rem;transform:none}.history-timeline time{font-size:1.45rem}.discover-photo{min-height:300px}.document-embed{height:60vh}.playground-gallery__lead img{aspect-ratio:16 / 10}.navigation-hub__grid>a{min-height:104px}}
@media(prefers-reduced-motion:reduce){.history-timeline li{transform:none}}
@media(max-width:700px){.footer-grid nav{width:100%;max-width:none;align-items:stretch;flex-direction:column;gap:.65rem}.footer-grid nav a{display:flex;align-items:center;min-height:44px;padding-block:.35rem}}
@media(max-width:700px){.discover-section{scroll-margin-top:74px}}