Command Palette

Search for a command to run...

Hectal
Phase 12: Scroll-Driven and Scroll-Triggered Animation
Web Animation · Exercise 4 of 5 PreviousNext
Intermediate

Reveal cards created by code

Add appends a card and Remove removes the last one. Give each new card a reveal on its own ViewTimeline (from entry 0% to entry 100%), after testing that ViewTimeline exists. When a card is removed, cancel its animation. Remove with no cards must do nothing and raise no error.

What Check tests

  1. A new card gets a scroll-driven animation
  2. The card is hidden below the box and visible once scrolled in
  3. Remove cancels the animation (nothing is left running)
  4. Remove with no cards does nothing and raises no error

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.
00:00.000
animations
0.00s0.10s0.20s0.30s0.40s0.50s0.60s0.70s0.80s0.90s

Nothing is moving yet. Hover, click or scroll the page: every animation it starts shows up here as a track.

frames

Console

Nothing logged yet.