Skip to content

Commit b60539c

Browse files
committed
WIP frontend: added now button
- align items on the same axis - added svg for now button
1 parent b1e402c commit b60539c

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script lang="ts">
2+
let {width = "75px", height = "75px"} = $props();
3+
</script>
4+
5+
<svg
6+
{width}
7+
{height}
8+
viewBox="0 0 24 24"
9+
fill="none"
10+
xmlns="http://www.w3.org/2000/svg"
11+
>
12+
<path d="M5.06152 12C5.55362 8.05369 8.92001 5 12.9996 5C17.4179 5 20.9996 8.58172 20.9996 13C20.9996 17.4183 17.4179 21 12.9996 21H8M13 13V9M11 3H15M3 15H8M5 18H10"
13+
stroke="currentColor" stroke-width="2" stroke-linecap="round"
14+
stroke-linejoin="round"/>
15+
</svg>

frontend/src/components/timetable/TimeTable.svelte

+19-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import StationSearch from "$components/StationSearch.svelte";
44
import type { Station } from "$models/station";
55
import TimePicker from "$components/timetable/TimePicker.svelte";
6+
import Clock from "$components/svg/Clock.svelte";
67
78
let typeSelected: "departures" | "arrivals" = $state("departures");
89
@@ -48,17 +49,24 @@
4849

4950
<StationSearch onStationSelect={(station) => (stationSelected = station)} />
5051

51-
<div class="flex flex-col">
52-
<span>Pick a time:</span>
53-
<TimePicker onChangedDate={(newDate) => (dateSelected = newDate)} />
54-
</div>
52+
<div class="flex flex-row justify-between">
53+
<TimePicker onChangedDate={(newDate) => (dateSelected = newDate)}/>
54+
55+
<div class="flex flex-row">
56+
<button class="flex flex-row items-center bg-primary rounded-3xl px-2">
57+
<Clock height="25px" width="25px" />
58+
<span class="text-xl">Now</span>
59+
</button>
5560

56-
<button
57-
class="{stationSelected && dateSelected
61+
<button
62+
class="{stationSelected && dateSelected
5863
? 'bg-accent text-black'
59-
: 'bg-primary text-text'} flex items-center justify-center rounded-md p-2 text-base font-bold text-background md:text-2xl"
60-
onclick={gotoRequest}
61-
>
62-
Request
63-
</button>
64+
: 'bg-primary text-text'} flex items-center justify-center rounded-3xl px-4 text-base font-bold text-background md:text-2xl"
65+
onclick={gotoRequest}
66+
>
67+
Search
68+
</button>
69+
</div>
70+
</div>
71+
6472
</div>

0 commit comments

Comments
 (0)