With snowflakeJS you can easily let it snow on your webpage. There is no need for special css or canvas, just pure javascript.
If you check it out from this repository please run "yarn install" to install all necessary dependencies. After that you can run "yarn build" to create a production bundle or "yarn start" to launch a webservice on port 8080 and see snowflakeJS in action.
Incluse the snowflake.min.js (located in dist folder) file in your webpage. After that you can use it like follow:
<script type="text/javascript" src="snowflake.min.js"></script></head>
const snowflake = new SnowflakeJs(25,250,5000,5,25);
snowflake.init();
Currently it comes as umd definition.
It comes as es6 module. You can simply import it to your project.
import {SnowflakeJs} from "@aicdev/snowflakejs";
const snowflake = new SnowflakeJs();
snowflake.init();
Parameters in detail:
- 25 = FPS
- 250 = inital count of snowflakes
- 5000 = lifetime in ms
- 5 = max fall speed
- 25 = max size of snowflake
LET IT SNOW.