add fade-in and fade-out animations when navigating routes (using solid-routes)
o/ is there any way to add some sort of fade-in and fade-out animations when navigating between routes? this is what i basically have at the moment
import {Component, createSignal} from "solid-js";
export default function FadeIn(component: Component, props?: { duration?: number }) {
const [opacity, setOpacity] = createSignal(0.1);
const timer = setInterval(function () {
if (opacity() >= 1) {
clearInterval(timer);
}
setOpacity(opacity() + opacity() * 0.1)
}, (props?.duration || 0.5) / 0.1);
return (
<div style={{opacity: opacity()}}>
{component({})}
</div>
)
}