Production-grade, multi-season ambient visual effects library for modern web applications
npm install seasonalfx> šØ Production-grade snow effects, confetti animations, falling leaves, and seasonal particle effects for modern web applications. Lightweight, accessible, and zero dependencies.





- š Live Demo - See it in action
- š® Interactive Demo - Play with all effects
- š Documentation - Complete API reference
- š¦ NPM Package - Install via npm
- š» GitHub Repository - Source code
- š Issue Tracker - Report bugs
- š¤ Author Portfolio - Nishikanta Ray
Add beautiful snow effects, confetti animations, falling autumn leaves, and spring cherry blossoms to your website with just a few lines of code. Perfect for holiday themes, celebrations, seasonal websites, and special events.
šØļø Realistic Snow Effect - Beautiful falling snowflakes animation for winter themes
š Confetti Animations - Celebration effects for events, achievements, and milestones
š Autumn Leaves - Falling leaves effect with realistic physics
šø Spring Petals - Cherry blossom and flower petal animations
ā” Lightning Fast - Under 5KB gzipped, 60 FPS performance
āæ Accessibility First - Respects prefers-reduced-motion, mobile-optimized
š§ Framework Agnostic - Works with React, Vue, Angular, Svelte, or vanilla JS
š SSR Safe - Compatible with Next.js, Nuxt, Astro, and other SSR frameworks
š¦ Zero Dependencies - No jQuery, no bloat, just pure performance
šØ Customizable - Control intensity, colors, speed, and particle count
``bash`
npm install seasonalfx
Or with yarn:
`bash`
yarn add seasonalfx
š Your package is live on all major CDNs!
`html
`
Complete CDN Example:
`html`
Try it now: Copy the code above and open it in your browser - instant snow effect! āļø
`javascript
import { createSeasonalFX } from 'seasonalfx';
const fx = createSeasonalFX({
target: document.body,
autoSeason: true,
intensity: 'subtle',
});
fx.start();
`
`tsx
import { SeasonalFX } from 'seasonalfx/react';
function App() {
return (

Seasons & Effects
$3
Gentle snowfall with size variance and horizontal drift`javascript
fx.setSeason('winter', {
variant: 'light', // 'light' | 'holiday' | 'blizzard'
intensity: 'subtle',
});
`$3
Floating petals with swirling motion`javascript
fx.setSeason('spring', {
variant: 'sakura', // 'sakura' | 'softPetals' | 'pollen'
intensity: 'subtle',
});
`$3
Minimal dust particles or fireflies`javascript
fx.setSeason('summer', {
variant: 'sunDust', // 'heatHaze' | 'sunDust' | 'fireflies'
intensity: 'minimal',
});
`$3
Falling leaves with tumbling motion`javascript
fx.setSeason('autumn', {
variant: 'maple', // 'maple' | 'dryLeaves' | 'windy'
intensity: 'subtle',
});
`$3
Time-boxed confetti for celebrations`javascript
fx.setSeason('event', {
variant: 'celebration', // 'newYear' | 'celebration' | 'launch'
duration: 5000, // Auto-stop after 5 seconds
});
`Configuration
$3
`typescript
interface SeasonalFXConfig {
// Required
target: HTMLElement;
// Automatic season detection
autoSeason?: boolean; // Default: true
// Manual season override
season?: Season;
// Season-specific config
seasonConfig?: {
winter?: { variant?: 'light' | 'holiday' | 'blizzard', intensity?: Intensity },
spring?: { variant?: 'sakura' | 'softPetals' | 'pollen', intensity?: Intensity },
// ...
};
// Effect intensity
intensity?: 'minimal' | 'subtle' | 'moderate' | 'bold'; // Default: 'subtle'
// Performance
maxFPS?: number; // Default: 30
// Accessibility & UX
disableOnMobile?: boolean; // Default: true
respectReducedMotion?: boolean; // Default: true
// Regional customization
regionalConfig?: RegionalSeasonConfig;
// Debug mode
debug?: boolean; // Default: false
}
`$3
- minimal: 10-15 particles, very subtle
- subtle: 30-40 particles, ambient (recommended)
- moderate: 60-80 particles, noticeable
- bold: 100+ particles, prominent
API Reference
$3
`javascript
const fx = createSeasonalFX(config);// Control
fx.start(); // Start effects
fx.pause(); // Pause (can resume)
fx.resume(); // Resume paused effects
fx.destroy(); // Clean up and remove
// Season control
fx.setSeason('winter', {
variant: 'blizzard',
intensity: 'moderate'
});
// Configuration
fx.updateConfig({
maxFPS: 60,
intensity: 'bold'
});
// Performance monitoring
const metrics = fx.getMetrics();
console.log(metrics.fps); // Current FPS
console.log(metrics.particleCount); // Active particles
console.log(metrics.renderTime); // Render time in ms
// State
fx.isRunning(); // true/false
`$3
`tsx
import { useSeasonalFX } from 'seasonalfx/react';function Component() {
const containerRef = useRef(null);
const fx = useSeasonalFX(containerRef, {
autoSeason: true,
intensity: 'subtle',
});
return (
);
}
`Accessibility
SeasonalFX is built with accessibility as a core principle:
- ā
Automatically respects
prefers-reduced-motion
- ā
Can be disabled on mobile devices
- ā
No layout shift or content obstruction
- ā
Pointer events disabled (non-interactive)
- ā
Optional static fallback mode$3
`javascript
// Check user preferences
import { prefersReducedMotion } from 'seasonalfx';if (!prefersReducedMotion()) {
fx.start();
}
// Or let the library handle it automatically
const fx = createSeasonalFX({
target: document.body,
respectReducedMotion: true, // Default: true
});
`Performance
SeasonalFX is optimized for production:
- š¦ Bundle Size: Core engine < 5KB gzipped
- ā” Rendering: Uses
requestAnimationFrame with FPS throttling
- šÆ Particle Limits: Intelligent caps per intensity level
- š Resource Management: Automatic cleanup on destroy
- š Monitoring: Built-in performance metrics$3
`javascript
// Limit FPS for better performance
createSeasonalFX({
target: document.body,
maxFPS: 30, // Default is 30, reduce further if needed
});// Use minimal intensity on mobile
createSeasonalFX({
target: document.body,
intensity: isMobileDevice() ? 'minimal' : 'subtle',
});
// Monitor performance
const metrics = fx.getMetrics();
if (metrics.fps < 20) {
fx.updateConfig({ intensity: 'minimal' });
}
`SSR Support
SeasonalFX is fully SSR-safe:
$3
`tsx
'use client'; // Mark as client componentimport { SeasonalFX } from 'seasonalfx/react';
export default function Page() {
return (
);
}
`$3
`astro
---
import { SeasonalFX } from 'seasonalfx/react';
---
`Regional Season Configuration
Customize season dates for different hemispheres:
`javascript
const southernHemisphereConfig = {
spring: [[9, 11]], // Sep - Nov
summer: [[12, 2]], // Dec - Feb
autumn: [[3, 5]], // Mar - May
winter: [[6, 8]], // Jun - Aug
};createSeasonalFX({
target: document.body,
autoSeason: true,
regionalConfig: southernHemisphereConfig,
});
`Examples
$3
`javascript
const fx = createSeasonalFX({
target: document.getElementById('hero'),
season: 'event',
seasonConfig: {
event: {
variant: 'launch',
duration: 5000, // Auto-stop after 5 seconds
}
}
});fx.start(); // Confetti bursts and auto-stops
`$3
`javascript
const seasons = ['winter', 'spring', 'summer', 'autumn'];seasons.forEach(season => {
document.getElementById(
btn-${season}).addEventListener('click', () => {
fx.setSeason(season);
});
});
`$3
`javascript
setInterval(() => {
const metrics = fx.getMetrics();
document.getElementById('fps').textContent = metrics.fps;
document.getElementById('particles').textContent = metrics.particleCount;
document.getElementById('render-time').textContent = metrics.renderTime.toFixed(2);
}, 1000);
`Browser Support
- ā
Chrome/Edge (latest)
- ā
Firefox (latest)
- ā
Safari (latest)
- ā
Mobile browsers
Requires modern browser with:
- Canvas API
-
requestAnimationFrame`MIT Ā© Nishikanta Ray
Contributions are welcome! Please feel free to submit a Pull Request.
- Contributing Guidelines
- Code of Conduct
- š Live Demo: seasonalfx.nishikanta.in
- š Documentation: seasonalfx.nishikanta.in/docs.html
- š® Interactive Demo: seasonalfx.nishikanta.in/demo
- š¦ NPM Package: npmjs.com/package/seasonalfx
- š» GitHub: github.com/NishikantaRay/seasonalfx
- š Issue Tracker: github.com/NishikantaRay/seasonalfx/issues
- š¬ Discussions: github.com/NishikantaRay/seasonalfx/discussions
- š¤ Author: nishikanta.in
---
Made with ā¤ļø by Nishikanta Ray