Skeleton shimmer

Placeholder blocks with a soft highlight sweeping across while content loads, then a crossfade to the real rows.

ListLoad Pure CSS time-based Targets: Web · App All modern browsers
Maya ChenPushed 3 commits
Ravi PatelOpened a pull request
Lena FischerCommented on #42
Target
Implement the "Skeleton shimmer" effect in vanilla HTML/CSS/JS.

Context: Placeholder blocks with a soft highlight sweeping across while content loads, then a crossfade to the real rows.
Trigger: the page loads.
Timeline: time-based (duration + easing).

Motion tokens (normal):
- translateX (highlight): -100% → 100%
- opacity (skeleton → content): 1 → 0 → 0 → 1
- duration: 1400ms per sweep, infinite · 250ms crossfade
- easing: linear (sweep) · ease-out (crossfade)
- note: highlight is a gradient layer moved by transform, not background-position

Motion tokens (prefers-reduced-motion):
- opacity (skeleton → content): 1 → 0 → 0 → 1
- duration: 250ms
- easing: ease-out
- note: no sweep; static grey blocks

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
- skeleton has the same layout footprint as the loaded content so nothing jumps
- sweep stops (animation removed) once content is shown

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