add: design, icons, calculation
Implemented new design for PriceCards, added some icons for visuals, added calculation per price card
This commit is contained in:
parent
878b7e06e8
commit
aa9c936f80
11 changed files with 180 additions and 26 deletions
20
app/assets/styles/button.css
Normal file
20
app/assets/styles/button.css
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.Button {
|
||||||
|
all: unset;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
&.cta {
|
||||||
|
background: var(--color-main);
|
||||||
|
color: var(--color-white);
|
||||||
|
padding: .5rem 1.5rem;
|
||||||
|
border-radius: var(--radius-default);
|
||||||
|
box-shadow: var(--box-shadow-z2);
|
||||||
|
transition: var(--transition-default);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--color-main-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
.Input {
|
.Input {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 25% 1 0;
|
flex: 25% 1 0;
|
||||||
border: 2px solid var(--color-blue);
|
border: 2px solid var(--color-blue);
|
||||||
border-radius: var(--radius-default);
|
border-radius: var(--radius-default);
|
||||||
|
|
|
@ -5,11 +5,14 @@
|
||||||
|
|
||||||
--color-white: white;
|
--color-white: white;
|
||||||
--color-red: #cc0001;
|
--color-red: #cc0001;
|
||||||
--color-blue-dark: #341f97;
|
--color-blue-light: #61a7fd;
|
||||||
--color-blue: #2e86de;
|
--color-blue: #2e86de;
|
||||||
|
--color-blue-dark: #1b4b7f;
|
||||||
--color-grey: #c7c7c7;
|
--color-grey: #c7c7c7;
|
||||||
|
|
||||||
--color-main: var(--color-blue);
|
--color-main: var(--color-blue);
|
||||||
|
--color-main-light: var(--color-blue-light);
|
||||||
|
--color-main-dark: var(--color-blue-dark);
|
||||||
|
|
||||||
--box-shadow-z2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
|
--box-shadow-z2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
|
||||||
}
|
}
|
||||||
|
@ -24,4 +27,26 @@ html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: var(--radius-default);
|
||||||
|
border: 1px solid var(--color-main);
|
||||||
|
box-shadow: var(--box-shadow-z2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pc-wrapper {
|
||||||
|
gap: 1rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-col {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
|
@ -22,8 +22,6 @@
|
||||||
|
|
||||||
& nav,
|
& nav,
|
||||||
& ul {
|
& ul {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,49 @@
|
||||||
.PriceCard {
|
.PriceCard {
|
||||||
padding: var(--padding-default);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1rem;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: var(--color-blue);
|
|
||||||
border-bottom: 1px solid var(--color-white);
|
|
||||||
|
|
||||||
& > .wrapper {
|
& > .padding {
|
||||||
|
gap: 1rem;
|
||||||
|
padding: var(--padding-default);
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .bg-blue {
|
||||||
|
background: var(--color-blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .bg-white {
|
||||||
|
background: var(--color-white);
|
||||||
|
}
|
||||||
|
|
||||||
|
& .wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
flex-basis: 30%;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .info {
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > .icon {
|
||||||
|
color: var(--color-blue-light);
|
||||||
|
font-size: 2rem;
|
||||||
|
padding: .2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .price {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .pro {
|
||||||
|
font-size: .8rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--color-main-light);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
9
app/components/Pp/Button.vue
Normal file
9
app/components/Pp/Button.vue
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<button class="Button" @click="emit('click')">
|
||||||
|
<slot />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const emit = defineEmits(['click'])
|
||||||
|
</script>
|
|
@ -1,6 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="Input">
|
<div class="Input flex-col">
|
||||||
<input :type="type" :id="makeId()" placeholder=" " :min="min" :max="max" />
|
<input
|
||||||
|
v-model="text"
|
||||||
|
:type="type"
|
||||||
|
:id="makeId()"
|
||||||
|
:step="step"
|
||||||
|
:min="min"
|
||||||
|
:max="max"
|
||||||
|
:required="required"
|
||||||
|
placeholder=" "
|
||||||
|
@blur="emit('blur')"
|
||||||
|
/>
|
||||||
<label :for="makeId()">{{ label }}</label>
|
<label :for="makeId()">{{ label }}</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -10,6 +20,8 @@ type Props = {
|
||||||
type ?: 'text' | 'number'
|
type ?: 'text' | 'number'
|
||||||
max ?: number
|
max ?: number
|
||||||
min ?: number
|
min ?: number
|
||||||
|
step ?: number
|
||||||
|
required ?: boolean
|
||||||
label : string
|
label : string
|
||||||
id : string
|
id : string
|
||||||
uid : number
|
uid : number
|
||||||
|
@ -17,6 +29,8 @@ type Props = {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
type = 'text',
|
type = 'text',
|
||||||
|
required = false,
|
||||||
|
step = 0.01,
|
||||||
min = 1,
|
min = 1,
|
||||||
max,
|
max,
|
||||||
label,
|
label,
|
||||||
|
@ -24,5 +38,9 @@ const {
|
||||||
uid,
|
uid,
|
||||||
} = defineProps<Props>()
|
} = defineProps<Props>()
|
||||||
|
|
||||||
|
const emit = defineEmits(['blur'])
|
||||||
|
|
||||||
|
const text = defineModel()
|
||||||
|
|
||||||
const makeId = () => `${id}_${uid}`
|
const makeId = () => `${id}_${uid}`
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
<Icon name="solar:hamburger-menu-broken" size="2em" />
|
<Icon name="solar:hamburger-menu-broken" size="2em" />
|
||||||
</label>
|
</label>
|
||||||
<input type="checkbox" id="burger_nav_toggle" />
|
<input type="checkbox" id="burger_nav_toggle" />
|
||||||
<nav>
|
<nav class="flex-col">
|
||||||
<label for="burger_nav_toggle">
|
<label for="burger_nav_toggle">
|
||||||
<Icon name="solar:close-circle-broken" />
|
<Icon name="solar:close-circle-broken" />
|
||||||
</label>
|
</label>
|
||||||
<ul>
|
<ul class="flex-col">
|
||||||
<li>Home</li>
|
<li>Home</li>
|
||||||
<li>Übersicht</li>
|
<li>Übersicht</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -1,13 +1,32 @@
|
||||||
<template>
|
<template>
|
||||||
<form class="PriceCard">
|
<form class="PriceCard card">
|
||||||
|
<div class="padding bg-blue flex-col">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<PpFormInput label="Name" id="n" :uid="uid" type="text" />
|
<PpFormInput v-model="name" label="Name" id="n" :uid="uid" type="text" />
|
||||||
<PpFormInput label="Preis" id="p" :uid="uid" type="number" :min="0.01" />
|
<PpFormInput v-model="price" label="Preis" id="p" :uid="uid" type="number" :min="0.01" @blur="calculate" />
|
||||||
</div>
|
</div>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<PpFormInput label="Rollen" id="r" :uid="uid" type="number" :max="150" />
|
<PpFormInput v-model="roles" label="Rollen" id="r" :uid="uid" type="number" :max="150" @blur="calculate" />
|
||||||
<PpFormInput label="Blätter" id="b" :uid="uid" type="number" :max="500" />
|
<PpFormInput v-model="sheets" label="Blätter" id="b" :uid="uid" type="number" :max="500" @blur="calculate" />
|
||||||
<PpFormInput label="Lagen" id="l" :uid="uid" type="number" :max="10" />
|
<PpFormInput v-model="layers" label="Lagen" id="l" :uid="uid" type="number" :max="10" @blur="calculate" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="wrapper padding bg-white">
|
||||||
|
<div class="info flex-col">
|
||||||
|
<Icon class="icon" name="uil:toilet-paper" mode="svg" />
|
||||||
|
<span class="price">{{ intl.format(ppr) }}</span>
|
||||||
|
<span class="pro">Pro 1</span>
|
||||||
|
</div>
|
||||||
|
<div class="info flex-col">
|
||||||
|
<Icon class="icon" name="uil:file-landscape" mode="svg" />
|
||||||
|
<span class="price">{{ intl.format(ppr) }}</span>
|
||||||
|
<span class="pro">Pro 10</span>
|
||||||
|
</div>
|
||||||
|
<div class="info flex-col">
|
||||||
|
<Icon class="icon" name="uil:layer-group" mode="svg" />
|
||||||
|
<span class="price">{{ intl.format(ppl) }}</span>
|
||||||
|
<span class="pro">Pro 100</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
@ -18,4 +37,30 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const { uid } = defineProps<Props>()
|
const { uid } = defineProps<Props>()
|
||||||
|
|
||||||
|
const name = ref('')
|
||||||
|
const price = ref(0)
|
||||||
|
const roles = ref(0)
|
||||||
|
const sheets = ref(0)
|
||||||
|
const layers = ref(0)
|
||||||
|
|
||||||
|
const ppr = ref(0)
|
||||||
|
const pps = ref(0)
|
||||||
|
const ppl = ref(0)
|
||||||
|
|
||||||
|
const intl = Intl.NumberFormat('de-DE', {
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'EUR',
|
||||||
|
})
|
||||||
|
|
||||||
|
const calculate = () => {
|
||||||
|
if (!price.value || !roles.value) return
|
||||||
|
ppr.value = price.value / roles.value
|
||||||
|
|
||||||
|
if (!sheets.value) return
|
||||||
|
pps.value = (ppr.value / sheets.value) * 10
|
||||||
|
|
||||||
|
if(!layers.value) return
|
||||||
|
ppl.value = (pps.value / layers.value) * 100
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
|
<section class="content flex-col">
|
||||||
|
<div class="pc-wrapper flex-col">
|
||||||
<PpPriceCard v-for="num in cards" :uid="num" />
|
<PpPriceCard v-for="num in cards" :uid="num" />
|
||||||
<button @click="addCard">ADD</button>
|
</div>
|
||||||
|
<PpButton class="cta" @click="addCard">
|
||||||
|
<Icon name="uil:plus" mode="svg" />
|
||||||
|
Vergleich hinzufügen
|
||||||
|
</PpButton>
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
|
@ -13,6 +13,7 @@ export default defineNuxtConfig({
|
||||||
css : [
|
css : [
|
||||||
'./app/assets/styles/general.css',
|
'./app/assets/styles/general.css',
|
||||||
'./app/assets/styles/header.css',
|
'./app/assets/styles/header.css',
|
||||||
|
'./app/assets/styles/button.css',
|
||||||
'./app/assets/styles/priceCard.css',
|
'./app/assets/styles/priceCard.css',
|
||||||
'./app/assets/styles/formInput.css',
|
'./app/assets/styles/formInput.css',
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue