A professional monorepo containing the react-season-effects library and demo applications.
This Turborepo includes:
react-season-effects- The main npm package with seasonal visual effects
demo- Next.js demo application showcasing all effects
npm installRun all packages in development mode:
npm run devThis will start:
- The demo Next.js app at
http://localhost:3000 - The library in watch mode for hot reloading
Build all packages:
npm run buildBuild specific package:
cd packages/react-season-effects
npm run buildreact-season-effects/
βββ apps/
β βββ demo/ # Next.js demo application
β βββ src/
β β βββ app/
β β βββ page.tsx
β β βββ layout.tsx
β βββ package.json
β βββ next.config.js
βββ packages/
β βββ react-season-effects/ # Main library
β βββ src/
β β βββ effects/
β β β βββ Snow.tsx
β β β βββ Autumn.tsx
β β βββ core/
β β β βββ CanvasRenderer.ts
β β β βββ useAnimationLoop.ts
β β β βββ useResize.ts
β β βββ SeasonEffect.tsx
β β βββ types.ts
β β βββ index.ts
β βββ package.json
β βββ tsconfig.json
β βββ README.md
βββ package.json
βββ turbo.json
βββ README.md
- β Winter (Snowfall) - Fully implemented
- β Autumn (Falling Leaves) - Fully implemented
- π Spring (Cherry Blossoms) - Coming in v1.1
- π Monsoon (Rain) - Coming in v1.1
- π Summer (Heat Waves) - Coming in v2.0
- Build System: Turborepo
- Language: TypeScript
- Bundler: tsup (for library)
- Framework: React 18, Next.js 14
- Rendering: HTML Canvas API
- Animation: requestAnimationFrame
See the package README for detailed usage instructions.
Quick example:
import { SeasonEffect } from 'react-season-effects';
function App() {
return (
<>
<h1>My App</h1>
<SeasonEffect type="winter" intensity={80} speed="medium" />
</>
);
}-
Install dependencies:
npm install
-
Run the demo:
npm run dev
-
Open
http://localhost:3000in your browser -
Use the controls to:
- Switch between seasons
- Adjust intensity and speed
- Pause/play animations
To publish react-season-effects to npm:
-
Build the package:
cd packages/react-season-effects npm run build -
Login to npm:
npm login
-
Publish:
npm publish
- Performance: Canvas rendering is much faster than DOM manipulation for particle effects
- Smooth animations: Direct pixel manipulation allows for 60fps animations
- Lower memory: No need to create hundreds of DOM elements
- Efficient builds: Only rebuilds what changed
- Parallel execution: Runs tasks across packages simultaneously
- Easy scaling: Simple to add more apps or packages
All effects check for window existence and return null on the server, making them safe for Next.js SSR.
Contributions are welcome! Please feel free to submit issues or pull requests.
- Create effect component in
packages/react-season-effects/src/effects/ - Add props interface
- Update
SeasonEffect.tsxto include the new season - Update type definitions in
types.ts - Add demo to the demo app
MIT
Built with β€οΈ for the React community
Happy Coding! βοΈππΈβοΈπ§οΈ