Make it snow on your web site.
- Snow cumulates at the bottom of the screen
- Customizable: from a light snow to a blizzard
- Dynamically controllable: start new snow falls and stop them
- Don't mess with the DOM: only one canvas is added
- Light and with no dependency
Import the script:
<script src=snow.js></script> Then call the start function:
snow.start(); or with some parameters:
snow.start({ flakeCount: 4000, stickingRatio: 0.55, wind: -7 }); You can ask the snow to gently stop:
snow.stop(); flakeCount: number of flakes. Default:400maxRadius: max radius of flakes. Default:1.7wind: wind speed, can be positive (towards the right) or negative. Default:0. Reasonnable winds are lower than20.color: snow color. Default:#ddfminSpeed: vertical minimal speed. Default:1maxSpeed: vertical maximal speed. Default:4.2stickingRatio: how much the snow sticks to the ground. Default:.4maxHeightRatio: at what part of the screen height does snow stop accumulating. Default:.25
npm i Canop/snow
Copyright (c) 2016 Denys Séguret <http://dystroy.org/>