diff --git a/src/atoms/IconGlobe.svelte b/src/atoms/IconGlobe.svelte index c49f874..0eab929 100644 --- a/src/atoms/IconGlobe.svelte +++ b/src/atoms/IconGlobe.svelte @@ -1,6 +1,6 @@ import { stores } from '@sapper/app' - import * as fn from '../utils/functions' + import { randomString } from '../utils/functions' const { page } = stores() // Props @@ -9,7 +9,7 @@ export let animated = false // Generate a random ID for the mask - const randomId = fn.randomString(6, 'A') + const randomId = randomString(6, 'A') - import * as fn from '../utils/functions' - export let href = '/' export let text = '' export let target = null diff --git a/src/atoms/TitleSite.svelte b/src/atoms/TitleSite.svelte index 1578ab6..8ed73bc 100644 --- a/src/atoms/TitleSite.svelte +++ b/src/atoms/TitleSite.svelte @@ -1,11 +1,11 @@ - {@html fn.lettersToSpan('Houses')} + {@html lettersToSpan('Houses')} @@ -13,7 +13,7 @@ - {@html fn.lettersToSpan('World')} + {@html lettersToSpan('World')} diff --git a/src/molecules/Photo.svelte b/src/molecules/Photo.svelte index 1ce212a..24acc34 100644 --- a/src/molecules/Photo.svelte +++ b/src/molecules/Photo.svelte @@ -3,13 +3,10 @@ import { fly } from 'svelte/transition' import { quartOut } from 'svelte/easing' import { site, currentLocation } from '../utils/store' - import * as fn from '../utils/functions' // Dependencies import * as basicScroll from 'basicscroll' - import dayjs from 'dayjs' - import advancedFormat from 'dayjs/plugin/advancedFormat' - dayjs.extend(advancedFormat) + import { getThumbnail, formatDate } from '../utils/functions' // Props and variables export let photo @@ -66,28 +63,28 @@ {#if layout === 'list'} - - - - + + + + {:else} - - - - - + + + + + {/if} - - {dayjs(photo.date).format('MMM Do, YYYY')} + + {formatDate(photo.date, 'FULL')} {(index < 10 ? '0': '') + index} diff --git a/src/organisms/Carousel.svelte b/src/organisms/Carousel.svelte index 8fe8000..986fff8 100644 --- a/src/organisms/Carousel.svelte +++ b/src/organisms/Carousel.svelte @@ -2,15 +2,10 @@ import { onMount, createEventDispatcher } from 'svelte' import { stores } from '@sapper/app' import { currentLocation } from '../utils/store' - import * as fn from '../utils/functions' + import { getThumbnail, formatDate } from '../utils/functions' const dispatch = createEventDispatcher() const { page } = stores() - // Dependencies - import dayjs from 'dayjs' - import advancedFormat from 'dayjs/plugin/advancedFormat' - dayjs.extend(advancedFormat) - // Components import IconArrow from '../atoms/IconArrow' @@ -147,11 +142,11 @@ class:gallery__photo--active={photo === currentPhoto} class:gallery__photo--next={photo === nextPhoto} > - - - - - + + + + + {/each} @@ -201,7 +196,7 @@ {/each} {#if viewer} - {dayjs(currentPhoto.created_on).format('MMM Do, YYYY')} + {formatDate(currentPhoto.date, 'FULL')} {/if} diff --git a/src/organisms/Locations.svelte b/src/organisms/Locations.svelte index 27cc691..ffbdffa 100644 --- a/src/organisms/Locations.svelte +++ b/src/organisms/Locations.svelte @@ -3,10 +3,10 @@ import { flip } from 'svelte/animate' import { crossfadeReceive, crossfadeSend } from '../utils/animations' import { locations, countries, continents } from '../utils/store' - import * as fn from '../utils/functions' // Dependencies import AOS from 'aos' + import { throttle } from '../utils/functions' // Components import Button from '../atoms/Button' @@ -25,7 +25,7 @@ // Filter by continent // Detects if click difference if too short with a throttled function - const toggleContinents = fn.throttle((event, continent) => { + const toggleContinents = throttle((event, continent) => { continentsFiltered = (!continent) ? [...continentsToDisplay] : [continent] }, transitionDuration) diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 072420f..c999e76 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -19,7 +19,7 @@
{dayjs(currentPhoto.created_on).format('MMM Do, YYYY')}
{formatDate(currentPhoto.date, 'FULL')}