✨ Sparklefall ✨

Beautiful, fun falling sparkle animation JavaScript library

šŸŽ® Interactive Controls

// Current configuration const sparkles = new SparkleFall({ interval: 800, wind: 0, maxSparkles: 50, minSize: 10, maxSize: 30, sparkles: ['✨', '⭐', 'šŸ’«', '🌟'], colors: null });

šŸš€ Getting Started

Install SparkleFall with npm:

npm install sparklefall

Or use CDN:

<link rel="stylesheet" href="https://unpkg.com/sparklefall@latest/dist/sparklefall.css"> <script src="https://unpkg.com/sparklefall@latest/dist/sparklefall.min.js"></script>

🧩 Include CSS

Include the default CSS (choose one):

ESM (Vite/Webpack):

import 'sparklefall/styles.css'; import SparkleFall from 'sparklefall'; const sparkles = new SparkleFall({ injectStyles: true });

CDN:

<link rel="stylesheet" href="https://unpkg.com/sparklefall@latest/dist/sparklefall.css"> <script src="https://unpkg.com/sparklefall@latest/dist/sparklefall.min.js"></script> <script>const s = new SparkleFall({ injectStyles: true });</script>

āš›ļø Framework Support

SparkleFall works with your favorite framework:

npm install react-sparklefall
npm install ngx-sparklefall

Full TypeScript support included!

āš›ļø React Usage

Install and import the CSS once, then use the component:

import 'sparklefall/styles.css'; import { SparkleFall } from 'react-sparklefall'; export default function App() { return ( <SparkleFall maxSparkles={50}> <h1>✨ Hello!</h1> </SparkleFall> ); }

šŸ…°ļø Angular Usage

Import the CSS in global styles and use the standalone component:

/* styles.css */ @import 'sparklefall/styles.css'; /* app.component.ts */ import { Component } from '@angular/core'; import { SparkleFallComponent } from 'ngx-sparklefall'; @Component({ selector: 'app-root', standalone: true, imports: [SparkleFallComponent], template: `<sparkle-fall [maxSparkles]="50"></sparkle-fall>` }) export class AppComponent {}

✨ Features

  • • Zero dependencies
  • • Fully customizable
  • • TypeScript support
  • • < 3KB gzipped
  • • Mobile optimized
  • • Performance focused