Create Locations page
This commit is contained in:
67
src/routes/locations.svelte
Normal file
67
src/routes/locations.svelte
Normal file
@@ -0,0 +1,67 @@
|
||||
<script lang="ts">
|
||||
import { getContext } from 'svelte'
|
||||
// Components
|
||||
import Metas from '$components/Metas.svelte'
|
||||
import InteractiveGlobe from '$components/organisms/InteractiveGlobe.svelte'
|
||||
import Locations from '$components/organisms/Locations.svelte'
|
||||
import Shop from '$components/organisms/Shop.svelte'
|
||||
import Newsletter from '$components/organisms/Newsletter.svelte'
|
||||
|
||||
export let photos: any
|
||||
|
||||
const { location }: any = getContext('global')
|
||||
</script>
|
||||
|
||||
<Metas
|
||||
title="Locations"
|
||||
description=""
|
||||
image=""
|
||||
/>
|
||||
|
||||
<main class="explore">
|
||||
<section class="explore__intro">
|
||||
<h1 class="title-huge">Houses</h1>
|
||||
<p class="text-medium">Explore the globe to discover unique locations across the world</p>
|
||||
</section>
|
||||
|
||||
<section class="explore__locations" id="locations">
|
||||
<InteractiveGlobe />
|
||||
|
||||
<Locations
|
||||
locations={location}
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="grid-modules grid">
|
||||
<div class="wrap">
|
||||
<Shop />
|
||||
<Newsletter />
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
|
||||
<script context="module" lang="ts">
|
||||
import { fetchAPI } from '$utils/api'
|
||||
|
||||
export async function load ({ page, session, fetch, context }) {
|
||||
const res = await fetchAPI(`
|
||||
query {
|
||||
photo (limit: 11, sort: ["-date_created"]) {
|
||||
image {
|
||||
id
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
const { data } = res
|
||||
|
||||
return {
|
||||
props: {
|
||||
photos: data.photo,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
49
src/style/pages/_explore.scss
Normal file
49
src/style/pages/_explore.scss
Normal file
@@ -0,0 +1,49 @@
|
||||
// Explore Page
|
||||
.explore {
|
||||
// Intro Section
|
||||
&__intro {
|
||||
overflow: hidden;
|
||||
margin-bottom: 72px;
|
||||
color: $color-tertiary;
|
||||
text-align: center;
|
||||
|
||||
// Title
|
||||
h1 {
|
||||
color: $color-secondary;
|
||||
line-height: 1;
|
||||
margin-top: -20px;
|
||||
|
||||
@include bp (sm) {
|
||||
margin-top: -100px;
|
||||
}
|
||||
}
|
||||
// Text
|
||||
p {
|
||||
max-width: 350px;
|
||||
margin: 20px auto 56px;
|
||||
|
||||
@include bp (sm) {
|
||||
margin: 50px auto 72px;
|
||||
max-width: 524px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Locations
|
||||
&__locations {
|
||||
.browse {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Modules
|
||||
.grid-modules {
|
||||
grid-column: 1 / span var(--columns);
|
||||
margin-bottom: 0;
|
||||
|
||||
@include bp (sm) {
|
||||
grid-column: 2 / span 22;
|
||||
margin: 200px 0 72px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
// Pages
|
||||
@import "pages/homepage";
|
||||
@import "pages/photos";
|
||||
@import "pages/explore";
|
||||
|
||||
// Modules
|
||||
@import "modules/globe";
|
||||
|
||||
Reference in New Issue
Block a user