Live preview · fully interactive
The prompt
Build wavy letters for the word WAVEFORM. ## Look Inline-block letters, clamp(32px, 6vw, 64px), weight 700, tracking -0.04em, color #f2f2f7 on #08080d. ## Behavior Each frame set translateY to sin(time/280 + index * 0.55) * 10. ## Design tokens - Text #f2f2f7; page #08080d. ## Motion - Amplitude 10px. The divisor 280 is about a 1.8s period. No CSS transition. ## Constraints - Single self-contained HTML file. No libraries. - Honor prefers-reduced-motion: reduce by skipping the loop and leaving a readable static frame - Readable at 390px width with no horizontal page scroll
The code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body {
background: #08080d; color: #f2f2f7; font-family: Inter, system-ui, sans-serif;
min-height: 100vh; overflow: hidden;
}
.hint { position: absolute; left: 16px; top: 16px; z-index: 5; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a99; }
main { min-height: 100vh; display: grid; place-items: center; } .ch { display: inline-block; font-size: clamp(32px, 6vw, 64px); font-weight: 700; letter-spacing: -0.04em; }
@media (max-width: 420px) {
.hint { font-size: 10px; letter-spacing: 0.08em; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
</style>
</head>
<body>
<main><h1 id="w"></h1></main>
<script>
var reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
var word = "WAVEFORM";
var root = document.getElementById("w");
word.split("").forEach(function (ch) {
var s = document.createElement("span");
s.className = "ch";
s.textContent = ch;
root.appendChild(s);
});
var spans = root.children;
function frame(now) {
if (reduce) return;
for (var i = 0; i < spans.length; i++) {
var y = Math.sin(now / 280 + i * 0.55) * 10;
spans[i].style.transform = "translateY(" + y + "px)";
}
requestAnimationFrame(frame);
}
requestAnimationFrame(frame);
</script>
</body>
</html>About this effect
Each letter of WAVEFORM is offset on Y by a sine of time plus its index. Amplitude is 10px and the wave completes a cycle in about 1.8s.
Similar effects
Scramble / Decode Text
Headlines that decode from random characters into the final message, with hover re-trigger.
Split Text Reveal
Characters rotate up from masked lines in a cascading GSAP stagger. No paid plugins.
Typewriter Code
A code editor that types itself, syntax-highlights each line, then deletes and loops.