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