Skip to content

Commit d5b2da7

Browse files
committed
Merge branch 'main' of github.com:scottbedard/gradient
2 parents 27bed90 + 5e0edd4 commit d5b2da7

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1-
# Gradient
1+
# `@bedard/gradient`
22

3-
Docs coming soon... Or never.
3+
A customizable version of the background animation used by Stripe.com
4+
5+
[Click here for a live example](https://gradient.scottbedard.net)
6+
7+
### Basic usage
8+
9+
Install the script using the CDN
10+
11+
```html
12+
<script src="https://unpkg.com/@bedard/gradient"></script>
13+
```
14+
15+
Or via NPM
16+
17+
```bash
18+
npm install @bedard/gradient
19+
```
20+
21+
Then instantiate an instance with reference to a canvas
22+
23+
```js
24+
const canvas = document.querySelector('canvas')
25+
26+
new Gradient(canvas, {
27+
colors: ['#ffffff', '#f87171', '#f9a8d4', '#fef08a'],
28+
seed: Math.random(),
29+
})
30+
```
31+
32+
The animation can be started / stopped using the `play` and `pause` methods.

0 commit comments

Comments
 (0)