28 lines
976 B
PHP
28 lines
976 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Mannschaftsfoto in voller Breite (Querformat-Gruppenbild). Props:
|
||
|
|
* $photo array{ image: {base,widths,alt} | {src,width,height,alt}, caption? }
|
||
|
|
* $anchor string (optional, Default 'mannschaftsfoto')
|
||
|
|
* Zeigt das Bild im natürlichen Seitenverhältnis, abgerundet; optionale Bildunterschrift.
|
||
|
|
*/
|
||
|
|
$anchor = $anchor ?? 'mannschaftsfoto';
|
||
|
|
$image = $photo['image'] ?? null;
|
||
|
|
if (empty($image)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
$caption = $photo['caption'] ?? '';
|
||
|
|
?>
|
||
|
|
<section class="section team-photo" id="<?= e($anchor) ?>">
|
||
|
|
<div class="container">
|
||
|
|
<figure class="team-photo__figure">
|
||
|
|
<?php component('img', ['image' => $image, 'sizes' => '(max-width: 1100px) 100vw, 1040px', 'class' => 'team-photo__img']); ?>
|
||
|
|
<?php if ($caption !== ''): ?>
|
||
|
|
<figcaption class="team-photo__caption"><?= e($caption) ?></figcaption>
|
||
|
|
<?php endif; ?>
|
||
|
|
</figure>
|
||
|
|
</div>
|
||
|
|
</section>
|