Overview & One-Click Demo
Click Start Recording in the top-right corner, interact with any of the animation playgrounds below, and click Stop Recording to inspect and scrub the timeline—or click Auto-Record Full Showcase below to run an automated sequence across all animation types.
1. CSS Animations (Delays, Iterations & Infinite)
Demonstrates capturing infinite animations already running when recording starts via document.getAnimations(), as well as triggered CSS animations with animation-delay, multiple animationiteration events, animationend, and animationcancel.
div#infinite-spinner.demo-actor.infinite-orbit
Always running (infinite). Captured immediately when recording starts and paused when visualizing.
div#delayed-iter-box.demo-actor.iter-pulse-target
160ms delay, 3 iterations of 260ms each.
2. CSS Transitions
Demonstrates recording transitionrun, the delay segment before transitionstart, and transitionend / transitioncancel. Keyframes are snapshotted while active so completed transitions can be scrubbed backward and forward.
div#transition-card.demo-actor.transition-box
Transitions transform and background-color over 360ms after a 120ms delay.
3. Web Animations API (element.animate())
JS-driven animations created with element.animate() do not fire DOM animationstart events—they are captured via document.getAnimations() and our WAAPI hook, including their keyframes, iterations, and computed timing.
div#waapi-actor.demo-actor.waapi-box
Runs a 2-iteration alternating keyframe animation via element.animate().
4. Scroll-Driven Animations & Scrollable Containers
Scroll the container below (or click the scroll button) during a recording. The recorder tracks both scrollTop / scrollLeft on the container and the progress of its ScrollTimeline and ViewTimeline animations. Scrubbing the timeline playhead restores both the scroll offset and the animation progress!
Scroll down inside div#scroll-stage.scroll-container ↓
Bottom of scrollable container reached ✓
5. Elements that Animate & Get Removed from the DOM
When a tracked element is disconnected from the DOM (!element.isConnected), its row in the timeline is greyed out, displays a ⚠️ Removed warning indicator, and renders its recorded animation boxes and events as outlines.
6. User Interactions (Clicks & Keyboard Events)
Discrete user interactions (click, keydown, keyup) are recorded with relative timestamps and rendered as color-coded vertical markers on both the target element’s row and the pinned window / document row.
Installation & Usage
Drop <interactions-timeline> into any page to inspect and scrub its animations, transitions, and scroll interactions.
<script type="module" src="interactions-timeline"></script>
<!-- Optional: explicitly place the custom element (auto-injected if omitted) -->
<interactions-timeline></interactions-timeline>JavaScript API
In addition to the injected top-right recording button and interactive bottom-sheet scrubber, you can control <interactions-timeline> programmatically:
const visualizer = document.querySelector('interactions-timeline');
// Start and stop recording programmatically
visualizer.startRecording();
const store = visualizer.stopRecording();
// Scrub the page (animations, transitions, and scrollers) to 450ms
visualizer.scrubToTime(450);
// Close or reset the visualizer and unpause all page animations
visualizer.closeVisualizer();
visualizer.reset();