This commit is contained in:
Ota Prokopec 2023-03-28 22:21:16 +02:00
parent ed5a2222d6
commit 4054b66aa3
3 changed files with 11 additions and 10 deletions

View File

@ -1,8 +1,6 @@
export const getLocationDataFromLatAndLong = async (latitude: number, longitude: number) => {
const response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${latitude}&lon=${longitude}&format=json`)
const data = await response.json()
console.log(data);
return {
city: data?.address?.town || data?.address?.city || data?.address?.village,
state: data?.address?.country,

View File

@ -7,16 +7,19 @@
const dispatch = createEventDispatcher()
export let control: 'wrong-firstTime' | 'wrong-secondTime' | 'correct' | 'not-control' | null
export let imgSrc
export let imgSrc: string = ''
export let loading: boolean
//
</script>
<div>
<div class="wrap">
<div class="h-[var(--quizHeader)] w-full flex relative top-0 justify-center items-center">
<div class="flex justify-center items-center flex-col flex-wrap gap-3">
<span class="title"><slot name="title" /></span>
<div class="wrap mt-2">
<div class="w-full flex relative top-0 justify-center items-center">
<div class="flex w-full justify-center items-center flex-col flex-wrap gap-3">
<span class="title h-min"><slot name="title" /></span>
{#if imgSrc}
<span style="width: 100%"><Image class="w-full h-[200px]" src={imgSrc} /></span>
{/if}
</div>
</div>
<Section style="height: calc(100% - var(--quizHeader)); position: relative">

View File

@ -122,7 +122,7 @@
{#if view === 'question'}
<Layout
loading={answerLoading}
imgSrc={'gameData.question.thumbnail'}
imgSrc={checkPoint.CPImage}
on:submit={() => checkAnswer()}
on:nextQuestion={() => {
if (checkPointType === 'INFO') checkAnswer()