click wave effect with CSS animation.
npm install wave-effect
yarn add wave-effect
import wave,{ clearEffect } from 'wave-effect'
import 'wave-effect/dist/wave.css'
const button = document.getElementById("button")
wave(button)
// clear effect
clearEffect(button)
wave(element: Element, options?: WaveOptions)
WaveOptions
interface WaveOptions {
// current wave effect color
waveColor?: string
// if element includes these className, click doesn't trigger effect
disabledClass?: string[]
}
you can override less variables to customize style.
@import "~wave-effect/src/wave.less";
@wave-color: red;
@wave-animation-width: 20px;
or use css variables.
:root {
--wave-shadow-color: red;
--wave-animation-width: 20px;
}
MIT