Querschnitt-Verbesserungen ohne eigenes Feature: - Navigation: Untermenü-Trenner (separator) + Mitmachen-Link, rote Akzent-Leiste - Startseiten-Hero zentriert (align center, ohne Hero-CTAs); .hero--center-Styles - person-card/person-grid: Kontakt-Layout, 3-Spalten-Raster (Startseite) - jsonld: geo aus club.json; cta unterstützt #hash-Anker - verein: hartcodierten Maps-Link/Inline-CTA entfernt, .facility zentriert - tokens: Sepia-Farben für Timeline; base: globale p-max-width entfernt - historie: Timeline um 2024/2025 ergänzt - Icons link-45deg (Footer) und robot (meta) nachgereicht Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGzc6GhWhmLJt1jC2q1SRZ
59 lines
2.5 KiB
PHP
59 lines
2.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Visitenkarte für eine Person. Props:
|
|
* $person array{department, name, phone?, email?, image?, whatsapp?}
|
|
* $level string — Überschriften-Ebene des department-Headings (Default 'h3').
|
|
* Eingebettet (z. B. in position-card unter einem h3) auf 'h4' setzen,
|
|
* damit die Heading-Outline nicht abflacht. Styling bleibt klassenbasiert.
|
|
* Ohne image greift der Platzhalter-Avatar (img/persons/platzhalter.jpg).
|
|
* Kontakt-Link: phone → tel:, sonst email → mailto:.
|
|
* Optional zusätzlich WhatsApp (wa.me) bei phone + whatsapp=true (opt-in pro Person).
|
|
*/
|
|
$level = $level ?? 'h3';
|
|
if (!in_array($level, ['h2', 'h3', 'h4', 'h5'], true)) {
|
|
$level = 'h3';
|
|
}
|
|
$image = $person['image'] ?? null;
|
|
$src = $image ?: 'img/persons/platzhalter.jpg';
|
|
|
|
if (!empty($person['phone'])) {
|
|
$contactHref = 'tel:' . preg_replace('/[^+\d]/', '', $person['phone']);
|
|
$contactLabel = $person['phone'];
|
|
$contactIcon = 'telephone';
|
|
} elseif (!empty($person['email'])) {
|
|
$contactHref = 'mailto:' . $person['email'];
|
|
$contactLabel = $person['email'];
|
|
$contactIcon = 'envelope';
|
|
} else {
|
|
$contactHref = null;
|
|
}
|
|
|
|
$waHref = (!empty($person['whatsapp']) && !empty($person['phone']))
|
|
? 'https://wa.me/' . preg_replace('/\D/', '', $person['phone'])
|
|
: null;
|
|
?>
|
|
<article class="person-card">
|
|
<div class="person-card__media">
|
|
<img src="<?= e(asset($src)) ?>"
|
|
alt="<?= $image ? e($person['name']) : '' ?>"
|
|
width="480" height="600" loading="lazy" decoding="async">
|
|
</div>
|
|
<div class="person-card__body">
|
|
<<?= $level ?> class="person-card__department"><?= e($person['department']) ?></<?= $level ?>>
|
|
<p class="person-card__name"><?= e($person['name']) ?></p>
|
|
<?php if ($contactHref !== null): ?>
|
|
<a class="person-card__contact" href="<?= e($contactHref) ?>">
|
|
<?= icon($contactIcon) ?><span><?= e($contactLabel) ?></span>
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php if ($waHref !== null): ?>
|
|
<a class="person-card__contact" href="<?= e($waHref) ?>" target="_blank" rel="noopener">
|
|
<?= icon('whatsapp') ?><span>WhatsApp</span>
|
|
</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</article>
|