MCPcopy
hub / github.com/MagicMirrorOrg/MagicMirror / addAnimateCSS

Function addAnimateCSS

js/animateCSS.js:131–141  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

129 * @param {number} [animationTime] animation duration.
130 */
131function 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

Callers 2

_hideModuleFunction · 0.85
_showModuleFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected