diff --git a/app/components/person-card.php b/app/components/person-card.php index b7e4014..052828c 100644 --- a/app/components/person-card.php +++ b/app/components/person-card.php @@ -5,11 +5,16 @@ declare(strict_types=1); /** * Visitenkarte für eine Person. Props: * $person array{department, name, phone?, email?, image?} - * Ohne image greift der Vereins-Platzhalter (Silhouette im TSV-Trikot). + * Ohne image rendert die Karte einen geschlechtsneutralen Initialen-Avatar + * (Coolvetica-Initialen + Logo-Wasserzeichen) — keinen Foto-Platzhalter. * Kontakt-Link: phone → tel:, sonst email → mailto:. */ $image = $person['image'] ?? null; -$src = $image ?: 'img/persons/platzhalter.jpg'; + +$initials = implode('', array_map( + static fn (string $word): string => mb_substr($word, 0, 1), + array_slice(preg_split('/\s+/', trim($person['name'])) ?: [], 0, 2) +)); if (!empty($person['phone'])) { $contactHref = 'tel:' . preg_replace('/[^+\d]/', '', $person['phone']); @@ -25,9 +30,15 @@ if (!empty($person['phone'])) { ?>
- <?= $image ? e($person['name']) : '' ?> + <?= e($person['name']) ?> + + +

diff --git a/public/assets/css/components.css b/public/assets/css/components.css index 63fd001..1335366 100644 --- a/public/assets/css/components.css +++ b/public/assets/css/components.css @@ -319,6 +319,34 @@ object-fit: cover; } +/* Initialen-Avatar: geschlechtsneutraler Fallback ohne Foto */ +.person-card__initials { + position: relative; + display: grid; + place-items: center; + aspect-ratio: 4 / 5; + background: radial-gradient(circle at 50% 35%, rgb(255 255 255 / 0.07), transparent 65%), var(--clr-bg-deep); + overflow: hidden; +} + +.person-card__initials span { + font-family: var(--ff-heading); + font-size: var(--fs-800); + letter-spacing: 0.06em; + color: var(--clr-text-muted); +} + +.person-card__initials::after { + /* dezente rote Akzentlinie unten, statt Logo-Wasserzeichen */ + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 3px; + background: linear-gradient(90deg, transparent, rgb(var(--clr-accent-rgb) / 0.6), transparent); +} + .person-card__body { display: grid; gap: 0.2rem; diff --git a/public/assets/img/persons/platzhalter.jpg b/public/assets/img/persons/platzhalter.jpg deleted file mode 100644 index bdf171f..0000000 Binary files a/public/assets/img/persons/platzhalter.jpg and /dev/null differ