Skip to content

Commit

Permalink
feat: improved design
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen committed Oct 3, 2024
1 parent 092184f commit 43b85f4
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 44 deletions.
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ header.rea-header {
flex-direction: row;
align-items: center;
margin-bottom: 0;
z-index: 1;
}
nav {
Expand Down
1 change: 0 additions & 1 deletion src/components/AddressList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ const filteredAndSortedAddresses = computed(() => {
})
)*/
console.log(filteredAndSortedResult)
return filteredAndSortedResult
})
Expand Down
45 changes: 45 additions & 0 deletions src/components/DayNightSwitch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<script setup lang="ts">
const model = defineModel()
</script>

<template>
<div class="day-night">
<label data-icon-before="day" data-icon-variant-before="20-outline" id="day-label"
>Tagzeitraum</label
>
<input type="checkbox" role="switch" class="elm-toggle" id="day-night-toggle" v-model="model" />
<label
class="elm-label"
for="day-night-toggle"
id="night-label"
data-icon-before="night"
data-icon-variant-before="20-outline"
>Nachtzeitraum</label
>
</div>
</template>

<style scoped>
.day-night {
margin: 0.5rem;
position: absolute;
right: 0;
top: 0;
z-index: 10;
background-color: white;
display: inline-flex;
align-items: center;
padding: 0.5rem 1rem;
border-radius: 10px;
}
#day-label {
position: relative;
display: inline-block;
margin-right: 0.5rem;
}
#night-label {
margin-left: 0.5rem;
}
</style>
2 changes: 0 additions & 2 deletions src/components/TheMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,9 @@ function hoverFeature(event: MapBrowserEvent<PointerEvent>) {
layerFilter
})
const filteredFeatures = features.filter((feature) => {
console.log('layer', feature.getProperties().layer)
return feature.getProperties().layer === 'Building'
})
highlightedFeatures.value = filteredFeatures[0] ? [filteredFeatures[0]] : []
console.log(highlightedFeatures.value)
}
const styleFunction = (feature: RenderFeature, style: Style) => {
Expand Down
1 change: 0 additions & 1 deletion src/stores/addressStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const useAddressStore = defineStore('addressStore', {
lat,
'isophoneLevelNight'
)
console.log({ dayMap: dayMapArray, nightMap: nightMapArray })

this.addresses = [...dayMapArray, ...nightMapArray].filter(
(addr) => addr.city && addr.postcode && addr.street
Expand Down
2 changes: 1 addition & 1 deletion src/stores/constructionSiteStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useConstructionSiteStore = defineStore('constructionSiteStore', {
this.currentStep = 3
this.isophonesCalculated = true

console.log('DBG', { isophonesDay: this.isophonesDay, isophonesNight: this.isophonesNight })
console.log({ isophonesDay: this.isophonesDay, isophonesNight: this.isophonesNight })
},

setStep(step: number) {
Expand Down
4 changes: 0 additions & 4 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ h1 {
display: inline-block;
}

main, aside {
padding-top: 1rem;
}

.sr-only {
border: 0 !important;
clip: rect(1px, 1px, 1px, 1px) !important; /* 1 */
Expand Down
47 changes: 12 additions & 35 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import TheLegend from '../components/TheLegend.vue'
import { useConstructionSiteStore } from '../stores/constructionSiteStore'
import { storeToRefs } from 'pinia'
import type { TimeOfDay } from '../services/Isophones'
import DayNightSwitch from '../components/DayNightSwitch.vue'
const constructionSiteStore = useConstructionSiteStore()
const { currentStep } = storeToRefs(constructionSiteStore)
Expand All @@ -17,28 +18,9 @@ const timeOfDay = computed<TimeOfDay>(() => (time.value ? 'night' : 'day'))
</script>

<template>
<div class="base-layout">
<div class="base-layout" :class="'step-' + currentStep">
<main>
<div class="day-night" v-if="currentStep === 3">
<label data-icon-before="day" data-icon-variant-before="20-outline" id="day-label"
>Tagzeitraum</label
>
<input
type="checkbox"
role="switch"
class="elm-toggle"
id="day-night-toggle"
v-model="time"
/>
<label
class="elm-label"
for="day-night-toggle"
id="night-label"
data-icon-before="night"
data-icon-variant-before="20-outline"
>Nachtzeitraum</label
>
</div>
<DayNightSwitch v-if="currentStep === 3" v-model="time" />
<TheMap :center="home" :time="timeOfDay"></TheMap>
<TheLegend v-if="currentStep === 3" :time="timeOfDay" />
</main>
Expand All @@ -61,34 +43,25 @@ const timeOfDay = computed<TimeOfDay>(() => (time.value ? 'night' : 'day'))
height: calc(100% - 70px);
}
.base-layout.step-1 {
grid-template-rows: auto 1fr;
}
aside {
grid-area: aside;
overflow: auto;
height: 100%;
display: flex;
flex-direction: column;
padding-top: 1rem;
}
main {
grid-area: main;
height: 100%;
display: flex;
flex-direction: column;
}
.day-night {
margin: 0.5rem 1rem;
}
#day-label {
position: relative;
top: -0.3rem;
display: inline-block;
margin-right: 0.5rem;
}
#night-label {
margin-left: 0.5rem;
}
/* Layout für Desktop */
Expand All @@ -98,5 +71,9 @@ main {
grid-template-areas: 'aside main';
grid-template-rows: 1fr;
}
.base-layout.step-1 {
grid-template-rows: 1fr;
}
}
</style>

0 comments on commit 43b85f4

Please sign in to comment.