0.0.1-beta.2

This commit is contained in:
2024-09-30 00:13:36 +08:00
parent db37b9b06c
commit 3c3311f80f
4 changed files with 107 additions and 14 deletions

View File

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