Skip to content

About

Canvas-based seasonal effects library for React & Next.js. SSR-safe, TypeScript-ready, zero dependencies. Built with Turborepo.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 React Season Effects - Monorepo

A professional monorepo containing the react-season-effects library and demo applications.

πŸ“¦ What's Inside?

This Turborepo includes:

Packages

  • react-season-effects - The main npm package with seasonal visual effects

Apps

  • demo - Next.js demo application showcasing all effects

πŸš€ Getting Started

Installation

npm install

Development

Run all packages in development mode:

npm run dev

This will start:

  • The demo Next.js app at http://localhost:3000
  • The library in watch mode for hot reloading

Building

Build all packages:

npm run build

Build specific package:

cd packages/react-season-effects
npm run build

πŸ“ Project Structure

react-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

🎯 Features

  • βœ… 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

πŸ›  Technology Stack

  • Build System: Turborepo
  • Language: TypeScript
  • Bundler: tsup (for library)
  • Framework: React 18, Next.js 14
  • Rendering: HTML Canvas API
  • Animation: requestAnimationFrame

πŸ“ Usage

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" />
    </>
  );
}

πŸ§ͺ Testing the Demo

  1. Install dependencies:

    npm install
  2. Run the demo:

    npm run dev
  3. Open http://localhost:3000 in your browser

  4. Use the controls to:

    • Switch between seasons
    • Adjust intensity and speed
    • Pause/play animations

πŸ“¦ Publishing the Package

To publish react-season-effects to npm:

  1. Build the package:

    cd packages/react-season-effects
    npm run build
  2. Login to npm:

    npm login
  3. Publish:

    npm publish

πŸ— Architecture Decisions

Why Canvas?

  • 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

Why Turborepo?

  • Efficient builds: Only rebuilds what changed
  • Parallel execution: Runs tasks across packages simultaneously
  • Easy scaling: Simple to add more apps or packages

SSR Safety

All effects check for window existence and return null on the server, making them safe for Next.js SSR.

🀝 Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Adding a New Season Effect

  1. Create effect component in packages/react-season-effects/src/effects/
  2. Add props interface
  3. Update SeasonEffect.tsx to include the new season
  4. Update type definitions in types.ts
  5. Add demo to the demo app

πŸ“„ License

MIT

πŸ™ Credits

Built with ❀️ for the React community


Happy Coding! β„οΈπŸπŸŒΈβ˜€οΈπŸŒ§οΈ

About

Canvas-based seasonal effects library for React & Next.js. SSR-safe, TypeScript-ready, zero dependencies. Built with Turborepo.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages