Skip to content

Commit 281e4f2

Browse files
committed
frontend: added mobile design for TimeTable
- adjust text size on larger screens for StationSearch - reduced gap on x axis in TimePicker - removed text size in TimePicker, TimeTable on smaller screens - added gap in TimeTable - fixed auto align
1 parent c178b61 commit 281e4f2

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

frontend/src/components/StationSearch.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105

106106
<div class="relative w-full">
107107
<div
108-
class="flex flex-row items-center gap-x-2 rounded-2xl bg-primary px-2 focus-within:ring-2 focus-within:ring-accent hover:ring-2 hover:ring-accent"
108+
class="flex flex-row items-center gap-x-2 rounded-2xl bg-primary px-2 focus-within:ring-2 focus-within:ring-accent hover:ring-2 hover:ring-accent md:text-2xl"
109109
>
110110
<Search height="50px" width="50px" />
111111
<input

frontend/src/components/timetable/TimePicker.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
type="button"
7575
class:ring-2={isOpen}
7676
class:ring-accent={isOpen}
77-
class="flex flex-row items-center gap-x-4 rounded-md p-0.5 md:p-2 text-center text-base md:text-2xl hover:ring-2 hover:ring-accent"
77+
class="flex flex-row items-center gap-x-2 rounded-md p-0.5 md:p-2 text-center md:text-2xl hover:ring-2 hover:ring-accent"
7878
onclick={() => isOpen = true}
7979
>
8080
<Calendar />

frontend/src/components/timetable/TimeTable.svelte

+19-17
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
};
1919
</script>
2020

21-
<div class="flex flex-col md:w-[40%]">
21+
<div class="flex flex-col md:w-[40%] gap-y-2">
2222
<div class="flex flex-row items-center justify-end gap-x-2">
2323
<button
2424
type="button"
@@ -49,25 +49,27 @@
4949

5050
<StationSearch onStationSelect={(station) => (stationSelected = station)} />
5151

52-
<div class="flex flex-row justify-between">
52+
<div class="flex flex-row">
5353
<TimePicker bind:selectedDate={dateSelected} />
5454

55-
<div class="flex flex-row">
56-
<button class="flex flex-row items-center bg-primary rounded-3xl px-2"
57-
onclick={() => (dateSelected = DateTime.now().set({ second: 0, millisecond: 0 }))}>
58-
<Clock height="25px" width="25px" />
59-
<span class="hidden md:block text-xl">Now</span>
60-
</button>
55+
<div class="ml-auto flex gap-1 md:gap-3">
56+
<!-- Reset time -->
57+
<button class="flex flex-row items-center bg-primary rounded-3xl px-2 md:px-4"
58+
onclick={() => (dateSelected = DateTime.now().set({ second: 0, millisecond: 0 }))}>
59+
<Clock height="25px" width="25px" />
60+
<span class="hidden md:block text-xl">Now</span>
61+
</button>
6162

62-
<button
63-
class="{stationSelected && dateSelected
63+
<!-- Query departures/ arrivals of a station -->
64+
<button
65+
class="{stationSelected && dateSelected
6466
? 'bg-accent text-black'
65-
: 'bg-primary text-text'} flex items-center justify-center rounded-3xl px-4 text-base font-bold text-background md:text-2xl"
66-
onclick={gotoRequest}
67-
>
68-
Search
69-
</button>
70-
</div>
71-
</div>
67+
: 'bg-primary text-text'} flex items-center justify-center rounded-3xl px-4 text-background md:text-2xl font-bold"
68+
onclick={gotoRequest}
69+
>
70+
Search
71+
</button>
72+
</div>
73+
</div>
7274

7375
</div>

0 commit comments

Comments
 (0)