diff --git a/src/animations.js b/src/animations.js index dcc629e..a61dfec 100644 --- a/src/animations.js +++ b/src/animations.js @@ -1,2 +1,23 @@ // 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} + ` + } + } +}) diff --git a/src/molecules/Location.svelte b/src/molecules/Location.svelte index 87f2aca..c4ad539 100644 --- a/src/molecules/Location.svelte +++ b/src/molecules/Location.svelte @@ -1,15 +1,16 @@ -