diff --git a/app/components/person-grid.php b/app/components/person-grid.php index b053fe7..e77743f 100644 --- a/app/components/person-grid.php +++ b/app/components/person-grid.php @@ -3,20 +3,40 @@ declare(strict_types=1); /** - * Ansprechpartner-Grid aus data/ansprechpartner.json. - * Optionaler Prop: $anchor (Sektions-ID, Default 'ansprechpartner'). + * Ansprechpartner-Grid aus data/ansprechpartner.json (Single Source of Truth). + * Alle Props optional: + * $departments array — nur diese Abteilungen zeigen (z. B. ['Herrenfußball','Damenfußball']). + * $title string — Überschrift überschreiben (Default aus JSON). + * $intro string — Intro-Text überschreiben (Default aus JSON; '' = ausblenden). + * $anchor string — Sektions-ID (Default 'ansprechpartner'). + * $tinted bool — aufgehelltes Vollbreite-Band (Default true). */ $data = json_load('ansprechpartner'); $anchor = $anchor ?? 'ansprechpartner'; +$tinted = $tinted ?? true; +$title = $title ?? $data['title']; +$intro = $intro ?? ($data['intro'] ?? ''); + +$persons = $data['persons'] ?? []; +if (!empty($departments)) { + $persons = array_values(array_filter( + $persons, + static fn (array $p): bool => in_array($p['department'] ?? '', $departments, true) + )); +} + +if ($persons === []) { + return; +} ?> -
+
-

- -

+

+ +

    - +
  • $person]); ?>
  • diff --git a/app/components/section.php b/app/components/section.php index f32ea37..a551f99 100644 --- a/app/components/section.php +++ b/app/components/section.php @@ -12,7 +12,7 @@ $level = $level ?? 2; $flip = !empty($section['flip']); $tinted = !empty($section['tinted']); ?> -
    +
    >> diff --git a/public/assets/css/components.css b/public/assets/css/components.css index b76ac4e..3969426 100644 --- a/public/assets/css/components.css +++ b/public/assets/css/components.css @@ -14,8 +14,8 @@ /* Kompakte Variante: schlanker Unterseiten-Header statt vollflächig. */ .hero--compact { - min-height: min(48vh, 440px); - padding-block: calc(var(--header-h) + 56px) 3rem; + min-height: min(60vh, 560px); + padding-block: calc(var(--header-h) + 64px) 3.5rem; } .hero__media { @@ -171,18 +171,19 @@ gap: 3rem; } -/* Variante: sanft aufgehelltes, durchgehendes Band über die volle Breite (tinted: true im JSON). +/* Sanft aufgehelltes, durchgehendes Band über die volle Breite — generisch für + jede Sektion (Split via tinted: true im JSON, person-grid u.a. per Klasse). Direkt aufeinanderfolgende tinted-Sektionen verschmelzen nahtlos. */ -.split--tinted { +.section--tinted { background: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0.035)); border-block: 1px solid rgb(255 255 255 / 0.1); } -.split--tinted + .split--tinted { +.section--tinted + .section--tinted { border-top: 0; } -.split--tinted:has(+ .split--tinted) { +.section--tinted:has(+ .section--tinted) { border-bottom: 0; }