FasterMotion

Examples

Interactive examples referenced throughout the API documentation

All examples are interactive and can be viewed directly. Each example is referenced in the corresponding API documentation with full code explanations.

Core Animation Examples

Basic Animations

Easing Examples

All easing examples are referenced in the Easing API documentation.

Easing Functions

Easing in Action

Timeline Examples

Referenced in Timeline API and Timeline Advanced.

Basic Timeline

Timeline Control

Animation Control Examples

Referenced in Tween Advanced.

Playback Control

Repeat & Loop

Callback Examples

Referenced in Tween API callbacks section.

Trigger Examples

Referenced in Tween Triggers.

Scroll Examples

Referenced in Scroll API documentation.

Advanced Concepts

Canvas Examples

Referenced in TrimPath API documentation.

TrimPath

Path Animation Examples

Referenced in Path Animation documentation.

PathResource

Path Sampling

TrimPath (SVG)

PathFollow

Fmtion Format Examples

Referenced in Fmtion Format documentation.

The .fmtion format is a unified animation file format that combines DOM animations, Canvas 2D, Lottie, and Three.js 3D content in a single declarative JSON structure.

Loading & Basics

Parameters & Interaction

Text Animation Examples

Referenced in Text Animation documentation.

TextSplitter

Split existing DOM text into animatable characters, words, lines, or sentences.

Text Animation (Canvas)

Canvas-based per-character text animation with 12+ presets and stagger effects.

Text Effects (Scroll-based)

Advanced scroll-driven text effects for creating dynamic typography animations.

TextPath (SVG Text Around Elements)

Create scrolling text that flows around elements along SVG paths with infinite scroll.

How Examples Work

Viewing Examples

Click any example link above to view the interactive demo. Each example:

  • Runs in a standalone HTML page
  • Includes full source code
  • Works with the latest FasterMotion version
  • Is optimized for performance

Finding in Documentation

Each example is embedded in the relevant API documentation using the playground component:

<CodePlayground example="/examples/v1/move-rotate-scale.html" title="Try it">
// Example code here
</CodePlayground>

Example Structure

All examples follow this pattern:

<!DOCTYPE html>
<html>
<head>
  <script src="https://static.fasterhq.com/js/faster-motion/0.4.4/faster-motion.0.4.4.umd.js"></script>
</head>
<body>
  <!-- Demo content -->
  <script>
    FasterMotion.dom({
      // Animation configuration
    });
  </script>
</body>
</html>

Using Examples

To use an example in your project:

  1. View the source: Open the example and view page source
  2. Copy the code: Copy the FasterMotion configuration
  3. Adapt to your needs: Modify targets and properties
  4. Reference the docs: Check the linked API page for details

Example Categories

Core Animation (3 examples)

Basic tween animations, transforms, fades, and movement

Easing (10 examples)

All easing functions with visual comparisons and real-world usage

Timeline (10 examples)

Sequencing, overlapping, and controlling complex animations

Triggers (5 examples)

Interactive triggers - click, hover, scroll visibility

Callbacks (3 examples)

Event handlers for animation lifecycle

Scroll (3 examples)

Scroll-based animations and parallax effects

Advanced (1 example)

Advanced techniques like relative values

Canvas (2 examples)

Canvas-specific animations including TrimPath effects

Path Animation (12 examples)

Path-based animations including PathResource, TrimPath (SVG), and PathFollow

Fmtion Format (3 examples)

Unified animation file format with parameters, scroll bindings, and listeners

Text Animation (8 examples)

DOM-based text splitting with TextSplitter for character, word, line, and sentence animations

Canvas Text Animation (6 examples)

Canvas-based per-character animation with TextAnimator, 12+ presets, and stagger effects

Text Effects (8 examples)

Scroll-driven text effects including warp, morph, scramble, glitch, 3D flip, rainbow, and path animations

TextPath (4 examples)

SVG text paths that flow around elements with infinite scroll animation

Contributing

Found a bug in an example? Want to add a new one?

  1. Examples are in /public/examples/v1/*.html
  2. Referenced in /content/docs/v1/api/**/*.mdx
  3. Submit a PR with your fix or new example

Next Steps

On this page