Motion Blocks

Text

Weight Wave

Hover-reactive text effect that smoothly increases font weight with a falloff across neighboring characters. Requires a variable font.

  • lit Preview of https://lit.devLitSimple. Fast. Web Components.
  • gsap Preview of https://gsap.comGSAPAnimate anything. Silky-smooth performance.

Preview

Move your cursor over the text to shift font weight with a smooth falloff. Requires a variable font.
Attributes

Installation

pnpm dlx motion-blocks add weight-wave

Usage

---import "@/components/motion-blocks/weight-wave-element.ts";--- <motion-weight-wave text="Hover me"></motion-weight-wave>

API Reference

Attribute Type Default
text The text content to display and animate. string ""
base-weight Base font weight when not hovering. number 350
hover-weight Font weight at cursor position. number 750
influence-radius Number of neighboring characters affected by the wave. number 3
falloff-power Power curve for weight falloff (higher = sharper falloff). number 1.5
duration Animation duration in seconds. number 1.0
ease easing function for the animation. string "power3.out"