JSFiddle - React, Tailwind, and code Playground
by the94air
CSS
path.sparkle{
fill: white;
}
path:not(.sparkle){
transition: fill 100ms;
}
JavaScript
let paths = logo.querySelectorAll("path");
let theChosenOne = paths[Math.floor(Math.random(paths.length)]
theChosenOne.classList.add(‘sparkle’)
setTimeout(()=>{theChosenOne.classList.remove(‘sparkle’)},100)