- visual representation of storage cards
- line jump doesnt work right now for the cards
This commit is contained in:
Luis S. Ruisinger
2022-06-17 23:55:59 +02:00
parent 452bd149a3
commit 6b9f64b6d1
6 changed files with 88 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
package items; <package items;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View File

@@ -11,6 +11,7 @@
"axios": "^0.27.2", "axios": "^0.27.2",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-router": "^4.0.15",
"vuejs-logger": "^1.5.5" "vuejs-logger": "^1.5.5"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -4,7 +4,7 @@
</div> </div>
</template> </template>
<script> <script>
import ItemModel from "./components/ItemModel.vue"; import ItemModel from "@/components/ItemModel";
export default { export default {
components: { components: {
ItemModel ItemModel

View File

@@ -9,7 +9,7 @@
<!-- navbar --> <!-- navbar -->
<header class="navbar-header"> <div class="navbar-header">
<div class="logo"> <div class="logo">
<a>Storage</a> <a>Storage</a>
</div> </div>
@@ -23,44 +23,44 @@
<ul class="nav-links"> <ul class="nav-links">
<li class="nav-link"> <li class="nav-link">
<a href="#">Home</a> <router-link to="/">Home</router-link>
</li> </li>
<li class="nav-link"> <li class="nav-link">
<a href="#">Profile</a> <router-link to="/profile">Profile</router-link>
</li> </li>
<li class="nav-link"> <li class="nav-link">
<a href="#">Recipes</a> <router-link to="/recipes">Recipes</router-link>
</li> </li>
<li class="nav-link"> <li class="nav-link">
<a href="#">Placeholder</a> <router-link to="/shoppinglist">Shoppinglist</router-link>
</li> </li>
</ul> </ul>
</header> </div>
<!-- input field --> <!-- input field -->
<header class="inputField-header"> <div class="inputField-header">
<input class="newItemName" id="inputTextField" autofocus autocomplete="off" placeholder=" " v-model="newItem" <input class="newItemName" id="inputTextField" autofocus autocomplete="off" placeholder=" " v-model="newItem"
@keyup.enter="addItem"/> @keyup.enter="addItem"/>
<label for="inputTextField" class="formLabel"> <label for="inputTextField" class="formLabel">
Add here ... Add here ...
</label> </label>
</header> </div>
<!-- response element --> <!-- response element -->
<section class="item-section" v-show="items.length" v-cloak> <div class="item-section" v-show="items.length" v-cloak>
<ul class="item-list"> <ul class="item-list">
<li v-for="item in items" <li v-for="item in items"
class="item" class="item"
:key="item.id"> :key="item.id">
<div class="view"> <div class="view">
<label @dblclick="editItem(item)">{{ item.name }} {{ item.quantity }}{{ item.unit }}</label> <label @dblclick="editItem(item)">{{ item.name }} {{ item.quantity }}{{ item.unit }}</label>
<button class="destroy" @click="removeItem(item)"></button> <button class="destroy" @click="removeItem(item)"></button>
</div> </div>
</li> </li>
</ul> </ul>
</section> </div>
</div> </div>
</section> </section>
@@ -69,7 +69,6 @@
</template> </template>
<script> <script>
import api from '../Api'; import api from '../Api';
const Items = { const Items = {
@@ -253,6 +252,10 @@ export default Items
color: black; color: black;
} }
.item{
position: relative;
}
/* Workaround for below WQHD resolution */ /* Workaround for below WQHD resolution */
@media screen and (max-height: 1400px) { @media screen and (max-height: 1400px) {
@@ -263,4 +266,71 @@ export default Items
/* item section */ /* item section */
.item-section{
position: fixed;
}
.item-list{
position: relative;
display: grid;
grid-gap: 12vh;
top: -60vh;
left: -47vw;
margin-left: 10vh;
grid-template-columns: repeat(7, 2vh);
.item{
position: relative;
margin-top: 0;
font-family: Montserrat, sans-serif;
list-style: none;
border: 0 solid white;
border-radius: 0;
padding: 5vh;
background: darkslategrey;
box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.4);
}
.view{
position: relative;
top: -3vh;
left: -2.5vh;
color: white;
}
.destroy{
display: block;
position: relative;
height: 0.1vh;
width: 3vh;
top: 6vh;
left: 1vh;
border-radius: 0.1vh;
border: solid black 0.1vh;
transform: rotate(45deg);
}
.destroy:after{
content: '';
border-radius: 0.1vh;
border: solid black 0.1vh;
position: absolute;
width: 3vh;
top: -0.10vh;
left: -0.1vh;
transform: rotate(-90deg);
}
.destroy:hover{
cursor: pointer;
}
.destroyOther:hover{
cursor: pointer;
}
}
</style> </style>

View File

@@ -38,6 +38,7 @@
flex-grow: 1; flex-grow: 1;
border-bottom: 0.1vh solid black; border-bottom: 0.1vh solid black;
margin: 5px; margin: 5px;
z-index: 0;
} }
.menu-icon { .menu-icon {