@kikytokamuro/spotlight-cursor
v1.0.0
Published
Lightweight spotlight cursor effect for websites
Maintainers
Readme
Spotlight Cursor
Lightweight spotlight cursor library
Installation
npm install @kikytokamuro/spotlight-cursorUsage
import { SpotlightCursor } from '@kikytokamuro/spotlight-cursor';
import '@kikytokamuro/spotlight-cursor/spotlight-cursor.css';
const spotlight = new SpotlightCursor(document.body, {
size: 400,
color: 'rgba(255, 100, 100, 0.1)',
blur: 90,
easing: 0.1,
});
spotlight.init();API
Methods
| Method | Description |
| ------------------------- | ----------------------------------------- |
| init() | Creates DOM elements and starts animation |
| destroy() | Removes elements and cleans up resources |
| updateOptions(options) | Updates parameters on the fly |
Options
| Parameter | Type | Default | Description |
| --------- | -------- | ------------------------ | --------------------------- |
| size | number | 300 | Glow diameter in px |
| color | string | rgba(255,255,255,0.15) | Glow color |
| blur | number | 80 | Blur radius in px |
| easing | number | 0.15 | Smoothing coefficient (0–1) |
| zIndex | number | 9999 | Overlay z-index |
Development
# Install dependencies
npm install
# Dev server
npm run dev
# Build for production
npm run build
# Watch mode
npm run build:watchLicence
MIT
