feat: responsive images for investigation cover cards
- Add `cover-card` and `cover-card-webp` srcsets in config Widths [465, 728, 930, 1000, 1456] couvrent 1x et 2x (retina) pour les 3 breakpoints : ≥1000px fixe 465px, 728–1000px 50vw, <728px 100vw - Refactor snippet picture.php : accepte $sizes (string complète), $srcsetName (srcset nommé), $alt (override), fallback webp automatique - Update investigations.php : remplace <img> nu par snippet picture avec sizes et srcsetName adaptés Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8d808a87fe
commit
ca17be69be
3 changed files with 56 additions and 26 deletions
|
|
@ -17,10 +17,20 @@ return [
|
|||
'srcsets' => [
|
||||
'default' => [200, 400, 600, 800, 1024, 1440, 2048],
|
||||
'webp' => [
|
||||
'300w' => ['width' => 300 * 1.2, 'format' => 'webp'],
|
||||
'600w' => ['width' => 600 * 1.2, 'format' => 'webp'],
|
||||
'900w' => ['width' => 900 * 1.2, 'format' => 'webp'],
|
||||
'1200w' => ['width' => 1200 * 1.2, 'format' => 'webp'],
|
||||
'300w' => ['width' => 300, 'format' => 'webp'],
|
||||
'600w' => ['width' => 600, 'format' => 'webp'],
|
||||
'900w' => ['width' => 900, 'format' => 'webp'],
|
||||
'1200w' => ['width' => 1200, 'format' => 'webp'],
|
||||
],
|
||||
// Cover cards investigations : 465px fixe ≥1000px, 50vw 728–1000px, 100vw <728px
|
||||
// Widths couvrent 1x et 2x (retina) pour chaque breakpoint
|
||||
'cover-card' => [465, 728, 930, 1000, 1456],
|
||||
'cover-card-webp' => [
|
||||
'465w' => ['width' => 465, 'format' => 'webp'],
|
||||
'728w' => ['width' => 728, 'format' => 'webp'],
|
||||
'930w' => ['width' => 930, 'format' => 'webp'],
|
||||
'1000w' => ['width' => 1000, 'format' => 'webp'],
|
||||
'1456w' => ['width' => 1456, 'format' => 'webp'],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue