Fluid
Real-time 2-channel dye and velocity advection stored in Ping-Pong Framebuffer Objects. Moving your pointer injects velocity trails that combine with the canvas using Additive Color Blending (ACD), and clicking triggers radial splashes.
Live Playground
Ping-Pong FBO Move & Click to Splash
Dissipation 0.975
Swirl 1.40
Radius 0.0045
Where to Use It
Creative Studio & Agency Headers
Reward curious visitors with responsive cursor dye trails and click-burst splashes on interactive cover pages.
Music, Festival & Launch Pages
Reactive fluid ribbons respond smoothly to fast pointer gestures and touch swipes at 60 FPS.
Usage (Copy & Paste)
<section
data-fx="fluid"
data-fx-dissipation="0.975"
data-fx-radius="0.0045"
data-fx-swirl="1.4"
style="min-height: 60vh;"
>
<div style="position: relative; z-index: 1;">Interactive Fluid</div>
</section>
<script src="https://unpkg.com/@votax572002/fluxfx/dist/fluxfx.min.js"></script> 'use client';
import { Fluid } from '@votax572002/fluxfx/react';
export function FluidHero() {
return (
<Fluid dissipation={0.975} radius={0.0045} swirl={1.4} style={{ minHeight: '60vh' }}>
<h1>Fluid Simulation</h1>
</Fluid>
);
} import { FluxFX } from '@votax572002/fluxfx';
FluxFX.apply(el, 'fluid', {
dissipation: 0.975,
radius: 0.0045,
swirl: 1.4,
speed: 1.0,
}); How It Works (Flowchart)
Props & Attributes
| HTML Attribute | JS / React Prop | Type | Default | Description |
|---|---|---|---|---|
data-fx-dissipation | dissipation | number | 0.975 | Trail fade retention (0.90–0.996). |
data-fx-radius | radius | number | 0.0045 | Cursor brush splash radius. |
data-fx-swirl | swirl | number | 1.4 | Vorticity curl strength. |
data-fx-speed | speed | number | 1.0 | Advection speed multiplier. |
data-fx-colors | colors | string | string[] | ['#6366f1','#06b6d4','#f43f5e'] | 3-stop fluid dye palette. |