Skip to content

Commit

Permalink
Merge pull request #78 from #50
Browse files Browse the repository at this point in the history
Cerradogo#50
  • Loading branch information
CPeluti authored Sep 8, 2022
2 parents af9f6a6 + 331d3b1 commit 0714d8a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions backend/src/models/Hunt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ export interface Hunt{
img: Image
latlong: number[]
questions: string[]
tips: string[]
}

const huntSchema = new Schema<Hunt>({
name: {type: String, required: true},
location: {type: String, required: true},
latlong: {type: [Number], required: true},
questions: {type: [String], select: true},
tips: {type: [String], required: true},
img: imageSchema
})

Expand Down
26 changes: 24 additions & 2 deletions frontend/src/components/HuntMap.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
<script lang="ts">export let hunt;
<script lang="ts">
export let hunt;
import ProgressBar from "../components/ProgressBar.svelte";
import { NotificationDisplay, notifier } from '@beyonk/svelte-notifications'
const progress = 7/9*100;
function shuffle(a: string[]) {
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
}
let dicas = ()=>{
let tips = shuffle(hunt.tips)
notifier.info(tips[0])
}
</script>
<main>
<NotificationDisplay/>
<div id="nome_caca">
{hunt.name}
</div>
Expand All @@ -11,16 +26,23 @@
7/9
</div>
<img id="mapa" src="http://127.0.0.1:8887/google_maps.jpg" alt="mapa">

<!--div id="information">{hunt.latlong[0]} {hunt.latlong[1]}</div-->
<div class="scrollmenu">
<img id="perfil" src="http://127.0.0.1:8887/perfil.png" alt="botao perfil">
<img id="dica" src="http://127.0.0.1:8887/dica.png" alt="botao dica">
<img id="dica" on:click={dicas} src="http://127.0.0.1:8887/dica.png" alt="botao dica">
<img id="coletar" src="http://127.0.0.1:8887/coletar.png" alt="botao coletar">
<img id="menu" src="http://127.0.0.1:8887/menu.png" alt="botao menu">
<img id="podio" src="http://127.0.0.1:8887/podio.png" alt="botao podio">
</div>

<style>
.tips-container{
background: grey;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
border-radius: 27px;
height: 325px;
}
div.scrollmenu {
background-color: white;
overflow: auto;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/interfaces/Hunt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface Hunt{
name: string
location: string
latlong: number[]
tips:string[]
}
3 changes: 2 additions & 1 deletion frontend/src/routes/hunt/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
const hunts:Array<Hunt> =
[{name: "Olhos D'água",
location: "string",
latlong: [-15.884039920347867, -48.01590311958394]}]
latlong: [-15.884039920347867, -48.01590311958394],
tips:["fica na unb", "perto do icc"]}]
const progress = 7/9*100
</script>
{#each hunts as hunt}
Expand Down

0 comments on commit 0714d8a

Please sign in to comment.