feat: add hero image processing and API for serving variants
- Introduced a new script `prepare-hero-variants.mjs` to generate responsive hero image variants in WebP format. - Added a fallback image `hero_fallback.png` for each variant. - Created an API endpoint `hero-images.get.js` to retrieve available hero image variants and their fallback images. - Implemented directory and file checks to ensure the existence of required images before serving.
This commit is contained in:
20
assets/images/hero-originals/README.md
Normal file
20
assets/images/hero-originals/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Hero-Originalbilder
|
||||
|
||||
Das Tool `npm run hero:prepare` unterstuetzt zwei Eingabeformate:
|
||||
|
||||
1. Unterordner pro Variante (empfohlen)
|
||||
|
||||
- `assets/images/hero-originals/<variante>/hero.png`
|
||||
|
||||
2. Flache Ablage von PNGs
|
||||
|
||||
- `public/images/hero-originals/hero1.png`
|
||||
- `public/images/hero-originals/hero2.png`
|
||||
|
||||
Ausgabe je Variante in:
|
||||
|
||||
- `public/images/hero/<variante>/hero_960.webp`
|
||||
- `public/images/hero/<variante>/hero_1600.webp`
|
||||
- `public/images/hero/<variante>/hero_fallback.png`
|
||||
|
||||
Die Startseite (`components/Hero.vue`) waehlt danach automatisch zufaellig eine vorhandene Variante aus.
|
||||
Reference in New Issue
Block a user