Searching Open Sourcery

Type to search Open Sourcery.

Motion & Scroll

Reveal

Scroll reveals written as classes. Thirty-two effects, stagger groups, and no dependencies.

v0.1.1@magic-spells/reveal

$ npm i @magic-spells/reveal

GitHubnpm

Usage

<link rel="stylesheet" href="https://unpkg.com/@magic-spells/reveal/dist/reveal.min.css" />
<script src="https://unpkg.com/@magic-spells/reveal"></script>
<script>
  Reveal.init();
</script>

About

Class-driven scroll reveals on IntersectionObserver. AOS-style effects as plain classes, CSS custom properties for timing, a Tailwind entry that generates only what you write, and a real destroy() for single-page apps. Zero dependencies, 5.3 kB gzipped all in.

Features

  • 🪶 Tiny - 5.3 kB gzipped all in, nothing to install alongside it
  • 🎯 IntersectionObserver-based - no scroll handler running your animations
  • 📐 Layout geometry - trigger lines are measured on the untransformed box, so a reveal can never move its own trigger
  • 🎨 Thirty-two effects - fades, diagonals, slides, flips, zooms, and blurred blooms; add your own with a CSS rule
  • 🎛️ Custom-property timing - every timing class sets one CSS variable read by a single transition rule
  • 🌬️ Tailwind entry - every class as a @utility, so a project ships only the effects and timings it writes

Attributes

AttributeValueDescription
data-reveal-offsetpx or '%'Trigger distance above the viewport edge, overriding the global offset
data-reveal-once"true" / "false"Reveal once, or reveal and hide again on every crossing. Overrides the global once
data-reveal-anchorCSS selectorTake the trigger geometry from that element instead of this one
data-reveal-anchor-placementplacementWhich edge of the trigger has to reach which edge of the viewport
data-reveal-groupname or name:stepStagger the members revealed together by step milliseconds — see Stagger groups

About, features, usage and options are taken from the package README.