1.0.4 • Published 4 years ago

xn-snowflakes v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

xn-snowflakes

Add beautiful falling down snowflakes to any of the elements container (or fullscreen) in your webpage.

Complete JavaScript / TypeScript support.

Demo

Demo on stackblitz

Installation

Add npm package

npm i xn-snowflakes

Import package into your code

// ES6 style
import { Snowflakes } from 'xn-snowflakes';

// commonjs style
const Snowflakes = require('xn-snowflakes');

Usage

// add snowflakes to the whole webpage
const snowFull = new Snowflakes();

// start fullscreen snow fall
snowFull.start();

// stop fullscreen snow fall
snowFull.pause();


// add snowflakes to a container with extra customisations
const target = document.getElementById('mydiv');
const snow = new Snowflakes(target);

// change snowflake color (default #ffffff)
snow.color = '#bfeaff';

// change snow volumn to make it a storm (default 300)
snow.count = 1000;

// start the snow fall
snow.start();

// stop the snow fall
snow.pause();
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