Pulse

Light that beats: radar rings, a breathing halo, a heartbeat whose earlier rings keep fading under the new one, a ping that winds up, lands and cools, and a tap ripple.

<Fx effect="pulse" preset="Radar" />

Features

  • Radar rings, a breathing halo and a heartbeat whose old rings fade under the new.
  • A ping that winds up, lands with zero velocity and cools.
  • A tap ripple clipped to the shape.

Use it for

  • Live status.
  • Notifications that arrive.
  • Touch feedback.

On this site

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react

Usage

import { Fx } from 'runets'

<div className="card"> {/* position: relative */}
  <Fx effect="pulse" />
</div>

API

PropTypeWhat it does
effectstringThe effect’s id, as in the address of this page.
presetstringOne of the presets above; the first by default.
paramsParamsAny parameter from the table, over the preset.
place'under' | 'over'Under the parent’s content (fills, halos) or over it (sparkles, glass). Default under.
radiusnumberCorner radius in points; the parent’s own border radius by default.
backdropstring | PaintWhat glass and distortion read: an image URL, or a function that paints a canvas the size of the parent.
maskPaintAn alpha mask for mask glow and text sheen.
hotbooleanDrives heat: the layer lights in 60 ms and cools over half a second instead of cutting off.
triggernumberChange it to fire a one-shot now (ping, ripple, burst, shockwave, zap).
wakenumberChange it to redraw for a second when something the layer reads, such as its occluders, moves on its own.
shape(time, w, h) => RectThe effect’s shape inside the parent, per frame: a lens that drifts.

Parameters

NameRangeDefault
style Styleradar, breathe, heartbeat, ping, rippleradar
color Colourcolor0xef4444
core Corecolor0xffe4e4
count Rings1 to 63
period Period0.3 to 62.4
reach Reach4 to 20036
width Width0.3 to 81.6
intensity Intensity0 to 31
dur Duration0.1 to 30.75
repeat Repeat0 to 60
lag Lag0.02 to 0.50.16
headRadius Head radius0.5 to 122.6
travel Travel20 to 600160
occlusion Occlusion0 to 10.15

Accessibility

Source

The code is in src/fx/glsl/emit.ts in runets, MIT licensed.