Skip to content

Explosion-Scratch/ripple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Ripple

Material design ripple effect.

How to use

Import from a CDN:

<script src="https://cdn.jsdelivr.net/gh/explosion-scratch/ripple/ripple.js">

Then use it like this:

<button data-ripple>Test</button>

Then call ripple():

ripple();

Options:

You can also use other attributes to change the way the rippl effect looks:

Attribute What it does Default
data-ripple Turns on the ripple effect -
data-time The time in milliseconds that the ripple effect takes. 500
data-color The color of the ripple. currentColor
data-opacity The opacity of the ripple effect. .3
data-event The event to ripple on. mousedown