I'm having a problem wherein I want to animated my text but I want to pass a module of javascript which is THIS. There is a link of how I can add this in js but I cannot call the module of the link here is my code sample
For the outside of function
function AnimationLibrary(url){
const script = document.createElement('script');
script.src = url;
script.async = true;
console.log(url)
document.body.appendChild(script);
}
// This is for text color animation css
useEffect(() => {
var textWrapper = document.querySelector('.introduction .text h4');
textWrapper.innerHTML = textWrapper.textContent.replace(/\S/g, "<span class='letter'>$&</span>");
anime.timeline({loop: true})
.add({
targets: '.ml2 .letter',
scale: [4,1],
opacity: [0,1],
translateZ: 0,
easing: "easeOutExpo",
duration: 950,
delay: (el, i) => 70*i
}).add({
targets: '.ml2',
opacity: 0,
duration: 1000,
easing: "easeOutExpo",
delay: 1000
});
},[])
And the return in function
return (
{AnimationLibrary(
"https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"
)}
)
Yes I can see the link in my console.log but the problem is I cannot get the module of the link of the link that I give in first line.. Anyway this is my source of how I can get the external link THIS Any idea how can I get the modules of the link for animating my letters in react hooks? It would be a big help to me thank you.
EDITED SSOMEONE PLEASE HELP ME HERE I"M STUCK I DON"T KNOW HOW TO DO IT