Giter VIP home page Giter VIP logo

snow's Introduction

snow

Make it snow on your web site.

Live Demonstration

  • 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

Chat on Miaou Chat on Miaou

Usage

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();

Options

  • flakeCount: number of flakes. Default: 400
  • maxRadius: max radius of flakes. Default: 1.7
  • wind: wind speed, can be positive (towards the right) or negative. Default: 0. Reasonnable winds are lower than 20.
  • color: snow color. Default: #ddf
  • minSpeed: vertical minimal speed. Default: 1
  • maxSpeed: vertical maximal speed. Default: 4.2
  • stickingRatio: how much the snow sticks to the ground. Default: .4
  • maxHeightRatio: at what part of the screen height does snow stop accumulating. Default: .25

Install with npm

npm i Canop/snow

License

MIT

Copyright (c) 2016 Denys Séguret <http://dystroy.org/>

snow's People

Contributors

canop avatar grossacasac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.