Winter Snow Animation In Pure JavaScript – snowflakeJS

Category: Animation , Javascript | August 23, 2019
Views Total:7,018 views
Official Page:Go to website
Last Update:August 23, 2019


Winter Snow Animation In Pure JavaScript – snowflakeJS


snowflakeJS is a standalone JavaScript library to create an animated snow falling effect that uses an SVG image for the snowflakes.

How to use it:

Install and download the snowflakeJS.

$ npm install @aicdev/snowflakejs --save

Import the snowflakeJS as an ES module.

import {SnowflakeJs} from "@aicdev/snowflakejs";

Or include the umd version in the document.

<script src="snowflake.min.js"></script>

Create a new SnowflakeJs instance pass the following parameters:

  • frames: FPS
  • count: the number of snowflakes
  • lifetime: lifetime in ms
  • maxSpeed: max speed
  • maxSize: max size
const snowflake = new SnowflakeJs(frames=25, count=50, lifetime=5000, maxSpeed=4, maxSize=15);

Start the snow falling effect.


You Might Be Interested In:

Leave a Reply