Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diogo405/snowjs
A javascript tiny lib (2kb) to make snow
https://github.com/diogo405/snowjs
snow
Last synced: about 1 month ago
JSON representation
A javascript tiny lib (2kb) to make snow
- Host: GitHub
- URL: https://github.com/diogo405/snowjs
- Owner: diogo405
- Created: 2018-12-13T04:46:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T18:42:29.000Z (about 2 years ago)
- Last Synced: 2023-03-22T16:56:18.464Z (almost 2 years ago)
- Topics: snow
- Language: JavaScript
- Homepage:
- Size: 709 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snow JS
A JS lib (2kb) to make snow ❄️
![Snow JS dog](https://github.com/diogo405/snowjs/blob/master/dog.png?raw=true)
## How to use or make it snow then?
All you need to do is put the script in your page (that one from dist folder) and call the fall method:
```
.
.
.
new Snow().fall();
```
## Customisations ⛄️
The Snow class accepts a json object as a param so you can set your options. Here are the default values:
```
this.default = {
quantity: 5, // Quantity of snowflake to be dropped every cycle
minSize: 2, // Minimum size of the snowflake (px)
maxSize: 4, // Maximum size of the snowflake (px)
color: 'white', // Snowflake color
speed: '4s', // Transition time for the snowflake fall
};
```## Examples
Default
```
new Snow().fall();
```Canada
```
new Snow({
quantity: 15,
speed: '2s',
}).fall();
```Antarctica
```
new Snow({
quantity: 30,
speed: '1s',
color: 'lightgrey',
minSize: 1,
maxSize: 5,
}).fall();
```Fukushima
```
new Snow({
quantity: 20,
speed: '2s',
color: 'yellow',
minSize: 5,
maxSize: 10,
}).fall();
```## License
This project is licensed under the MIT License️