axi0motion

Outline draw

The letters' outlines draw themselves on, word after word, then flood with color.

  • enhancer
  • entrance
  • svg
  • stroke
  • 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

Outline draw example

Draw attention to it

Controls

1700 ms
700 ms
140 ms
1.4 px

Code

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

<link rel="stylesheet" href="/axi0/motion/motion.css?v=6">
<script src="/axi0/motion/motion.js?v=10" defer></script>

<p class="demo-big" data-motion="outline-draw">Draw attention to it</p>

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

Options

AttributeDefaultWhat it does
data-motion-duration1700Time to draw a word
data-motion-fill700Time to flood with color
data-motion-stagger140Delay between words
data-motion-width1.4Outline width
data-motion-color#f6a04dOutline color

Accessibility

The words stay real, selectable text in their places; while the outlines draw, an aria-hidden drawing sits exactly over them and is removed when the color has flooded in, so nothing reflows. Text already on screen at load waits for a replay; reduced motion shows the text as it is. The animation pauses off screen and in hidden tabs.

Size

outline-draw.js is 1.3 KB gzip, with text-kit.js 2.6 KB it needs. A page loads the loader (2.7 KB) and core.js (1.4 KB) once, whatever it uses.