Code optimizations

This commit is contained in:
2022-06-07 14:54:28 +02:00
parent 218676b9ca
commit 85aacf12e3
4 changed files with 16 additions and 15 deletions

View File

@@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
export let title: string = '' export let title: string
export let description: string = '' export let description: string = undefined
export let image: string = '' export let image: string = undefined
export let url: string = undefined export let url: string = undefined
export let type: string = 'website' export let type: string = 'website'
export let card: string = 'summary_large_image' export let card: string = 'summary_large_image'
export let creator: string = '@flayks' export let creator: string = undefined
</script> </script>
<svelte:head> <svelte:head>

View File

@@ -9,12 +9,13 @@
import Button from '$components/atoms/Button.svelte' import Button from '$components/atoms/Button.svelte'
import Location from '$components/molecules/Location.svelte' import Location from '$components/molecules/Location.svelte'
export let locations: any export let locations: any[]
const { continents, settings: { explore_list }} = getContext('global') const { continents, settings: { explore_list }} = getContext('global')
// Continents filtering logic // Continents filtering logic
let currentContinent: string = undefined let currentContinent: string = undefined
$: filteredLocations = locations.filter(({ country: { continent }}: any) => { $: filteredLocations = locations.filter(({ country: { continent }}: any) => {
if (!currentContinent) { if (!currentContinent) {
// Show all locations by default // Show all locations by default
@@ -30,11 +31,7 @@
* Filter locations from continent * Filter locations from continent
*/ */
const filterLocation = throttle((continent: string) => { const filterLocation = throttle((continent: string) => {
if (continent !== currentContinent) { currentContinent = continent !== currentContinent ? continent : null
currentContinent = continent
} else {
currentContinent = undefined
}
}, 700) }, 700)
</script> </script>

View File

@@ -1,13 +1,17 @@
.heading { .heading {
overflow: hidden; overflow: hidden;
color: $color-tertiary;
text-align: center; text-align: center;
color: $color-tertiary;
@include bp (sm) {
margin-bottom: 128px;
}
// Title // Title
h1 { h1 {
color: $color-secondary;
line-height: 1;
margin-top: 56px; margin-top: 56px;
line-height: 1;
color: $color-secondary;
@include bp (sm) { @include bp (sm) {
margin-top: 160px; margin-top: 160px;
@@ -20,8 +24,8 @@
font-weight: 200; font-weight: 200;
@include bp (sm) { @include bp (sm) {
margin: 72px auto 130px;
max-width: 600px; max-width: 600px;
margin-top: 72px;
} }
} }
} }

View File

@@ -23,7 +23,7 @@
font-weight: 200; font-weight: 200;
@include bp (sm) { @include bp (sm) {
margin: 72px auto 130px; margin: 72px auto 128px;
max-width: 500px; max-width: 500px;
} }
} }