- - {name} + {location.name}
- - {country.name} + {location.country.name}
-
+ {#each filteredLocations as location (location)}
+
-
+
+
{/each}
-
diff --git a/src/animations/crossfade.ts b/src/animations/crossfade.ts new file mode 100644 index 0000000..b110bf9 --- /dev/null +++ b/src/animations/crossfade.ts @@ -0,0 +1,26 @@ +import { crossfade } from 'svelte/transition' +import { quartOut } from 'svelte/easing' + +// Crossfade transition +export const [send, receive] = crossfade({ + // duration: 1200, + duration: d => Math.sqrt(d * 200), + fallback (node, params) { + const { + duration = 600, + easing = quartOut, + start = 0.85 + } = params + const style = getComputedStyle(node) + const transform = style.transform === 'none' ? '' : style.transform + const sd = 1 - start + return { + duration, + easing, + css: (t, u) => ` + transform: ${transform} scale(${1 - (sd * u)}); + opacity: ${t} + ` + } + } +}) \ No newline at end of file diff --git a/src/components/molecules/Location.svelte b/src/components/molecules/Location.svelte index 9fdb512..fda8b23 100644 --- a/src/components/molecules/Location.svelte +++ b/src/components/molecules/Location.svelte @@ -10,11 +10,10 @@ export let location: any const { settings: { limit_new }}: any = getContext('global') - const { name, slug, country, date_updated } = location // Location date limit const dateNowOffset = dayjs().subtract(limit_new, 'day') - const dateLocationUpdated = dayjs(date_updated) + const dateLocationUpdated = dayjs(location.date_updated) const isNew = dateLocationUpdated.isAfter(dateNowOffset) let locationEl: HTMLElement @@ -51,19 +50,19 @@