Skip to content

Commit 13bec2f

Browse files
Merge pull request #18 from itk-dev/feature/audio-styling
SALG-1278: Style nav/audio box
2 parents ebbf36b + 5c9ed3d commit 13bec2f

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/components/points-of-interest/PointOfInterest.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function PointOfInterest({
5050
);
5151
setProximity(distance);
5252
if (!unlocked && id === nextUnlockableId) {
53-
setUnlocked(distance < 50); // todo magic number/get from config
53+
setUnlocked(distance < 51); // todo magic number/get from config
5454
}
5555
}
5656
}, [latitude, longitude, lat, long, geolocationAvailable]);

src/components/routes/RoutePage.jsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,11 @@ function RoutePage() {
158158

159159
if (selectedRoute === null) return null;
160160

161-
162161
return (
163162
<div className="flex flex-col place-items-start pb-36">
164163
<BackButton>Afslut</BackButton>
165164
<h1 className="text-xl font-bold my-3">{selectedRoute.name}</h1>
166-
<div className="relative w-full rounded-lg flex flex-col-reverse gap-1">
165+
<div className="relative w-full rounded-lg flex flex-col-reverse gap-1 pl-3">
167166
{pointsOfInterest &&
168167
pointsOfInterest.map((pointOfInterest, index) => (
169168
<PointOfInterest
@@ -176,12 +175,13 @@ function RoutePage() {
176175
/>
177176
))}
178177
</div>
179-
<div className="fixed flex flex-col left-3 bottom-3 right-3 bg-zinc-200 dark:bg-zinc-700 gap-3 rounded-lg p-3 pb-15 divide-x dark:divide-zinc-200/5">
178+
<div className="fixed flex flex-col left-3 bottom-0 right-3 bg-zinc-200 dark:bg-zinc-900 gap-3 rounded-t-lg p-3 pb-15 divide-y dark:divide-zinc-200/5">
180179
{routeComplete && <h3>You completed the route. Congratulations!</h3>}
181180
{!routeComplete && (
182181
<div className="flex flex-row justify-between">
183182
<div>
184-
<div className="text-sm text-bold">
183+
<p className="text-xs text-zinc-500">Find vej til næste del</p>
184+
<div className="text-sm font-bold">
185185
Afstand til del
186186
<span className="ml-1 px-2 font-bold rounded-full bg-emerald-700 text-zinc-100 text-sm">
187187
{destinationIndex + 1}
@@ -194,7 +194,7 @@ function RoutePage() {
194194
<div className="pl-3">
195195
{(!orientation || !angle) && (
196196
<button
197-
className="bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-800 rounded text-sm py-1 px-3"
197+
className="bg-zinc-700 dark:bg-zinc-200 text-zinc-200 dark:text-zinc-800 rounded text-sm py-1 px-3"
198198
type="button"
199199
onClick={() => startWaypointer()}
200200
>
@@ -207,7 +207,7 @@ function RoutePage() {
207207
<span className="text-sm text-bold mr-5">Retning</span>
208208
<span className="w-1/2">
209209
<LocationArrow
210-
className="inline w-5"
210+
className="inline w-10"
211211
style={{
212212
transform: `rotate(${-rotation}deg)`,
213213
}}
@@ -220,14 +220,17 @@ function RoutePage() {
220220
</div>
221221
)}
222222

223-
<div>
224-
<audio
225-
className="w-full"
226-
ref={audioRef}
227-
controls
228-
src={`${fileUrl}${source}`}
229-
/>
230-
</div>
223+
{source && audioRef && (
224+
<div className="pt-2">
225+
<p className="text-xs text-zinc-500">Igangværende afspilning</p>
226+
{/* TODO: Get the real name instead of Pizza 1 */}
227+
<p className="text-sm font-bold ">Pizza 1</p>
228+
<audio className="w-full" ref={audioRef} controls>
229+
<source src={`${fileUrl}${source}`} type="audio/mpeg" />
230+
Your browser does not support the audio element.
231+
</audio>
232+
</div>
233+
)}
231234
</div>
232235
<div ref={bottomRef} />
233236
</div>

src/components/routes/SelectedRoute.jsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,18 @@ function SelectedRoute({ selectedRoute, hideMapOverlay }) {
3838
className="bg-zinc-100 dark:bg-zinc-700 rounded p-3 w-32 drop-shadow"
3939
>
4040
<label htmlFor="distance" className="block mb-2">
41-
<b className="text-sm">Distance</b>
42-
<br />
43-
<span className="text-xl">{selectedRoute.distance}</span>
41+
<p className="text-xs">Distance</p>
42+
<p className="font-bold">{selectedRoute.distance}</p>
4443
</label>
4544
<label htmlFor="poi" className="block mb-2">
46-
<b className="text-xs">Afsnit</b>
47-
<br />
48-
<span className="text-xl">{selectedRoute.partcount}</span>
45+
<p className="text-xs">Afsnit</p>
46+
<p className="font-bold">{selectedRoute.partcount}</p>
4947
</label>
5048
{/* todo skeleton screen (I think I recall tailwind having these ootb) or some wait indication. https://tailwindcss.com/docs/animation#pulse */}
5149
{/* todo how to sum up podcasts */}
5250
<label htmlFor="length" className="block">
53-
<b className="text-sm">Afspilningstid</b>
54-
<br />
55-
<span className="text-xl">{selectedRoute.totalduration} min</span>
51+
<p className="text-xs">Afspilningstid</p>
52+
<p className="font-bold">{selectedRoute.totalduration} min</p>
5653
</label>
5754
</div>
5855
</div>

0 commit comments

Comments
 (0)