Smear Type

Two lines of heavy capitals uncovered by a glowing cloud, smeared sideways while half hidden.

Two lines of heavy capitals sit on a near-black ground. A soft cloud in the ground's own colour uncovers them, its edge glowing a hotter hue. Where the type is half hidden it smears sideways, then slides the last few pixels into place, while grey ribbons churn through the ground and blobs of ink streak across.

How it works

The motion is not computed. Every frame of a 48-frame loop, 50ms a frame, was traced into five grey layers on a 5 pixel grid, and the shader plays them back a frame at a time.

  • Ribbons. The ground mixes toward the ribbon colour by this layer.
  • Rim. Where the cloud's glowing edge lies.
  • Reveal. How much of the type shows.
  • Smudge. How much of it is still sharp. The rest of the reveal is drawn smeared 30 by 8 pixels.
  • Streaks. The ghost streaks outside the lines.
  • Ink. Traced at 3 pixels, on the seven frames that have it.

Only the type is the visual's own, so any two lines work. Over the lines the traced layers only say where and when: the cloud's shape is the type itself blurred 26 by 12 pixels into one long mass. The two lines then slide the last 20 and 40 pixels into place, on frames 19 to 22 and 26 to 29.

It pauses off screen and on a hidden tab. Under reduced motion it draws frame 37 once, both lines in with a small cloud over their middle, and never starts the loop. The canvas pixel ratio is capped at 2, and the WebGL context is released on unmount.

Installation

pnpm dlx shadcn@latest add @uitopia/smear-type

Usage

import SmearType from "@/components/ui/smear-type";

<div className="aspect-square">
  <SmearType lines={["RUNNING", "CULT MEMBER"]} />
</div>;

The effect fills its box and is drawn for a 1:1 scene, so the box should keep that ratio. It takes exactly two lines, and any two work. Capitals read best, and a line wider than the scene allows is set smaller. The type comes from --font-sans, and the layout is measured from the live font. A wide grotesque reads best.

The traced layers are inlined in assets.ts as data URIs, about 110KB, so there are no static files to serve. To serve them yourself, point LAYERS_URL and INK_URL in params.ts at your own .webp files.

PropDefaultWhat it changes
lines["RUNNING", "CULT MEMBER"]The two lines.
coloursnear-black ground, grey ribbons, white typeground, ribbon, rim, type and ink. The rim reads best as a hotter shift of the ground.
weight500The weight the face is drawn at.
speed1Playback rate of the 48-frame loop.
fontVar--font-sansThe CSS variable holding the font family.