Page styles re-written and updated!

This commit is contained in:
2020-12-31 17:28:55 +01:00
parent d59d6fbd6c
commit 30b63a8e61

View File

@@ -1,48 +1,60 @@
<template> <template>
<div> <div>
<header ref="header">
<div class="container">
<div class="left">
<h1 class="title">Virtuelt lotteri</h1> <h1 class="title">Virtuelt lotteri</h1>
<h2 <ol>
v-if=" <li>Vurder om du ønsker å bruke vår <router-link to="/generate" class="vin-link">loddgenerator</router-link>, eller se <router-link to="/dagens" class="vin-link">dagens fangst.</router-link></li>
attendees.length <= 0 && <li>Send vipps med melding "Vinlotteri" for å bli registrert til virtuelt lotteri.</li>
winners.length <= 0 && <li>Send gjerne melding om fargeønske også.</li>
attendeesFetched && </ol>
winnersFetched
" <p>
>Her var det lite.. Sikker på at det er en virtuell trekning nå?</h2> <span class="vin-link">Følg med utviklingen</span> og <span class="vin-link">chat om trekningen</span>
<div class="title-info"> <i class="icon icon--arrow-left" @click="scrollToContent"></i></p>
<h2>Send vipps med melding "Vinlotteri" for å bli registrert til virtuelt lotteri</h2>
<p>Send gjerne melding om fargeønsker også</p>
</div> </div>
<router-link to="/dagens" class="generate-link" v-if="todayExists"> <div class="right">
Lurer du på dagens fangst? <Vipps :amount="1" />
<span class="subtext generator-link">Se her</span>
</router-link>
<hr />
<h2>Live oversikt av lodd kjøp i dag</h2>
<div class="colors">
<div v-for="color in Object.keys(ticketsBought)" :class="color + ' colors-box'" :key="color">
<div class="colors-overlay">
<p>{{ ticketsBought[color] }} kjøpt</p>
</div>
</div> </div>
</div> </div>
</header>
<div class="container" ref="content">
<WinnerDraw <WinnerDraw
:currentWinnerDrawn="currentWinnerDrawn" :currentWinnerDrawn="currentWinnerDrawn"
:currentWinner="currentWinner" :currentWinner="currentWinner"
:attendees="attendees" :attendees="attendees"
/> />
<Winners :winners="winners" /> <div class="todays-raffles">
<hr /> <h2>Liste av lodd kjøpt i dag</h2>
<div class="middle-elements">
<Attendees :attendees="attendees" class="outer-attendees" /> <div class="raffle-container">
<Chat class="outer-chat" /> <div v-for="color in Object.keys(ticketsBought)" :class="color + '-raffle raffle-element'" :key="color">
<span>{{ ticketsBought[color] }}</span>
</div>
</div>
</div>
<Winners :winners="winners" class="winners" :drawing="currentWinner" />
<div class="container-attendees">
<h2>Deltakere ({{ attendees.length }})</h2>
<Attendees :attendees="attendees" class="attendees" />
</div>
<div class="container-chat">
<h2>Chat</h2>
<Chat class="chat" />
</div>
</div>
<div class="container wines-container">
<h2>Dagens fangst</h2>
<Wine :wine="wine" v-for="wine in wines" :key="wine" />
</div> </div>
<Vipps class="vipps" :amount="1" />
</div> </div>
</template> </template>
@@ -139,6 +151,20 @@ export default {
} }
this.attendeesFetched = true; this.attendeesFetched = true;
}, },
scrollToContent() {
console.log(window.scrollY)
const intersectingHeaderHeight = this.$refs.header.getBoundingClientRect().bottom - 50;
const { scrollY } = window;
let scrollHeight = intersectingHeaderHeight;
if (scrollY > 0) {
scrollHeight = intersectingHeaderHeight + scrollY;
}
window.scrollTo({
top: scrollHeight,
behavior: "smooth"
});
},
track() { track() {
window.ga('send', 'pageview', '/lottery/game'); window.ga('send', 'pageview', '/lottery/game');
} }
@@ -146,241 +172,149 @@ export default {
}; };
</script> </script>
<!-- TODO move link styling to global with more generic name -->
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../styles/global.scss"; @import "../styles/global.scss";
@import "../styles/variables.scss"; @import "../styles/variables.scss";
@import "../styles/media-queries.scss"; @import "../styles/media-queries.scss";
.generate-link {
color: #333333;
text-decoration: none;
display: block;
width: 100vw;
text-align: center;
margin-bottom: 0px;
@include mobile { .container {
width: 60vw; width: 80vw;
margin: auto; padding: 0 10vw;
}
display: grid;
grid-template-columns: repeat(4, 1fr);
} }
.vipps-image { h2 {
width: 250px; font-size: 1.1rem;
margin: auto; margin-bottom: 1.75rem;
display: block;
margin-top: 30px;
} }
.generator-link { header {
font-weight: bold; background-color: $primary;
border-bottom: 1px solid $link-color; padding-bottom: 3rem;
} margin-bottom: 3rem;
</style>
<style lang="scss" scoped> .left {
@import "../styles/global.scss"; grid-column: 1 / 4;
@import "../styles/variables.scss";
@import "../styles/media-queries.scss";
.color-selector {
margin-bottom: 0.65rem;
margin-right: 1rem; margin-right: 1rem;
@include desktop { @include mobile {
min-width: 175px; grid-column: 1 / 5;
margin-right: 0;
} }
}
.right {
grid-column: 4;
@include mobile { @include mobile {
max-width: 25vw; display: none;
}
.active {
border: 2px solid unset;
&.green {
border-color: $green;
}
&.blue {
border-color: $dark-blue;
}
&.red {
border-color: $red;
}
&.yellow {
border-color: $dark-yellow;
} }
} }
button { h1 {
border: 2px solid transparent; text-align: left !important;
display: inline-flex; font-weight: 500 !important;
flex-wrap: wrap; font-size: 3rem;
flex-direction: row; margin: 4rem 0 2rem !important;
height: 2.5rem;
width: 2.5rem;
// disable-dbl-tap-zoom
touch-action: manipulation;
@include mobile {
margin: 2px;
} }
&.green { ol {
background: #c8f9df; font-size: 1.4rem;
line-height: 3rem;
color: $matte-text-color;
} }
&.blue {
background: #d4f2fe;
}
&.red {
background: #fbd7de;
}
&.yellow {
background: #fff6d6;
}
}
}
.colors {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
max-width: 1400px;
margin: 0 auto;
@include mobile {
margin: 1.8rem auto 0;
}
.label-div {
margin-top: 0.5rem;
width: 100%;
}
}
.colors-box {
width: 150px;
height: 150px;
margin: 20px;
-webkit-mask-image: url(/public/assets/images/lodd.svg);
background-repeat: no-repeat;
mask-image: url(/public/assets/images/lodd.svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
@include mobile {
width: 120px;
height: 120px;
margin: 10px;
}
}
.colors-overlay {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
padding: 0 0.25rem;
position: relative;
p { p {
width: 70%; font-size: 1.4rem;
border: 0; line-height: 2rem;
padding: 0; margin-top: 0;
font-size: 1.5rem; position: relative;
height: unset;
max-height: unset;
@include mobile { .vin-link {
font-size: 1.3rem; cursor: default !important;
} }
.icon {
position: absolute;
bottom: 3px;
color: $link-color;
margin-left: 0.5rem;
display: inline-block;
transform: rotate(-90deg);
cursor: pointer;
}
}
.vin-link {
font-weight: 400 !important;
border-width: 2px;
} }
} }
.green, .todays-raffles {
.green .colors-overlay > input { grid-column: 1;
background-color: $light-green;
color: $green;
} }
.blue, .raffle-container {
.blue .colors-overlay > input { width: 165px;
background-color: $light-blue; height: 175px;
color: $blue;
}
.yellow,
.yellow .colors-overlay > input {
background-color: $light-yellow;
color: $yellow;
}
.red,
.red .colors-overlay > input {
background-color: $light-red;
color: $red;
}
</style>
<style lang="scss" scoped>
@import "../styles/global.scss";
@import "../styles/variables.scss";
@import "../styles/media-queries.scss";
hr {
width: 80%;
}
h1,
h2 {
text-align: center;
}
.current-draw {
margin: auto;
}
.title-info {
width: 100%;
text-align: center;
}
.outer-chat {
margin: 0 60px 0 10px;
@include mobile {
margin: 0;
}
}
.outer-attendees {
margin: 0 10px 0 45px;
@include mobile {
margin: 0;
}
}
.center-new-winner {
margin: auto !important;
}
.middle-elements {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
.raffle-element {
font-size: 1.6rem;
color: $matte-text-color;
height: 75px;
width: 75px;
display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 400px;
@include mobile { margin: 0;
height: auto;
flex-direction: column;
} }
} }
.vipps { .winners {
margin-top: 70px; grid-column: 2 / 5;
display: flex; }
padding-bottom: 50px;
justify-content: center; .container-attendees {
@include mobile { grid-column: 1 / 3;
flex-direction: column; margin-right: 1rem;
margin-top: 2rem;
}
.attendees {
padding: 2rem;
-webkit-box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.15);
box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.15);
}
.container-chat {
grid-column: 3 / 5;
margin-left: 1rem;
margin-top: 2rem;
}
.chat {
padding: 2rem;
-webkit-box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.15);
box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.15);
}
.wines-container {
margin-bottom: 4rem;
h2 {
grid-column: 1 / 5;
} }
} }
</style> </style>