// import anime from 'animejs'
import { crossfade } from 'svelte/transition'
import { quartOut } from 'svelte/easing'


// Crossfade transition
export const [crossfadeSend, crossfadeReceive] = crossfade({
    duration: d => Math.sqrt(d * 200),

    fallback(node, params) {
        const style = getComputedStyle(node)
        const transform = style.transform === 'none' ? '' : style.transform

        return {
            duration: 600,
            easing: quartOut,
            css: t => `
					transform: ${transform} scale(${t});
					opacity: ${t}
				`
        }
    }
})
