0.1.3 • Published 2 years ago

@bedard/gradient v0.1.3

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

@bedard/gradient

A customizable version of the background animation used by Stripe.com

Click here for a live example

Basic usage

Install the script using the CDN

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

Or via NPM

npm install @bedard/gradient

Then instantiate an instance with reference to a canvas

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.