Merge branch 'master' of github.com:KevinMidboe/vinlottis

This commit is contained in:
2020-01-23 09:30:53 +01:00
13 changed files with 167 additions and 111 deletions

View File

@@ -24,6 +24,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./styles/global.scss";
@font-face { @font-face {
font-family: "knowit"; font-family: "knowit";
font-weight: 600; font-weight: 600;

View File

@@ -13,17 +13,12 @@
<script> <script>
export default {}; export default {};
</script> </script>
<style lang="scss">
body {
margin: 0;
color: #333333;
font-family: "knowit";
padding-bottom: 30px;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/global.scss";
@import "../styles/media-queries.scss";
div { div {
font-family: "knowit"; font-family: Arial;
} }
.outer { .outer {
display: flex; display: flex;
@@ -37,6 +32,7 @@ h2 {
width: 100vw; width: 100vw;
text-align: center; text-align: center;
font-size: 3rem; font-size: 3rem;
font-family: knowit;
} }
form { form {

View File

@@ -83,7 +83,7 @@ export default {
}, },
watch: { watch: {
numberOfBallots: function() { numberOfBallots: function() {
this.generateColors() this.generateColors();
} }
}, },
methods: { methods: {
@@ -164,15 +164,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../styles/global.scss'; @import "../styles/variables.scss";
@import '../styles/media-queries.scss'; @import "../styles/global.scss";
@import "../styles/media-queries.scss";
body {
margin: 0;
color: #333333;
font-family: sans-serif;
padding-bottom: 30px;
}
.vipps { .vipps {
margin: 20px auto auto auto; margin: 20px auto auto auto;
@@ -320,58 +314,77 @@ button {
justify-content: space-around; justify-content: space-around;
} }
.green, .green {
.input-line label input#greenCheckbox:checked ~ .border .checkmark { background-color: $light-green;
background-color: #c8f9df;
} }
.input-line label:hover input#greenCheckbox ~ .border .checkmark { .blue {
background-color: #0be881; background-color: $light-blue;
} }
.input-line label:focus input#greenCheckbox ~ .border .checkmark, .yellow {
.input-line label:active input#greenCheckbox ~ .border .checkmark { background-color: $light-yellow;
background-color: #0ed277;
} }
.red, .red {
.input-line label input#redCheckbox:checked ~ .border .checkmark { background-color: $light-red;
background-color: #fbd7de;
} }
.input-line label:hover input#redCheckbox ~ .border .checkmark { .input-line label {
background-color: #ef5878; & input {
} &#greenCheckbox:checked ~ .border .checkmark {
background-color: $light-green;
}
.input-line label:focus input#redCheckbox ~ .border .checkmark, &#redCheckbox:checked ~ .border .checkmark {
.input-line label:active input#redCheckbox ~ .border .checkmark { background-color: $light-red;
background-color: #ec3b61; }
}
.yellow, &#yellowCheckbox:checked ~ .border .checkmark {
.input-line label input#yellowCheckbox:checked ~ .border .checkmark { background-color: $light-yellow;
background-color: #fff6d6; }
}
.input-line label:hover input#yellowCheckbox ~ .border .checkmark { &#blueCheckbox:checked ~ .border .checkmark {
background-color: #ffde5d; background-color: $light-blue;
} }
.input-line label:focus input#yellowCheckbox ~ .border .checkmark, }
.input-line label:active input#yellowCheckbox ~ .border .checkmark {
background-color: #ecc31d;
}
.blue, &:hover input {
.input-line label input#blueCheckbox:checked ~ .border .checkmark { &#greenCheckbox ~ .border .checkmark {
background-color: #d4f2fe; background-color: $green;
} }
.input-line label:hover input#blueCheckbox ~ .border .checkmark {
background-color: #4bcffa;
}
.input-line label:focus input#blueCheckbox ~ .border .checkmark, &#redCheckbox ~ .border .checkmark {
.input-line label:active input#blueCheckbox ~ .border .checkmark { background-color: $red;
background-color: #24acda; }
&#yellowCheckbox ~ .border .checkmark {
background-color: $yellow;
}
&#blueCheckbox ~ .border .checkmark {
background-color: $blue;
}
}
&:focus input,
&:active input {
&#greenCHeckbox ~ .border .checkmark {
background-color: $dark-green;
}
&#redCheckbox ~ .border .checkmark {
background-color: $dark-red;
}
&#yellowCheckbox ~ .border .checkmark {
background-color: $dark-yellow;
}
&#blueCheckbox ~ .border .checkmark {
background-color: $dark-blue;
}
}
} }
@include mobile { @include mobile {

View File

@@ -15,8 +15,10 @@ export default {};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/global.scss";
@import "../styles/media-queries.scss";
div { div {
font-family: "knowit"; font-family: Arial;
} }
.outer { .outer {
display: flex; display: flex;
@@ -30,6 +32,7 @@ h2 {
width: 100vw; width: 100vw;
text-align: center; text-align: center;
font-size: 3rem; font-size: 3rem;
font-family: knowit;
} }
form { form {

View File

@@ -39,13 +39,25 @@
</select> </select>
</div> </div>
<div class="label-div"> <div class="label-div">
<input type="text" v-model="winner.wine.name" placeholder="Vin-navn" /> <input
type="text"
v-model="winner.wine.name"
placeholder="Vin-navn"
/>
</div> </div>
<div class="label-div"> <div class="label-div">
<input type="text" v-model="winner.wine.vivinoLink" placeholder="Vivino-link" /> <input
type="text"
v-model="winner.wine.vivinoLink"
placeholder="Vivino-link"
/>
</div> </div>
<div class="label-div"> <div class="label-div">
<input type="text" v-model="winner.wine.rating" placeholder="Rating" /> <input
type="text"
v-model="winner.wine.rating"
placeholder="Rating"
/>
</div> </div>
<hr /> <hr />
</div> </div>
@@ -143,12 +155,16 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/global.scss";
@import "../styles/media-queries.scss";
h1 { h1 {
width: 100vw; width: 100vw;
text-align: center; text-align: center;
font-family: knowit;
} }
div { div {
font-size: 2rem; font-size: 2rem;
font-family: Arial;
} }
input { input {
font-size: 1.5rem; font-size: 1.5rem;

View File

@@ -10,8 +10,6 @@
<PurchaseGraph class="purchase" /> <PurchaseGraph class="purchase" />
<WinGraph class="win" /> <WinGraph class="win" />
</div> </div>
<!-- <img src="/public/assets/images/vipps.png" class="vipps-image" /> -->
<div class="bottom-container"> <div class="bottom-container">
<div class="left-bottom"> <div class="left-bottom">
<TotalBought /> <TotalBought />
@@ -50,18 +48,10 @@ export default {
} }
}; };
</script> </script>
<style lang="scss">
body {
margin: 0;
color: #333333;
font-family: sans-serif;
padding-bottom: 30px;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../styles/global.scss'; @import "../styles/global.scss";
@import '../styles/media-queries.scss'; @import "../styles/media-queries.scss";
.bottom-container { .bottom-container {
display: flex; display: flex;
@@ -70,6 +60,7 @@ body {
margin: auto; margin: auto;
justify-content: space-evenly; justify-content: space-evenly;
align-items: center; align-items: center;
padding: 0 25px;
} }
.left-bottom { .left-bottom {
@@ -104,17 +95,6 @@ body {
} }
} }
@font-face {
font-family: "knowit";
font-weight: 600;
src: url("/../../public/assets/fonts/bold.eot");
}
@font-face {
font-family: "knowit";
font-weight: 300;
src: url("/../../public/assets/fonts/regular.eot");
}
.outer { .outer {
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
@@ -135,6 +115,11 @@ h1 {
width: 100vw; width: 100vw;
text-align: center; text-align: center;
margin-bottom: 0px; margin-bottom: 0px;
@include mobile {
width: 60vw;
margin: auto;
}
} }
.vipps-image { .vipps-image {
@@ -209,7 +194,8 @@ h1 {
} }
.wines-container, .wines-container,
.vipps-outer-container { .vipps-outer-container,
.vipps-container {
margin-left: 0px; margin-left: 0px;
} }
} }

View File

@@ -1,7 +1,20 @@
@import './media-queries.scss'; @import "./media-queries.scss";
@font-face {
font-family: "knowit";
font-weight: 600;
src: url("/../../public/assets/fonts/bold.eot");
}
@font-face {
font-family: "knowit";
font-weight: 300;
src: url("/../../public/assets/fonts/regular.eot");
}
body { body {
font-family: Arial; font-family: Arial;
margin: 0;
} }
.title { .title {

15
src/styles/variables.scss Normal file
View File

@@ -0,0 +1,15 @@
$light-green: #c8f9df;
$green: #0be881;
$dark-green: #0ed277;
$light-blue: #d4f2fe;
$blue: #4bcffa;
$dark-blue: #24acda;
$light-yellow: #fff6d6;
$yellow: #ffde5d;
$dark-yellow: #ecc31d;
$light-red: #fbd7de;
$red: #ef5878;
$dark-red: #ec3b61;

View File

@@ -12,11 +12,10 @@ export default {
async mounted() { async mounted() {
let canvas = this.$refs["purchase-chart"].getContext("2d"); let canvas = this.$refs["purchase-chart"].getContext("2d");
let _response = undefined let _response = undefined;
if (process.env.NODE_ENV == 'development') { if (process.env.NODE_ENV == "development") {
_response = await fetch("http://localhost:30030/api/purchase/statistics"); _response = await fetch("http://localhost:30030/api/purchase/statistics");
} } else {
else {
_response = await fetch("/api/purchase/statistics"); _response = await fetch("/api/purchase/statistics");
} }
let response = await _response.json(); let response = await _response.json();
@@ -112,7 +111,15 @@ export default {
}, },
methods: { methods: {
getPrettierDateString(date) { getPrettierDateString(date) {
return `${date.getDate()}.${date.getMonth() + 1}.${date.getFullYear()}`; return `${this.pad(date.getDate())}.${this.pad(
date.getMonth() + 1
)}.${this.pad(date.getYear() - 100)}`;
},
pad(num) {
if (num < 10) {
return `0${num}`;
}
return num;
} }
} }
}; };
@@ -121,14 +128,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/media-queries.scss"; @import "../styles/media-queries.scss";
.chartjsLegend li span {
display: inline-block;
width: 12px;
height: 12px;
margin-right: 5px;
border-radius: 25px;
}
.chart { .chart {
height: 40vh; height: 40vh;

View File

@@ -98,6 +98,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/variables.scss";
@import "../styles/media-queries.scss"; @import "../styles/media-queries.scss";
.inner-bought-container { .inner-bought-container {
@@ -134,6 +135,10 @@ export default {
margin: auto; margin: auto;
justify-content: space-between; justify-content: space-between;
font-family: Arial; font-family: Arial;
@include mobile {
padding-bottom: 0px;
}
} }
.green, .green,
@@ -146,19 +151,19 @@ export default {
} }
.green { .green {
color: #10e783; color: $green;
} }
.red { .red {
color: #ef5878; color: $red;
} }
.yellow { .yellow {
color: #ffde5d; color: $yellow;
} }
.blue { .blue {
color: #57d2fb; color: $blue;
} }
@include mobile { @include mobile {

View File

@@ -13,8 +13,10 @@
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/global.scss";
@import "../styles/media-queries.scss";
.vipps-container { .vipps-container {
font-family: sans-serif; font-family: Arial;
} }
.vipps-container { .vipps-container {
@@ -57,4 +59,10 @@
font-weight: 600; font-weight: 600;
font-size: 1rem; font-size: 1rem;
} }
@include mobile {
.vipps-container {
margin-left: 0px;
}
}
</style> </style>

View File

@@ -9,11 +9,12 @@ export default {
async mounted() { async mounted() {
let canvas = this.$refs["win-chart"].getContext("2d"); let canvas = this.$refs["win-chart"].getContext("2d");
let _response = undefined let _response = undefined;
if (process.env.NODE_ENV == 'development') { if (process.env.NODE_ENV == "development") {
_response = await fetch("http://localhost:30030/api/purchase/statistics/color"); _response = await fetch(
} "http://localhost:30030/api/purchase/statistics/color"
else { );
} else {
_response = await fetch("/api/purchase/statistics/color"); _response = await fetch("/api/purchase/statistics/color");
} }
let response = await _response.json(); let response = await _response.json();

View File

@@ -42,7 +42,7 @@ h3 {
} }
div { div {
margin: 15px 0 0 0; margin: 15px 0 0 0;
font-family: "knowit"; font-family: arial;
display: inline-flex; display: inline-flex;
flex-direction: column; flex-direction: column;
} }