├── .babelrc
├── .editorconfig
├── .gitignore
├── .travis.yml
├── README.md
├── docs
└── index.js
├── package.json
├── rollup.config.js
├── src
├── index.js
└── test.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["env", { "modules": false }], "stage-0", "react"]
3 | }
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 |
6 | # builds
7 | build
8 | dist
9 | site
10 | .rpt2_cache
11 |
12 | # misc
13 | .DS_Store
14 | .env
15 | .env.local
16 | .env.development.local
17 | .env.test.local
18 | .env.production.local
19 |
20 | npm-debug.log*
21 | yarn-debug.log*
22 | yarn-error.log*
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 9
4 | - 8
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # resnow ❄️
2 |
3 | > React component for snow on your webpage ☃️
4 |
5 | [](https://www.npmjs.com/package/resnow) [](https://travis-ci.org/lachlanjc/resnow)
6 |
7 | - Used on/extracted from [Hack Club Secret Santa](https://hackclub.com/santa)
8 | - Code heavily inspired by [`react-snow-effect`](https://github.com/jungledre/react-snow-effect), but updated for React 16, supports server-rendering, & offers more options
9 | - Bootstrapped with [`create-react-library`](https://www.npmjs.com/package/create-react-library)
10 |
11 | ## Install
12 |
13 | ```bash
14 | npm install --save resnow
15 | yarn add resnow
16 | ```
17 |
18 | ## Usage
19 |
20 | Requires React 16.3 or later.
21 |
22 | ```jsx
23 | import React from 'react'
24 | import Snow from 'resnow'
25 |
26 | export default () => (
27 |
28 |
29 |
30 | )
31 | ```
32 |
33 | | Prop | Effect |
34 | | ---------------- | ------------------------------------------------------------------- |
35 | | `max` | Number of particles. Default: `32` |
36 | | `speed` | Speed of particles, in ms. Default: `32` |
37 | | `color` | Color of particles. Default: `rgba(255, 255, 255, 0.75)` |
38 | | `width`/`height` | Size of `