I want to chain multiple transforms to achieve an animation effect.
The transforms are in 3 parts:
I tried to just list the translations in order, but it is not working:
const openingAnimation = "rotate-0 translate-x-0.5 delay-300 duration-300 rotate-45 translate-x-0"
const initialRotation = "-rotate-45"'
<div className={`absolute h-px w-3 bg-white text-white last:ml-2
transform ease-in-out duration-300
${toggled ? openingAnimation : initialRotation}`}
/>
Do I have to do it with Javascript and a timeout function that will add the third animation?