Files

7.4 KiB

Domain Entities - Unit 2: Display fallbacks

The site has no runtime data model and unit 2 adds none. The entities are the reveal phase of an element, the markers and ids the no-JavaScript CSS depends on, the preload link, and the per-page inventory of the largest paint. Existing entities (ContentImage, SitePage, NavItem) are unchanged. Rules: business-rules.md. Flows: business-logic-model.md.

1. Relationships

graph TD
    Rect["ViewportMeasure: top edge and viewport height"]
    Phase["RevealPhase: settled, hidden, revealed"]
    Elem["Reveal element"]
    Img["ContentImage: src, alt, width, height"]
    Pair["DeferredImagePair: empty img plus noscript twin"]
    Mark["JsOnlyMarker: data-requires-js, data-email-pending, data-deferred"]
    Css["NoScriptStyleSheet in the head"]
    Frag["FragmentTarget: mobile-nav, site-header"]
    Link["PreloadLink: rel preload, as image"]
    Row["FirstRow: always, from md, from lg, or none"]
    Prof["PageImageProfile: largest paint per page and width"]
    Rect -->|"decides first phase of"| Phase
    Phase -->|"styles"| Elem
    Img -->|"yields"| Pair
    Pair -->|"first image carries"| Mark
    Mark -->|"is hidden by"| Css
    Frag -->|"is shown by"| Css
    Img -->|"yields, only for picture"| Link
    Prof -->|"says which page needs a"| Link
    Row -->|"decides eager tiles and their"| Link
    classDef value fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000;
    classDef entity fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
    classDef build fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
    class Rect,Phase,Img value;
    class Elem,Pair,Link,Prof,Row entity;
    class Mark,Css,Frag build;

Text alternative: a measured rectangle sets the reveal phase, an image yields the deferred pair or a preload link, the first-row rule picks eager tiles, and the stylesheet acts on markers and targets.

2. Reveal phase

Phase When data-reveal opacity transform transition
settled Prerender, hydrating render, in view at hydration, reduced motion, no observer visible 1 none none
hidden After hydration, wholly below the viewport hidden 0 translateY(24px) none
revealed Hidden element intersected (threshold 0.12, bottom margin 60 px) visible 1 none opacity, transform, 0.8 s, smooth, delay delay s

Transitions: settled stays; hidden becomes revealed; revealed stays (P20, P21). useReveal returns visible (phase is not hidden) and animated (phase is revealed).

Input of startsHidden Type Note
top number getBoundingClientRect().top; zero for display: none and in jsdom
viewportHeight number window.innerHeight

Constants kept from useReveal: threshold 0.12, rootMargin 0px 0px -60px 0px; translateY(24px) and the reveal duration token from Reveal.

3. Markers the no-JavaScript CSS acts on

Marker Meaning Rule Put on
data-requires-js No function without JavaScript; hidden BR-NJS-01 Hamburger button (NavigationBar); chevron buttons (NavSubmenu, MobileNavGroup); HeroArrows buttons; HeroPauseButton; hero progress bar; FilterBar root; testimonial controls spacer (CarouselPlaceholder); footer Contact column (through FooterColumn)
data-email-pending Placeholder for the address that never comes without JavaScript; hidden BR-NJS-02 Already there (unit 1): footer li, contact card li (two), gate sentence span, gate button placeholder
data-deferred Photo that is empty until JavaScript sets its src; hidden while it has no src BR-IMG-02 The first <img> of DeferredImage
data-submenu and data-submenu-panel Desktop submenu wrapper and its panel; panel opens on :focus-within BR-NAV-09 NavSubmenu wrapper Box and panel Box

4. Fragment targets and ids

Id Element Used by Notes
mobile-nav MobileNav panel (exists) Open link href; :target rule position: fixed; no scroll on navigation
site-header NavigationBar's chakra.header (new id) Close link href position: fixed; no scroll on navigation
mobile-group-<slug> MobileNavGroup list (exists) Selector prefix [id^="mobile-group-"] Expanded without JavaScript
submenu-<slug> NavSubmenu panel (exists) aria-controls Not styled by id; the rule uses data-submenu-panel
main SkipNavContent (exists) Skip link Unchanged

Classes written by hand in the CSS (no Emotion): ns-menu-open, ns-menu-close.

Field Type Value
rel 'preload' constant
as 'image' constant
href string image.src, the hashed asset URL Vite produced
fetchPriority 'high' constant
media string, optional Only for a photo shown from one breakpoint (ASIDE_MEDIA, (min-width: 64em))

On /portfolio two links with media (min-width: 48em) (tile 2) and (min-width: 64em) (tile 3).

Written by React (not by this entity): one link per non-lazy img with src, inside the head (BR-PRE-01).

6. PageImageProfile (largest paint, preload source)

Sizes are transfer sizes from the Lighthouse reports. "React" means the hoisted link of BR-PRE-01.

Page Largest paint, below lg Largest paint, from lg Photo (KB) Preload
/ h1 text h1 text Hero hero-8 224 React, fetchPriority="high" (BR-PRE-07)
/over-mij andrea-portret same 84 React
/portfolio grid tile 1 (f41a1916) at 412; tile 2 (f41a1922) at 768 tile (f41a7883) 54 to 144 each Tile 1 React; tiles 2 and 3 media links 48em and 64em (BR-PRE-08 to 11)
/soorten-fotoshoots newborn same 74 React
/soorten-fotoshoots/newborn newborn same 74 React
/soorten-fotoshoots/zwangerschap zwangerschap same 103 React
/soorten-fotoshoots/gezin gezin same 117 React
/soorten-fotoshoots/loveshoot loveshoot same 153 React
/soorten-fotoshoots/portret portret same 97 React
/contact intro text contact-D949P5Az (aside photo) 80 Explicit media link (BR-PRE-02)
/privacyverklaring footer logo h1 text none None
404 page footer logo footer logo none None

Logos, preloaded by React on every page today: logo-dark 23 KB and logo-light 25 KB, 500 x 500 px, shown at 46 px. The light logo is used only on / from lg (BR-PRE-05). The 72 px contact portrait is 5 KB.

7. FirstRow

FirstRow is the answer of firstRow(index, columns) for one tile of the portfolio grid (BR-PRE-08).

Input Type Value for the grid
index number, 0 based Position in the unfiltered list, reading order
columns map of breakpoint media to column count base: 1, (min-width: 48em): 2, (min-width: 64em): 3. One constant that PortfolioGrid also uses for gridTemplateColumns
Tile FirstRow Markup Preload
1 (index 0) 'always' Image with src, fetchPriority="high" React
2 (index 1) { media: '(min-width: 48em)' } picture with source, DeferredImage img, loading="eager" preloadImage with media
3 (index 2) { media: '(min-width: 64em)' } same preloadImage with media
4 and up null DeferredImage None