ddmt-tool/Tool/animate.js
2024-09-29 21:04:06 +08:00

22 lines
574 B
JavaScript

/*
* @Author: ddmt
* @Date: 2024-9-29 20:50:12
* @LastEditTime: 2024-9-29 20:50:12
* @LastEditors: ddmt
* @Description: ddmt-index file
* @FilePath: /Tool/animate.js
*/
/**
* 动画函数
* @param {HTMLElement} event
* @param {string} classname
*/
export function animateStart(event, className, forceExecute) {
if (forceExecute) event.target.classList.remove(className); // 清洗动画
event.classList.add(className);
event.addEventListener('animationend', (event) => {
event.target.classList.remove(className); // 清洗动画
});
}