Shiny text
A band of light sweeps across the text, again and again.
- enhancer
- shine
- loop
- highlight
- since 0.1
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
Shiny text example
A light passes over the words.
A light passes over the words.
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"><span data-motion="shiny">A light passes over the words.</span></p>
import { Shiny } from "./motion/react/Shiny";
<Shiny>Your content</Shiny>
<script setup lang="ts">
import Shiny from "./motion/vue/Shiny.vue";
</script>
<template>
<Shiny>Your content</Shiny>
</template>
const el = document.querySelector("#title");
el.dataset.motion = "shiny";
The wrappers: Shiny.tsx (React, TypeScript) and Shiny.vue (Vue). Both render the same attributes as the HTML; the loader does the rest.
Options
| Attribute | Default | What it does |
|---|---|---|
data-motion-speed | 3 | seconds per pass |
data-motion-color | auto | the band's color; auto mixes a light shade of the text color |
Accessibility
Pure CSS once started; paused off screen and in hidden tabs. Reduced motion: plain text. The text keeps its color for contrast checks and theme changes.
Size
shiny.js is 0.4 KB gzip. A page loads the loader (2.7 KB) and core.js (1.4 KB) once, whatever it uses.