-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from earthrise-media/update-layout
Update layout toward new designs
- Loading branch information
Showing
15 changed files
with
233 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div class="crop-cards"> | ||
<div class="crop-card" v-for="crop in filteredCrops" :key="crop"> | ||
<router-link :to="`/map-explore`" @click="selectedCrop = crop"> | ||
{{ crop }} | ||
</router-link> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import slugify from 'slugify'; | ||
import { computed } from 'vue'; | ||
import { useRouter } from 'vue-router'; | ||
import { storeToRefs } from 'pinia'; | ||
import { useFiltersStore } from '@/stores/filters'; | ||
const router = useRouter(); | ||
const filtersStore = useFiltersStore(); | ||
const { availableCrops, selectedCrop } = storeToRefs(filtersStore); | ||
// TODO actually filter | ||
const filteredCrops = computed(() => availableCrops.value); | ||
</script> | ||
|
||
<style scoped> | ||
.crop-cards { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr 1fr; | ||
gap: 1rem; | ||
} | ||
.crop-card { | ||
background: white; | ||
border-radius: 10px; | ||
height: 10rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<div class="crop-filters"> | ||
crop filters | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<template> | ||
<div class="sidebar"> | ||
<div class="crop-selection"> | ||
<select v-model="selectedCrop" class="crop-picker"> | ||
<option | ||
v-for="crop in availableCrops" | ||
:key="crop" | ||
:value="crop" | ||
> {{crop}} </option> | ||
</select> | ||
|
||
<span> a description of {{ selectedCrop }}</span> | ||
</div> | ||
|
||
<div class="crop-fingerprint"> | ||
crop fingerprint | ||
</div> | ||
|
||
<div class="scenarios"> | ||
<div v-for="scenario in futureScenarios" :key="scenario" class="scenario" :class="{selected: selectedModel === scenario}" @click="selectedModel = scenario"> | ||
<span> | ||
{{ scenario }} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed, ref } from 'vue'; | ||
import { storeToRefs } from 'pinia'; | ||
import { useFiltersStore } from '@/stores/filters'; | ||
const filtersStore = useFiltersStore(); | ||
const { | ||
availableCrops, | ||
selectedCrop, | ||
availableModels, | ||
selectedModel, | ||
} = storeToRefs(filtersStore); | ||
const futureScenarios = computed(() => availableModels.value.filter(d => d.startsWith('future'))); | ||
</script> | ||
|
||
<style scoped> | ||
.sidebar { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
margin-left: var(--page-horizontal-margin); | ||
padding-right: 2rem; | ||
width: 400px; | ||
} | ||
.crop-selection { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
.crop-fingerprint { | ||
width: 100%; | ||
height: 40%; | ||
border: 1px solid white; | ||
border-radius: 0.5rem; | ||
} | ||
.scenarios { | ||
width: 100%; | ||
height: 40%; | ||
display: flex; | ||
flex-direction: row; | ||
gap: 1rem; | ||
} | ||
.scenario { | ||
width: 100%; | ||
border: 1px solid gray; | ||
border-radius: 0.5rem; | ||
cursor: pointer; | ||
} | ||
.scenario.selected { | ||
cursor: pointer; | ||
border-color: white; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<LayoutOverview> | ||
{{ slug }} | ||
</LayoutOverview> | ||
</template> | ||
|
||
<script setup> | ||
import { useRoute } from 'vue-router'; | ||
import LayoutOverview from '@/components/layouts/LayoutOverview.vue'; | ||
const route = useRoute(); | ||
// TODO handle fact that this is a slug (in case of multi-word crop names) | ||
const { slug } = route.params; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
<template> | ||
<LayoutOverview topic-label="crop type"> | ||
crop type | ||
<LayoutOverview> | ||
<div class="wrapper"> | ||
<CropFilters /> | ||
<CropCards /> | ||
</div> | ||
</LayoutOverview> | ||
</template> | ||
|
||
<script setup> | ||
import LayoutOverview from '@/components/layouts/LayoutOverview.vue'; | ||
import CropCards from '@/components/CropCards.vue'; | ||
import CropFilters from '@/components/CropFilters.vue'; | ||
</script> | ||
|
||
<style scoped> | ||
.wrapper { | ||
margin: 0 var(--page-horizontal-margin); | ||
} | ||
</style> |
Oops, something went wrong.