diff --git a/api/update.js b/api/update.js index 30dae8f..a6f077f 100644 --- a/api/update.js +++ b/api/update.js @@ -69,12 +69,16 @@ router.route("/log").post(async (req, res) => { name: currentWinner.wine.name, vivinoLink: currentWinner.wine.vivinoLink, rating: currentWinner.wine.rating, - occurences: 1 + occurences: 1, + image: currentWinner.wine.image, + id: currentWinner.wine.id }); await newWonWine.save(); wonWine = newWonWine; } else { wonWine.occurences += 1; + wonWine.image = currentWinner.wine.image; + wonWine.id = currentWinner.wine.id; await wonWine.save(); } diff --git a/src/components/RegisterPage.vue b/src/components/RegisterPage.vue index f3edff0..71f6383 100644 --- a/src/components/RegisterPage.vue +++ b/src/components/RegisterPage.vue @@ -33,16 +33,29 @@
-
- +
+
- + +
+
+
+ + + + +
+ + Selected color: {{ winner.color ? winner.color : '(none)' }}
@@ -54,11 +67,7 @@
-
- -
-
@@ -131,6 +140,9 @@ export default { image: "" }); }, + updateColorForWinner(winner, color) { + winner.color = winner.color == color ? null : color + }, sendWines: async function() { let _response = await fetch("/api/log/wines", { headers: { @@ -267,6 +279,10 @@ hr { justify-content: center; align-items: center; margin: auto; + + @include mobile { + width: 80%; + } } .winner-element, @@ -278,6 +294,10 @@ hr { align-items: center; flex-direction: column; justify-content: center; + + button { + cursor: pointer; + } } .color-container { @@ -291,8 +311,8 @@ hr { .label-div { display: flex; - flex-direction: column; width: 50%; + flex-direction: column; padding-bottom: 20px; margin: auto; display: flex; @@ -304,6 +324,53 @@ hr { } } +.color-selector { + .active { + border: 2px solid black; + margin-bottom: 1rem; + } + + button { + border: 2px solid transparent; + color: #333; + padding: 10px 30px; + margin: 0; + font-size: 1.3rem; + display: inline-flex; + flex-wrap: wrap; + flex-direction: row; + max-height: calc(3rem + 18px); + max-width: calc(3rem + 18px); + margin: 10px; + // disable-dbl-tap-zoom + touch-action: manipulation; + + @include mobile { + margin: 2px; + } + + &.green { + background: #c8f9df; + }&.blue { + background: #d4f2fe; + }&.red { + background: #fbd7de; + }&.yellow { + background: #fff6d6; + } + } +} + +.color-selected { + margin-bottom: 2rem; + + @include mobile { + display: block; + width: 100%; + font-size: 1.5rem !important; + } +} + .label-div label { padding: 0 6px; display: flex; @@ -315,6 +382,10 @@ hr { } .input-container { + @include mobile { + width: 100%; + } + & .label-div { width: 100%; } @@ -322,6 +393,10 @@ hr { .winnner-container-inner { display: flex; + + @include mobile { + flex-direction: column; + } } .wine-image { diff --git a/src/components/TodaysPage.vue b/src/components/TodaysPage.vue index 8b19038..e40f960 100644 --- a/src/components/TodaysPage.vue +++ b/src/components/TodaysPage.vue @@ -10,8 +10,8 @@

{{ wine.name }}

- {{ wine.rating }} rating - Les mer + {{ wine.rating }} rating + Les mer
@@ -41,6 +41,8 @@ export default {