Curtain image reveal

A solid panel slides off an image while the image eases from a slight zoom to rest, the first time it enters view.

ScrollEnter view Pure CSS time-based Targets: Web · App All modern browsers
Target
Implement the "Curtain image reveal" effect in vanilla HTML/CSS/JS.

Context: A solid panel slides off an image while the image eases from a slight zoom to rest, the first time it enters view.
Trigger: the element enters the viewport (first time only).
Timeline: time-based (duration + easing).

Motion tokens (normal):
- translateX (curtain): 0 → 101%
- scale (image): 1.15 → 1
- duration: 900ms
- easing: cubic-bezier(0.77, 0, 0.18, 1)
- note: curtain and image run in parallel; image eases out over the same 900ms

Motion tokens (prefers-reduced-motion):
- opacity (image): 0 → 1
- duration: 250ms
- easing: ease-out
- note: curtain hidden

Technique: prefer pure CSS transitions/animations; use JS only to toggle classes.

Acceptance:
- animate only transform and opacity unless the spec lists other properties
- no layout shift; content is visible without the animation
- when prefers-reduced-motion is set, use the reduced tokens only
- frame clips overflow; neither the curtain nor the zoom affects layout
- plays once; replay only on explicit request

Generated from the spec. Prompts differ by target name only; the tokens are the source of truth.