Merge branch 'master' into feat/personal-highscore

This commit is contained in:
2020-10-11 18:18:44 +02:00
committed by GitHub
10 changed files with 77 additions and 28 deletions

View File

@@ -1,10 +1,5 @@
const path = require('path');
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/vinlottis', {
useNewUrlParser: true
})
const Highscore = require(path.join(__dirname + '/../schemas/Highscore'));
const Wine = require(path.join(__dirname + '/../schemas/Wine'));

View File

@@ -1,8 +1,4 @@
const path = require("path");
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/vinlottis", {
useNewUrlParser: true
});
const Purchase = require(path.join(__dirname + "/../schemas/Purchase"));
const Wine = require(path.join(__dirname + "/../schemas/Wine"));

View File

@@ -2,13 +2,8 @@ const express = require("express");
const path = require("path");
const router = express.Router();
const webpush = require("web-push"); //requiring the web-push module
const mongoose = require("mongoose");
const schedule = require("node-schedule");
mongoose.connect("mongodb://localhost:27017/vinlottis", {
useNewUrlParser: true
});
const mustBeAuthenticated = require(path.join(
__dirname + "/../middleware/mustBeAuthenticated"
));

View File

@@ -1,9 +1,5 @@
const express = require("express");
const path = require("path");
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/vinlottis", {
useNewUrlParser: true
});
const sub = require(path.join(__dirname + "/../api/subscriptions"));

View File

@@ -11,6 +11,7 @@
<script>
import { page, event } from "vue-analytics";
import { prelottery } from "@/api";
import Banner from "@/ui/Banner";
import Wine from "@/ui/Wine";
@@ -25,8 +26,7 @@ export default {
};
},
async mounted() {
const _wines = await fetch("/api/wines/prelottery");
this.wines = await _wines.json();
prelottery().then(wines => this.wines = wines);
}
};
</script>

View File

@@ -29,7 +29,7 @@
</template>
<script>
import { getAmIWinner, postWineChosen } from "@/api";
import { getAmIWinner, postWineChosen, prelottery } from "@/api";
import Wine from "@/ui/Wine";
export default {
components: { Wine },
@@ -60,8 +60,7 @@ export default {
}
this.turn = true;
this.name = winnerObject.name;
const _wines = await fetch("/api/wines/prelottery");
this.wines = await _wines.json();
this.wines = await prelottery();
},
methods: {
chosenWine: async function(name) {

View File

@@ -133,6 +133,15 @@ textarea {
// disable-dbl-tap-zoom
touch-action: manipulation;
&.auto-height {
height: auto;
}
&.danger {
background-color: $red;
color: white;
}
&::after {
content: "";
position: absolute;
@@ -176,9 +185,14 @@ textarea {
font-weight: bold;
border-bottom: 1px solid $link-color;
font-size: 1rem;
margin-left: 15px;
cursor: pointer;
text-decoration: none;
color: $matte-text-color;
&:focus, &:hover {
border-color: $link-color;
}
}
@@ -186,8 +200,35 @@ textarea {
&-md {
margin-top: 3rem;
}
&-sm {
margin-top: 1rem;
}
&-0 {
margin-top: 0;
}
}
.margin-left {
&-md {
margin-left: 3rem;
}
&-sm {
margin-left: 1rem;
}
&-0 {
margin-left: 0;
}
}
.margin-right {
&-md {
margin-right: 3rem;
}
&-sm {
margin-right: 1rem;
}
&-0 {
margin-right: 0;
}
}
.margin-bottom {
&-md {
margin-bottom: 3rem;
@@ -230,3 +271,15 @@ textarea {
background-color: $light-red;
}
}
.desktop-only {
@include mobile {
display: none;
}
}
.mobile-only {
@include desktop {
display: none;
}
}

View File

@@ -1,6 +1,6 @@
$mobile-width: 768px;
$tablet-max: 1200px;
$desktop-max: 1704;
$desktop-max: 2004px;
@mixin mobile {
@@ -15,7 +15,6 @@ $desktop-max: 1704;
}
}
@mixin desktop {
@media (min-width: #{$tablet-max + 1px}) {
@content;

View File

@@ -19,6 +19,12 @@
&.justify-space-between {
justify-content: space-between;
}
&.justify-end {
justify-content: flex-end;
}
&.justify-start {
justify-content: flex-start;
}
&.align-center {
align-items: center;
@@ -28,3 +34,13 @@
.inline-block {
display: inline-block;
}
.float {
&-left {
float: left;
}
&-right {
float: right;
}
}

View File

@@ -1,4 +1,4 @@
$primary: #dbeede;
$primary: #b7debd;
$light-green: #c8f9df;
$green: #0be881;