dark support for intro background

pull/388/head
cagataycivici 2020-07-05 14:31:20 +03:00
parent 36b86dd083
commit 5b0fcfa592
2 changed files with 28 additions and 2 deletions

View File

@ -11,13 +11,17 @@
.introduction { .introduction {
background-color: var(--surface-a); background-color: var(--surface-a);
background: url('./assets/images/home/intro-bg.jpg'); background-image: url('./assets/images/home/intro-bg.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
padding: 115px 30px 135px 50px; padding: 115px 30px 135px 50px;
color: #455C71; color: #455C71;
position: relative; position: relative;
&.introduction-dark {
background-blend-mode: color-burn;
}
.introduction-promo { .introduction-promo {
display: inline-block; display: inline-block;
margin-left: -50px; margin-left: -50px;

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="home"> <div class="home">
<div class="introduction"> <div :class="introductionClass">
<span class="introduction-promo"> <span class="introduction-promo">
<img alt="Gold Sponsor" src="../assets/images/home/vue-gold.png" /> <img alt="Gold Sponsor" src="../assets/images/home/vue-gold.png" />
<span>Vue.js Gold Sponsor</span> <span>Vue.js Gold Sponsor</span>
@ -211,7 +211,14 @@
</template> </template>
<script> <script>
import EventBus from '@/EventBus';
export default { export default {
data() {
return {
dark: false
}
},
mounted() { mounted() {
let afId = this.$route.query['af_id']; let afId = this.$route.query['af_id'];
if (afId) { if (afId) {
@ -221,6 +228,21 @@ export default {
document.cookie = 'primeaffiliateid=' + afId + ';expires=' + expire.toUTCString() + ';path=/; domain:primefaces.org'; document.cookie = 'primeaffiliateid=' + afId + ';expires=' + expire.toUTCString() + ';path=/; domain:primefaces.org';
} }
EventBus.$on('change-theme', event => {
if (event.dark)
this.dark = true;
else
this.dark = false;
});
},
beforeDestroy() {
EventBus.$off('change-theme');
},
computed: {
introductionClass() {
return ['introduction', {'introduction-dark': this.dark}];
} }
}
} }
</script> </script>