Skip to content
Snippets Groups Projects
Commit dcf49e98 authored by Ingrid Martinsheimen Egge's avatar Ingrid Martinsheimen Egge :cow2:
Browse files

Justerte plassering av knapper for å unngå overlapp

parent 40b47b86
No related branches found
No related tags found
1 merge request!13Fridge view
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<input type = "range" id = "slider" name = "slider" min="0" :max = "this.maxValue" v-model="sliderValue"> <input type = "range" id = "slider" name = "slider" min="0" :max = "this.maxValue" v-model="sliderValue">
<div id="buttons"> <div id="buttons">
<button @click="logFoodAsDiscarded">Ble kastet 🗑️ </button> <button @click="logFoodAsDiscarded">Ble kastet</button>
<button id="eatenBtn" @click="logFoodAsEaten" >Ble spist 😋</button> <button id="eatenBtn" @click="logFoodAsEaten" >Ble spist</button>
</div> </div>
<div v-if="isExpired" id = "itemHasExpiredMessage"> <div v-if="isExpired" id = "itemHasExpiredMessage">
<h2>Varen har gått ut på dato</h2> <h2>Varen har gått ut på dato</h2>
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
#popup { #popup {
background-color: base.$white; background-color: base.$white;
color: black; color: black;
width: 70%; width: 90%;
padding:2em; padding:2em;
display:flex; display:flex;
flex-direction: column; flex-direction: column;
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
} }
#buttons { #buttons {
justify-content: center; justify-content: space-between;
display: flex; display: flex;
width: 100%; width: 100%;
margin: 1em; margin: 1em;
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
button { button {
margin:.1em; margin:.1em;
font-weight: bolder; font-weight: bolder;
width: 40%; width: 50%;
padding:1em; padding:1em;
background-color: base.$red; background-color: base.$red;
color:white; color:white;
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
const dateString = this.formatDate(); const dateString = this.formatDate();
if(expirationDays<0) { if(expirationDays<0) {
return "Utgikk " + this.item.expiration return "Utgikk " + dateString
} }
switch (expirationDays){ switch (expirationDays){
......
...@@ -67,9 +67,10 @@ select { ...@@ -67,9 +67,10 @@ select {
} }
#wrapper{ #wrapper{
background-color: base.$grey; background-color: base.$white;
padding: 2em; padding: 2em;
border-radius: 9%; border: 3px dashed base.$light-green;
} }
......
<template> <template><h1>Kjøleskap</h1><br><br>
<main> <main>
<h1>Kjøleskap</h1><br><br>
<ItemSearch v-if="searchVisible" @itemsAdded="updateFridge"></ItemSearch> <ItemSearch v-if="searchVisible" @itemsAdded="updateFridge"></ItemSearch>
<div><p>{{this.fridgeMsg}}</p></div>
<div id = "fridgeMsg"><p>Melding fra kjøleskapet:</p><span>{{this.fridgeMsg}}</span></div>
<eat-fridge-item-modal @closeModal="hideModal" v-if="visible" :fridge-item="selectedItem"></eat-fridge-item-modal> <eat-fridge-item-modal @closeModal="hideModal" v-if="visible" :fridge-item="selectedItem"></eat-fridge-item-modal>
<div id = "itemContainer" > <div id = "itemContainer" >
...@@ -40,7 +42,7 @@ export default { ...@@ -40,7 +42,7 @@ export default {
selectedItem: null, selectedItem: null,
fridgeItems: [], fridgeItems: [],
searchVisible: false, searchVisible: false,
fridgeMsg: "fridge message:" fridgeMsg: ""
} }
}, },
methods: { methods: {
...@@ -53,6 +55,7 @@ export default { ...@@ -53,6 +55,7 @@ export default {
}, },
showItemSearch() { showItemSearch() {
this.searchVisible=!this.searchVisible; this.searchVisible=!this.searchVisible;
window.scrollTo({ top: 0, behavior: 'smooth' });
}, },
hideItemSearch() { hideItemSearch() {
this.searchVisible=false; this.searchVisible=false;
...@@ -64,7 +67,8 @@ export default { ...@@ -64,7 +67,8 @@ export default {
this.fridgeItems = await API.getFridgeItems(); this.fridgeItems = await API.getFridgeItems();
this.hideItemSearch(); this.hideItemSearch();
this.updateFridgeMessage("Varen ble lagt i kjøleskapet.") this.updateFridgeMessage("Varen ble lagt i kjøleskapet.")
} },
}, },
async mounted() { async mounted() {
this.fridgeItems = await API.getFridgeItems(); this.fridgeItems = await API.getFridgeItems();
...@@ -74,14 +78,17 @@ export default { ...@@ -74,14 +78,17 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
main { main {
padding-top: 4em;
color:black; color:black;
background-color: base.$white; background-color: base.$grey;
padding: 2em;
min-height: 600px;
} }
h1 { h1 {
width:100%; width:100%;
padding-left: 1em; padding-left: 1em;
padding-top: 2em;
font-weight: bold; font-weight: bold;
} }
...@@ -109,10 +116,24 @@ h1 { ...@@ -109,10 +116,24 @@ h1 {
} }
#addItemBtn-container { #addItemBtn-container {
padding-bottom: 9em; padding-bottom: 3em;
z-index: 9999; z-index: 9999;
position: fixed; position: fixed;
bottom: 15px; bottom: 15px;
right: 1em; right: 1em;
} }
#fridgeMsg {
background-color: base.$light-green;
padding: 1em;
}
#fridgeMsg span, #fridgeMsg p{
font-weight: bolder;
font-size: 1.2em;
}
</style> </style>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment