* Create an animation with Animate CSS * @param {string} [element] div element to animate. * @param {string} [animation] animation name. * @param {number} [animationTime] animation duration.
(element, animation, animationTime)
| 129 | * @param {number} [animationTime] animation duration. |
| 130 | */ |
| 131 | function addAnimateCSS (element, animation, animationTime) { |
| 132 | const animationName = `animate__${animation}`; |
| 133 | const node = document.getElementById(element); |
| 134 | if (!node) { |
| 135 | // don't execute animate: we don't find div |
| 136 | Log.warn("node not found for adding", element); |
| 137 | return; |
| 138 | } |
| 139 | node.style.setProperty("--animate-duration", `${animationTime}s`); |
| 140 | node.classList.add("animate__animated", animationName); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Remove an animation with Animate CSS |
no test coverage detected