New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

snoweb

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snoweb

Falling snowflakes for your website and christmas mood ❄️

latest
Source
npmnpm
Version
1.0.12
Version published
Maintainers
1
Created
Source

snoweb

Falling snowflakes for your website and christmas mood ❄️

Why snoweb?

  • Everyone loves snow
  • Zero config although you can pass some configuration
  • Easy to use

Quick start

Step 1: Install

npm install snoweb --save

or

yarn add snoweb

Step 2: Import and use

import { Snoweb } from 'snoweb';

const snoweb = new Snoweb();
snoweb.start();

Step 3: Enjoy

snowfall

Tips

Tip 1: Configure your snowfall

You can provide configuration object Partal<SnowebConfig> into the constructor. See the description in the API section

const snoweb = new Snoweb({
  gravity: 20,
  snowflakesColor: 'red',
  snowflakesCount: 200,
  zIndex: 1000,
});

Tip 2: Smooth stop + destroy

By default snoweb.stop() method just smoothly stops the snowfall animation. However, the DOM element still remains. If you want to stop and fully destroy it you can do the following:

const snoweb = new Snoweb();
snoweb.start();
// ...
snoweb.stop(() => snoweb.destroy());

API

Snoweb

MethodsWhat it does?
constructor(config: Partial<SnowebConfig>)Default constructor which is executed after you have called new Snoweb().
start(): voidBegins the snowfall. Ho-ho-ho 🎅
stop(afterStopCallback?: () => void): voidStops the snowfall. afterStopCallback?: () => void - a callback function which is called after the snowfall is fully stopped (all the snowflakes have fallen).
destroy(): voidStops the snowfall immediately and destroys the DOM element
isStarted(): booleanShows whether the snowfall is being started

SnowebConfig

PropertyWhat it does?Default value
snowflakesCount: numberExact count of the snowflakes to be rendered. Might affect performance if the value is too big.100
gravity: numberThe higher the value the faster the snowflakes will fall10
snowflakesColor: stringCSS color of the snowflakes'#fff'
zIndex: numberSnowfall z-index1000000

Check it out on Stackblitz

https://stackblitz.com/edit/snoweb?file=index.js

Keywords

snow

FAQs

Package last updated on 15 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts