Skip to content

Commit

Permalink
docs(SystemBar): enable for vueschool sale
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Jun 11, 2021
1 parent c05f703 commit 02c828a
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions packages/docs/src/layouts/default/SystemBar.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<v-system-bar
v-if="hasPromotion"
:style="{ background: `linear-gradient(to right, #04091D 45%, ${hasAltPromotion ? '#1D408C' : '#7A3FAB'})` }"
color="#1A265A"
app
dark
height="76"
>
<a
:class="[`cm-banner${hasAltPromotion ? '-alt' : ''}`]"
href="https://vueschool.io/free-weekend/?friend=vuetify"
class="cm-banner"
href="https://vueschool.io/sales/summer-vue?friend=vuetify"
rel="noopener"
target="_blank"
@click="onClick"
Expand All @@ -28,7 +28,7 @@

<script>
// Utilities
// import { differenceInHours, isBefore } from 'date-fns'
import { differenceInHours } from 'date-fns'
import { get, sync } from 'vuex-pathify'
export default {
Expand All @@ -37,25 +37,20 @@
computed: {
last: sync('user/last@promotion'),
name: get('route/name'),
hasAltPromotion () {
return true
},
hasPromotion () {
return false
// const now = Date.now()
const now = Date.now()
// return (
// isBefore(now, new Date(2021, 3, 29)) &&
// differenceInHours(now, Number(this.last)) > 1
// )
return (
differenceInHours(now, Number(this.last)) > 1
)
},
},
methods: {
onClick () {
this.$gtag.event('click', {
event_category: 'vuetify-banner',
event_label: 'vue-masterschool-free',
event_label: 'vue-school-summer-vue',
value: this.name.toLowerCase(),
})
},
Expand All @@ -67,8 +62,7 @@
</script>

<style lang="sass">
.cm-banner,
.cm-banner-alt
.cm-banner
background-position: center
background-repeat: no-repeat
background-size: contain
Expand All @@ -84,20 +78,11 @@
white-space: nowrap
.cm-banner
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/free-vue-masterclass/vueschool-mobile.png)
@media (min-width: 660px)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/free-vue-masterclass/vueschool-tablet.png)
@media (min-width: 992px)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/free-vue-masterclass/vueschool-desktop.png)
.cm-banner-alt
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/free-vue-masterclass/vs-2-mobile.png)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/vs-summer-sale-2021/vs-summer-mobile.png)
@media (min-width: 660px)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/free-vue-masterclass/vs-2-tablet.png)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/vs-summer-sale-2021/vs-summer-tablet.png)
@media (min-width: 992px)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/free-vue-masterclass/vs-2-desktop.png)
background-image: url(https://cdn.vuetifyjs.com/docs/images/promotions/vs-summer-sale-2021/vs-summer-desktop.png)
</style>

0 comments on commit 02c828a

Please sign in to comment.