Socket
Book a DemoInstallSign in
Socket

@ar-dacity/ardacity-splash-cursor

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ar-dacity/ardacity-splash-cursor

Interactive fluid simulation cursor effects for React applications

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

ArDacity Splash Cursor

A React component that creates beautiful fluid simulation cursor effects that follow the user's pointer movements, creating a splash-like visual effect. Based on WebGL shaders for high-performance animations.

Installation

npm install @ar-dacity/ardacity-splash-cursor

or

yarn add @ar-dacity/ardacity-splash-cursor

What Happens During Installation

When you install this package, it automatically:

  • Detects your project structure
  • Copies the SplashCursor component file into your components directory
  • Adapts to React or Next.js projects
  • Supports TypeScript by using the appropriate file extension (.tsx)

Usage

After installation, you can import the component directly from your components directory:

import SplashCursor from './components/SplashCursor';

function App() {
  return (
    <div>
      <h1>My Awesome Website</h1>
      {/* Add the SplashCursor component to enable the effect */}
      <SplashCursor />
    </div>
  );
}

Component Props

PropertyTypeDefaultDescription
SIM_RESOLUTIONnumber128Simulation resolution for the fluid dynamics. Higher values increase quality but reduce performance.
DYE_RESOLUTIONnumber1440Resolution of the color/dye field. Higher values create more detailed color effects.
DENSITY_DISSIPATIONnumber3.5How quickly the color dissipates. Lower values make colors last longer.
VELOCITY_DISSIPATIONnumber2How quickly the motion dissipates. Lower values create longer-lasting movement.
PRESSUREnumber0.1Fluid pressure parameter that affects how the simulation behaves.
PRESSURE_ITERATIONSnumber20More iterations create more accurate fluid simulation at the cost of performance.
CURLnumber3Controls the amount of vorticity/swirl in the fluid.
SPLAT_RADIUSnumber0.2Size of the splash effect when cursor moves.
SPLAT_FORCEnumber6000Strength of the force applied to the fluid when cursor moves.
SHADINGbooleantrueEnables 3D-like shading effect on the fluid.
COLOR_UPDATE_SPEEDnumber10How quickly the colors change.
BACK_COLORobject{ r: 0.5, g: 0, b: 0 }The background/base color for the fluid effect (RGB values between 0-1).
TRANSPARENTbooleantrueWhether the background should be transparent.

Customization Examples

You can customize the fluid simulation by adjusting the props:

<SplashCursor 
  SPLAT_RADIUS={0.3}
  SPLAT_FORCE={8000}
  CURL={5}
  BACK_COLOR={{ r: 0, g: 0.3, b: 0.5 }}
/>

Performance Considerations

For optimal performance:

  • Lower the SIM_RESOLUTION and DYE_RESOLUTION on lower-end devices
  • Disable SHADING if performance is an issue
  • Consider reducing PRESSURE_ITERATIONS for better performance

Browser Compatibility

The SplashCursor component is compatible with all modern browsers that support WebGL.

License

MIT

Keywords

react

FAQs

Package last updated on 24 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts