Neubau Fundament + Startseite: Designsystem, PHP-Komponenten, Brevo-Formular, Instagram-Sync
- Ordnerstruktur mit public/-Docroot, Deny-.htaccess für app/bin/config/data/storage
- CLAUDE.md mit Leitplanken (self-hosted only, Single Source of Truth, Component-first)
- Design-Tokens aus alter Seite extrahiert (Akzent #e20612, Coolvetica/Abel als woff2)
- Front Controller mit Routen-Register, Sitemap, Canonical, JSON-LD (SportsClub)
- Startseite: Hero, Instagram-Feed (lokaler Cache), Historie/Sportheim, Stats, Partner, Kontakt
- Kontaktformular via PHPMailer/Brevo mit Honeypot + HMAC-Time-Trap (kein reCAPTCHA)
- bin/instagram-sync.php: Scraper mit Strategie-Kette, flock, atomarem Cache, lokalen Bildern
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:16:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
/**
|
2026-06-11 22:53:34 +02:00
|
|
|
* Responsives Bild aus Varianten-Set ODER Einzeldatei. Props:
|
|
|
|
|
* $image array{base: string, widths: int[], alt: string} — Varianten <base>-<w>.jpg
|
|
|
|
|
* ODER array{src: string, width: int, height: int, alt: string} — Originaldatei 1:1
|
Neubau Fundament + Startseite: Designsystem, PHP-Komponenten, Brevo-Formular, Instagram-Sync
- Ordnerstruktur mit public/-Docroot, Deny-.htaccess für app/bin/config/data/storage
- CLAUDE.md mit Leitplanken (self-hosted only, Single Source of Truth, Component-first)
- Design-Tokens aus alter Seite extrahiert (Akzent #e20612, Coolvetica/Abel als woff2)
- Front Controller mit Routen-Register, Sitemap, Canonical, JSON-LD (SportsClub)
- Startseite: Hero, Instagram-Feed (lokaler Cache), Historie/Sportheim, Stats, Partner, Kontakt
- Kontaktformular via PHPMailer/Brevo mit Honeypot + HMAC-Time-Trap (kein reCAPTCHA)
- bin/instagram-sync.php: Scraper mit Strategie-Kette, flock, atomarem Cache, lokalen Bildern
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:16:25 +02:00
|
|
|
* $sizes string (optional, default '100vw')
|
|
|
|
|
* $eager bool (optional) — above the fold: eager + fetchpriority high
|
|
|
|
|
* $class string (optional)
|
|
|
|
|
*/
|
|
|
|
|
$sizes = $sizes ?? '100vw';
|
|
|
|
|
$eager = $eager ?? false;
|
|
|
|
|
$class = $class ?? '';
|
|
|
|
|
|
2026-06-11 22:53:34 +02:00
|
|
|
if (!empty($image['src'])): ?>
|
|
|
|
|
<img<?= $class !== '' ? ' class="' . e($class) . '"' : '' ?>
|
|
|
|
|
src="<?= e(asset($image['src'])) ?>"
|
|
|
|
|
alt="<?= e($image['alt']) ?>"
|
|
|
|
|
width="<?= e($image['width']) ?>" height="<?= e($image['height']) ?>"
|
|
|
|
|
<?= $eager ? 'loading="eager" fetchpriority="high"' : 'loading="lazy" decoding="async"' ?>>
|
|
|
|
|
<?php return; endif;
|
|
|
|
|
|
Neubau Fundament + Startseite: Designsystem, PHP-Komponenten, Brevo-Formular, Instagram-Sync
- Ordnerstruktur mit public/-Docroot, Deny-.htaccess für app/bin/config/data/storage
- CLAUDE.md mit Leitplanken (self-hosted only, Single Source of Truth, Component-first)
- Design-Tokens aus alter Seite extrahiert (Akzent #e20612, Coolvetica/Abel als woff2)
- Front Controller mit Routen-Register, Sitemap, Canonical, JSON-LD (SportsClub)
- Startseite: Hero, Instagram-Feed (lokaler Cache), Historie/Sportheim, Stats, Partner, Kontakt
- Kontaktformular via PHPMailer/Brevo mit Honeypot + HMAC-Time-Trap (kein reCAPTCHA)
- bin/instagram-sync.php: Scraper mit Strategie-Kette, flock, atomarem Cache, lokalen Bildern
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:16:25 +02:00
|
|
|
$widths = $image['widths'];
|
|
|
|
|
$largest = max($widths);
|
|
|
|
|
$srcset = implode(', ', array_map(
|
|
|
|
|
static fn (int $w): string => asset("{$image['base']}-{$w}.jpg") . " {$w}w",
|
|
|
|
|
$widths
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
// Maße der größten Variante für width/height (CLS-Vermeidung).
|
|
|
|
|
[$w, $h] = (function () use ($image, $largest): array {
|
|
|
|
|
static $dims = [];
|
|
|
|
|
$file = PUBLIC_PATH . "/assets/{$image['base']}-{$largest}.jpg";
|
|
|
|
|
$key = $file;
|
|
|
|
|
if (!isset($dims[$key])) {
|
|
|
|
|
$size = is_file($file) ? (getimagesize($file) ?: [0, 0]) : [0, 0];
|
|
|
|
|
$dims[$key] = [$size[0], $size[1]];
|
|
|
|
|
}
|
|
|
|
|
return $dims[$key];
|
|
|
|
|
})();
|
|
|
|
|
?>
|
|
|
|
|
<img<?= $class !== '' ? ' class="' . e($class) . '"' : '' ?>
|
|
|
|
|
src="<?= e(asset("{$image['base']}-{$largest}.jpg")) ?>"
|
|
|
|
|
srcset="<?= e($srcset) ?>"
|
|
|
|
|
sizes="<?= e($sizes) ?>"
|
|
|
|
|
alt="<?= e($image['alt']) ?>"
|
|
|
|
|
width="<?= e($w) ?>" height="<?= e($h) ?>"
|
|
|
|
|
<?= $eager ? 'loading="eager" fetchpriority="high"' : 'loading="lazy" decoding="async"' ?>>
|