mirror of
https://github.com/animate-css/animate.css.git
synced 2024-11-11 05:46:32 +01:00
19 lines
509 B
JavaScript
19 lines
509 B
JavaScript
|
/**
|
||
|
Slows animations
|
||
|
*/
|
||
|
|
||
|
const slowDownAnimations = (target) => {
|
||
|
const targetEl = document.querySelector(target)
|
||
|
const doc = document.documentElement
|
||
|
|
||
|
targetEl.addEventListener('click', () => {
|
||
|
const currentDuration = getComputedStyle(document.documentElement)
|
||
|
.getPropertyValue('--animate-duration')
|
||
|
const newDuration = currentDuration === '1s' ? '2s' : '1s'
|
||
|
|
||
|
document.documentElement.style.setProperty('--animate-duration', newDuration);
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export default slowDownAnimations
|