Menu

I put a real fluid simulation behind the cursor (16 KB, no dependencies)
📰

I put a real fluid simulation behind the cursor (16 KB, no dependencies)

DEV Community: javascript·Frantisek Gejdos·about 14 hours ago
#PfTXGp3h
#devtojavascript#devto#dev#colour#cursor
Long article (492 words) — no AI summary yet.
Reading 0:00
15s threshold

You know the effect: the cursor drags coloured smoke behind it, and the smoke curls and mixes like ink in water. Most versions I found are tied to React or pull in a 3D library. I wanted one script tag, so I wrote Fluid Cursor : free, MIT, zero dependencies, about 16 KB minified.

Live demo: https://fluri.xyz/fluid-cursor/

<script src = "https://cdn.jsdelivr.net/npm/@fluritheme/fluid-cursor@1/dist/fluid-cursor.global.js" data-auto ></script>

Enter fullscreen mode

Exit fullscreen mode

Or with npm:

import { createFluidCursor } from "@fluritheme/fluid-cursor" ;

const fluid = createFluidCursor ( { colors : [ "#ff3d7f" , "#7c4dff" , "#22d3ee" ] , fade : 2.5 } ) ; fluid .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.