Skip to content

Commit

Permalink
Merge branch 'main' of github.com:scottbedard/gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbedard committed Jun 15, 2022
2 parents 27bed90 + 5e0edd4 commit d5b2da7
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# Gradient
# `@bedard/gradient`

Docs coming soon... Or never.
A customizable version of the background animation used by Stripe.com

[Click here for a live example](https://gradient.scottbedard.net)

### Basic usage

Install the script using the CDN

```html
<script src="https://unpkg.com/@bedard/gradient"></script>
```

Or via NPM

```bash
npm install @bedard/gradient
```

Then instantiate an instance with reference to a canvas

```js
const canvas = document.querySelector('canvas')

new Gradient(canvas, {
colors: ['#ffffff', '#f87171', '#f9a8d4', '#fef08a'],
seed: Math.random(),
})
```

The animation can be started / stopped using the `play` and `pause` methods.

0 comments on commit d5b2da7

Please sign in to comment.