Hero-module: ASF golden files verwerkt in het ontwerp (preload als regio-paar, alleen WebP in LCP)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
@@ -58,3 +58,17 @@ Seed values: title "Andrea Slop", tagline "Lifestyle fotograaf · Huizen", butto
|
||||
- Variants are limited by the source size (no upscaling); the public data lists only variants that exist.
|
||||
- Two preload links (portrait, landscape) are needed when a `tall` ratio exists.
|
||||
- The first-slide data in `#cms-data` and in the HTML must come from the same computation.
|
||||
|
||||
## Golden files delivered (ASF commit 13f78c4, branch feature/hero-module of the ASF repository)
|
||||
|
||||
Folder `web/contract/host-injection/hero/` (README with all rules, `seed.json`, six inputs: standard, minimal, two-lines, hostile, no-alt, none; per input `NAME.expected.html` and `NAME.expected-preload.html`). The CMS host template must produce exactly these files (Build and Test unit H4). Choices accepted by the CMS session:
|
||||
|
||||
1. Only WebP in the LCP picture and the preload (a preload cannot say "AVIF if supported"); AVIF variants may exist for slides 2..n on the client.
|
||||
2. Selection by orientation: `<source media="(orientation: portrait)" … type="image/webp">` for `tall` plus the `img` for `wide` inside `<picture class="cms-hero-picture">`; two preloads with `media` portrait and landscape; without `tall` one preload without `media`; without `wide` an `img src` and a preload `href`.
|
||||
3. Focus as `style="object-position:X% Y%"` on the `img` (no trailing zeros, at most two decimals; no style without a valid focus). `width` and `height` on the `img` are the original image size from the data.
|
||||
4. The preload is a region pair `<!--CMS:HERO-PRELOAD-->…<!--/CMS:HERO-PRELOAD-->` in the head, like `CMS:HERO-HTML` (this replaces the earlier single-marker idea).
|
||||
5. A slide without alt (and not decorative), with a foreign or unsafe path or without a size is skipped; no usable slide or no title gives empty regions (the baked hero stays). At most 2 buttons; targets are `#anchor`, `/path` or `https://`. New lines in the title become `<br>` after escaping.
|
||||
6. Variant names `/media/hero/<hash>/wide-1600.webp` and `tall-960.avif`.
|
||||
7. Seed (first focus estimates by looking at the photos, (x,y) from the top left): hero-8 (0.50,0.55), hero-7 (0.45,0.50), hero-1 (0.55,0.60), hero-2 (0.45,0.45), hero-3 (0.45,0.40), hero-4 (0.45,0.35), hero-5 (0.50,0.55), hero-6 (0.50,0.35). Bryan adjusts them in the admin.
|
||||
|
||||
Not yet built on the ASF side (after this design): hydration and slider from the data block, marker injection in the build, e2e against a stand-in host, the baked fallback from the CMS-driven format.
|
||||
|
||||
Reference in New Issue
Block a user