UNIVERSAL REACT ANIMATION ENGINE · JAVASCRIPT & TYPESCRIPT
A different kind
of switch.
A little nature. A little theatre.
Give the space between light
and dark a cinematic feeling.
Cinematic in motion
Viral Sweep
Smooth exponential circular shockwave expanding from the trigger origin.
Loading theme
The motion library
Small moments.
Lasting impressions.
Choose a material.
See how it moves.
UNIVERSAL & HIGH PERFORMANCE
Why glowafter?
Standard theme switchers either flash abruptly or stutter heavily on mobile touch screens. glowafter is engineered to deliver flawless 60/120 FPS transitions in any React app using JavaScript or TypeScript.
Universal React (JS & TS)
Works across Vite, Next.js (App & Pages Router), Remix, Astro, and CRA. Requires zero configuration and no external state libraries. Features first-class support for both JavaScript and TypeScript.
Zero-Stutter Mobile Touch
Mobile browsers often misreport document.hidden during tap gestures. glowafter extracts raw touch coordinates from touches[0] / changedTouches[0] and promotes GPU compositor layers via transform: translateZ(0) and will-change: clip-path.
Dual-Engine Graceful Fallback
Leverages the native browser View Transitions API for peak 120 FPS hardware performance, and seamlessly falls back to GSAP canvas rendering on older WebKit and Firefox browsers. Automatically honors prefers-reduced-motion with instant swaps.
INTEGRATION IN SECONDS
Install once. Use anywhere.
Designed for Vite, Next.js, Remix, CRA, and vanilla JS. Toggle below between JavaScript and TypeScript to view matching code recipes.
Choose Package Manager
npm install glowafterclassList & localStorage, or connects to your state.import { useModeAnimation } from 'glowafter'
export function ThemeToggle() {
// glowafter manages .dark on <html> & syncs with localStorage automatically
const { ref, toggleSwitchTheme, isDarkMode, mounted, isAnimating } = useModeAnimation({
presetId: 'viral-sweep',
duration: 1200,
})
if (!mounted) return null
return (
<button
ref={ref}
onClick={toggleSwitchTheme}
disabled={isAnimating}
className="px-4 py-2 rounded-lg font-medium bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900 transition"
aria-label="Toggle theme"
>
{isDarkMode ? '☀️ Light' : '🌙 Dark'}
</button>
)
}THE MOTION CATALOG
17 Presets. Zero Stutter.
Inspect all procedural recipes and their physical mechanics. Click "Preview" on any preset to test it on this page.
| Preset ID | Family | Title | Motion Mechanics | Duration | Action |
|---|---|---|---|---|---|
viral-sweep | Cinematic | Viral Sweep | Smooth exponential circular shockwave expanding from the trigger origin. | 1.2s | |
glass-shatter | Cinematic | Glass Shatter | Multi-facet Voronoi crystalline fracture shards radiating outward. | 1.4s | |
seaside-waves | Water | Seaside Waves | Sinusoidal ocean tidal surf with multi-harmonic wave crests. | 1.6s | |
balloon-pop | Cinematic | Balloon Pop | Elastic rubber bubble stretch followed by a sudden radial pop rupture. | 1.3s | |
bomb-drop | Cinematic | Bomb Drop | Descending gravity projectile arc that detonates into a concussive shockwave. | 1.5s | |
party | Cinematic | Party | Starburst explosion with dispersing confetti ribbons and geometric streamers. | 1.4s | |
waterfall | Water | Water Tank | A continuous pour meets a rippling waterline as the screen fills from below. | 2.4s | |
silver-rain | Water | Rainfall | Fine drops accelerate into a pool. Splashes dance along its rising surface. | 2.2s | |
puddle-bloom | Water | Puddle Ripple | Expanding pools meet as delicate rings travel beyond their edges. | 1.6s | |
falling-leaves | Organic | Autumn Leaves | A staggered canopy drifts and turns before unfolding into the next theme. | 2.3s | |
paper-shred | Material | Paper Shred | Narrow paper ribbons peel away at individually staggered speeds. | 1.4s | |
paper-tear | Material | Paper Tear | An irregular seam opens through the middle and pulls the page apart. | 1.5s | |
wall-break | Material | Wall Break | Cracks spread through irregular blocks before the wall crumbles away. | 1.4s | |
glass-break | Material | Glass Fracture | Fine cracks radiate outward before the sharp facets open. | 1.4s | |
tidal-silk | Water | Tidal Silk | A soft, broad wave rolls over the page with a gently changing edge. | 1.6s | |
ink-bloom | Organic | Ink Bloom | An organic ink pool spreads with scalloped edges and small imperfections. | 1.5s | |
woven-blinds | Material | Woven Blinds | Horizontal bands open in sequence, like light through a woven shade. | 1.3s | |
gif | Custom | Custom GIF | Reveals the new theme through an animated mask defined by any custom GIF. | 2.0s |