40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
// Svelte
|
|
import { writable } from 'svelte/store'
|
|
|
|
// Define environment
|
|
export const dev = process.env.NODE_ENV === 'development'
|
|
|
|
|
|
/* ==========================================================================
|
|
Site related
|
|
========================================================================== */
|
|
const apiEndpoint = dev ? 'http://api.housesof.localhost/how' : 'https://api.housesof.world/_'
|
|
const apiAccessToken = 'NJk0urljsdSvApUDzWxGgoO6'
|
|
export const apiEndpoints = {
|
|
gql: `${apiEndpoint}/gql?access_token=${apiAccessToken}`,
|
|
rest: apiEndpoint
|
|
}
|
|
|
|
// Data
|
|
export let site = writable()
|
|
export let continents = writable()
|
|
export let countries = writable()
|
|
export let locations = writable()
|
|
|
|
// Derived data
|
|
export let currentLocation = writable()
|
|
export let currentPhotos = writable()
|
|
|
|
// State
|
|
export let pageReady = writable(false)
|
|
export const pageTransition = {
|
|
onAnimationEnd () {}
|
|
}
|
|
|
|
|
|
/* ==========================================================================
|
|
Animation related
|
|
========================================================================== */
|
|
export const animDuration = 1400
|
|
export const animDurationLong = 1800
|