Skip to content

Commit e57b812

Browse files
committed
fix: mobile layout
1 parent e9637a1 commit e57b812

File tree

5 files changed

+86
-40
lines changed

5 files changed

+86
-40
lines changed

src/components/AddressList.vue

+41-36
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@
8383
</tr>
8484
</thead>
8585
<tbody>
86-
<tr v-for="address in filteredAndSortedAddresses" :key="address.id">
86+
<tr
87+
v-for="address in filteredAndSortedAddresses"
88+
:key="address.id + address.lat + address.lon"
89+
>
8790
<td
8891
:style="{
8992
background:
@@ -203,41 +206,43 @@ function sortBy(key: SortKey) {
203206
204207
// Filter and sort addresses based on the search query and selected sort column
205208
const filteredAndSortedAddresses = computed(() => {
206-
return (
207-
[...addressStore.addresses]
208-
// filter by category
209-
.filter((address) => {
210-
if (selectedIsophoneFilterIndex.value === 'all') {
211-
return true
212-
}
213-
214-
return (
215-
address.isophoneLevelDay === selectedIsophoneFilterIndex.value.day ||
216-
address.isophoneLevelNight === selectedIsophoneFilterIndex.value.night
217-
)
218-
})
219-
// filter by test input
220-
.filter((address) => {
221-
const searchLower = searchQuery.value.toLowerCase()
222-
return (
223-
[address.street, address.housenumber, address.postcode, address.city]
224-
.join(' ')
225-
.toLowerCase()
226-
.includes(searchLower) ||
227-
address.postcode?.toString().includes(searchLower) ||
228-
address.street?.toLowerCase().includes(searchLower) ||
229-
address.city?.toLowerCase().includes(searchLower)
230-
)
231-
})
232-
.sort((a, b) => {
233-
const aValue = a[sortKey.value] || ''
234-
const bValue = b[sortKey.value] || ''
235-
236-
if (aValue < bValue) return sortDirection.value === 'asc' ? -1 : 1
237-
if (aValue > bValue) return sortDirection.value === 'asc' ? 1 : -1
238-
return 0
239-
})
240-
)
209+
const filteredAndSortedResult = [...addressStore.addresses]
210+
// filter by category
211+
.filter((address) => {
212+
if (selectedIsophoneFilterIndex.value === 'all') {
213+
return true
214+
}
215+
216+
return (
217+
address.isophoneLevelDay === selectedIsophoneFilterIndex.value.day ||
218+
address.isophoneLevelNight === selectedIsophoneFilterIndex.value.night
219+
)
220+
})
221+
// filter by test input
222+
/*.filter((address) => {
223+
const searchLower = searchQuery.value.toLowerCase()
224+
return (
225+
[address.street, address.housenumber, address.postcode, address.city]
226+
.join(' ')
227+
.toLowerCase()
228+
.includes(searchLower) ||
229+
address.postcode?.toString().includes(searchLower) ||
230+
address.street?.toLowerCase().includes(searchLower) ||
231+
address.city?.toLowerCase().includes(searchLower)
232+
)
233+
})
234+
.sort((a, b) => {
235+
const aValue = a[sortKey.value] || ''
236+
const bValue = b[sortKey.value] || ''
237+
238+
if (aValue < bValue) return sortDirection.value === 'asc' ? -1 : 1
239+
if (aValue > bValue) return sortDirection.value === 'asc' ? 1 : -1
240+
return 0
241+
})
242+
)*/
243+
244+
console.log(filteredAndSortedResult)
245+
return filteredAndSortedResult
241246
})
242247
243248
function informPeople() {

src/components/MachineWizard.vue

+4
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ const { calculateIsophones, setStep } = constructionSiteStore
4444
.wrapper {
4545
padding: 0 1rem;
4646
}
47+
48+
h2 {
49+
margin-bottom: 0;
50+
}
4751
</style>

src/components/ProgressBar.vue

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { computed } from 'vue'
33
44
const { numSteps, current } = defineProps<{ numSteps: number; current: number }>()
5-
const emit = defineEmits(["select"])
5+
const emit = defineEmits(['select'])
66
77
const steps = computed(() => Array.from({ length: numSteps }, (_, i) => i + 1))
88
@@ -11,7 +11,14 @@ const active = computed(() => (index: number) => (current === index ? 'active' :
1111

1212
<template>
1313
<div id="progress">
14-
<button v-for="index in steps" :key="index" :class="active(index)" @click="emit('select', index)">{{ index }}</button>
14+
<button
15+
v-for="index in steps"
16+
:key="index"
17+
:class="active(index)"
18+
@click="emit('select', index)"
19+
>
20+
{{ index }}
21+
</button>
1522
</div>
1623
</template>
1724

@@ -40,4 +47,15 @@ button.active {
4047
border-color: #115270;
4148
cursor: not-allowed;
4249
}
50+
51+
#progress {
52+
text-align: center;
53+
}
54+
55+
/* Layout für Desktop */
56+
@media (min-width: 768px) {
57+
#progress {
58+
text-align: left;
59+
}
60+
}
4361
</style>

src/components/TheMap.vue

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ref="mapRef"
44
:loadTilesWhileAnimating="true"
55
:loadTilesWhileInteracting="true"
6-
style="height: 100%; max-width: calc(100vw - 3rem)"
6+
style="height: 100%"
77
@pointermove="hoverFeature"
88
>
99
<ol-view ref="view" :center="viewCenter" :zoom="zoom" projection="EPSG:3857" />
@@ -187,3 +187,16 @@ function setPosition(event: DrawEvent) {
187187
setConstructionSiteCenter(position)
188188
}
189189
</script>
190+
191+
<style scoped>
192+
.ol-map {
193+
max-width: 100vw;
194+
}
195+
196+
/* Layout für Desktop */
197+
@media (min-width: 768px) {
198+
.ol-map {
199+
max-width: calc(100vw - 3rem);
200+
}
201+
}
202+
</style>

src/views/HomeView.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const timeOfDay = computed<TimeOfDay>(() => (time.value ? 'night' : 'day'))
1919
<template>
2020
<div class="base-layout">
2121
<main>
22-
<div>
22+
<div class="day-night">
2323
<label data-icon-before="day" data-icon-variant-before="20-outline" id="day-label"
2424
>Tagzeitraum</label
2525
>
@@ -54,6 +54,7 @@ const timeOfDay = computed<TimeOfDay>(() => (time.value ? 'night' : 'day'))
5454
grid-column-gap: 0px;
5555
grid-row-gap: 0px;
5656
gap: 1rem;
57+
grid-template-rows: auto 1fr;
5758
grid-template-areas:
5859
'aside'
5960
'main';
@@ -75,6 +76,10 @@ main {
7576
flex-direction: column;
7677
}
7778
79+
.day-night {
80+
margin: 0.5rem 1rem;
81+
}
82+
7883
#day-label {
7984
position: relative;
8085
top: -0.3rem;
@@ -91,6 +96,7 @@ main {
9196
.base-layout {
9297
grid-template-columns: minmax(min-content, 50vw) 1fr;
9398
grid-template-areas: 'aside main';
99+
grid-template-rows: 1fr;
94100
}
95101
}
96102
</style>

0 commit comments

Comments
 (0)