axi0motion

Scramble hover

Letters near the pointer break into random glyphs and settle back as it moves on.

  • enhancer
  • hover
  • pointer
  • scramble
  • 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

Scramble hover example

Run the pointer over this line and the letters scatter.

Controls

90 px
650 ms
45 ms

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="scramble-hover">Run the pointer over this line and the letters scatter.</p>

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

Options

AttributeDefaultWhat it does
data-motion-radius90Reach around the pointer
data-motion-duration650How long a letter stays scrambled
data-motion-speed45Time between glyph changes
data-motion-glyphsmixedGlyph set
data-motion-color#f6a04dGlyph color

Accessibility

The text never changes for screen readers (one readable copy, the moving letters aria-hidden), and each letter keeps its measured width while scrambled, so nothing shifts. Nothing moves until a pointer does; reduced motion turns the effect off. The frame loop runs only while letters are settling, on screen and in a visible tab.

Size

scramble-hover.js is 1.0 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.