1.0.5 • Published 6 years ago

snowfall-animation v1.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

snowfall-animation

A simple snowfall animation

Install

npm install snowfall-animation
yarn add snowfall-animation

Usage

HTML

<html>
  <body>
    <canvas id='canvas'></canvas>
  </body>
</html>

CSS

#canvas {
  width: 300px;  
  height: 500px;
  background: #000;
  /* pointer-events: none; */
}

Javascript

import Snowfall from 'snowfall-animation'

window.onload = function() {
  const configs = {
    element: '#canvas',   // required "canvas element" 
    number: 30,           // optional "snowflakes: 1-1000, default: 30"
    speed: 3,             // optional "speed: 1-10, default: 3"
    radius: 4,            // optional "radius: 1-10, default: 4"
  }
  const snowfall = new Snowfall(configs)
  snowfall.init();
}

MIT Licensed

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago