axi0motion

Paper fold

Line by line the text unfolds from its creases like a folded sheet of paper opening flat, each line a panel hinged to the one above.

  • enhancer
  • entrance
  • fold
  • paper
  • 3d
  • lines
  • scroll
  • since 0.2

Background Studio: tune it below, then copy the code

Your system asks for reduced motion: the demo shows its final state and nothing moves.

Live demo

Paper fold example

Every line of this sentence opens like a folded sheet of paper.

Controls

1300 ms
210 ms
0 ms

Code

It follows the controls above: change an option and the code changes with it.

<script src="https://search.axi0.io/axi0/motion/motion.js" defer></script>

<p class="m-demo-lg" data-motion="paper-fold" data-motion-every="4200">Every line of this sentence opens like a folded sheet of paper.</p>

The wrappers: PaperFold.tsx (React, TypeScript) and PaperFold.vue (Vue). Both render the same attributes as the HTML; the loader does the rest.

Options

AttributeDefaultWhat it does
data-motion-duration1300Time each line takes to open
data-motion-stagger210Delay from one line to the next
data-motion-every0Fold up and open again this often (0 = once)

Accessibility

Words stay real text, readable and selectable; only transform, opacity and brightness change, so no layout shifts. Text already on screen when the page loads never hides. Under reduced motion it shows flat at once. Only transform, opacity and paint change, so nothing around it moves. Frames run through the shared loop, which stops off screen, in hidden tabs and under reduced motion; reduced motion shows the final state with no movement.

Size

paper-fold.js is 1.1 KB gzip, with text-kit.js 3.2 KB it needs. A page loads the loader (2.9 KB) and core.js (1.4 KB) once, whatever it uses.