diff --git a/src/views/Shake.vue b/src/views/Shake.vue index 80777d9..e7e492e 100644 --- a/src/views/Shake.vue +++ b/src/views/Shake.vue @@ -22,14 +22,18 @@ Shake your phone
to get a Cocktail - Start shaking + Start shaking @@ -80,10 +84,28 @@
- + + + + + + - Shake again
@@ -109,7 +131,7 @@ import { IonButton, IonImg, } from "@ionic/vue"; -import { camera } from "ionicons/icons"; +import { camera, star } from "ionicons/icons"; export default { name: "Shake", components: { @@ -137,10 +159,10 @@ export default { }, methods: { doShake: function () { - const {fetchRandomCocktail} = useStorage(); + const { fetchRandomCocktail } = useStorage(); window.scrollTo({ top: 0, left: 0, behavior: "smooth" }); - if(Math.random() > 0.8){ - fetchRandomCocktail(); + if (Math.random() > 0.8) { + fetchRandomCocktail(); } this.chosenCocktail = this.cocktails[Math.floor(Math.random() * this.cocktails.length)]; @@ -148,11 +170,17 @@ export default { }, }, setup() { - const { takePhoto } = useStorage(); + const { takePhoto, favouriseCocktail } = useStorage(); + + const doFavouriseCocktail = async (cocktail) => { + favouriseCocktail(cocktail); + }; return { - camera, + doFavouriseCocktail, takePhoto, + camera, + star, }; }, }; @@ -203,4 +231,16 @@ ion-img.bigimage { ion-button { margin: 10px; } +.icon-star-false { + color: rgb(0, 0, 0); +} +.icon-star-true { + color: rgb(255, 238, 0); +} +.start-icon{ + margin: auto; + max-width: 80%; + height: auto; + border-radius: 5%; +} \ No newline at end of file