Skip to content

Commit 63b8169

Browse files
authored
Update Free Weekend Vue School banner to point to offer landing page (vuejs#1985)
* Update Free Weekend Vue School banner to point to offer landing page * Update Free Weekend Vue School banner copy
1 parent d7c2802 commit 63b8169

File tree

1 file changed

+14
-121
lines changed

1 file changed

+14
-121
lines changed

.vitepress/theme/components/Banner.vue

Lines changed: 14 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { computed } from 'vue'
2+
import { ref } from 'vue'
33
44
/**
55
* Adding a new banner:
@@ -10,72 +10,13 @@ import { computed } from 'vue'
1010
1111
let open = $ref(true)
1212
13-
const items = [
14-
{
15-
banner: {
16-
assets: "FREE_WEEKEND",
17-
cta: "JOIN FOR FREE",
18-
link: "/free-weekend",
19-
static: "FREE_WEEKEND",
20-
subtitle: "Get Access to ALL Vue School premium courses",
21-
title: "Free Weekend 1st & 2nd of October"
22-
},
23-
ends: "2022-09-30T23:59:59+02:00",
24-
id: "FREE_WEEKEND_LOBBY",
25-
isExtended: false
26-
},
27-
{
28-
banner: {
29-
assets: "FREE_WEEKEND",
30-
cta: "WATCH FOR FREE",
31-
link: "/free-weekend",
32-
static: "FREE_WEEKEND_LIVE",
33-
subtitle: "Get Access to ALL Vue School premium courses",
34-
title: "Free Weekend <strong>NOW LIVE</strong>"
35-
},
36-
ends: "2022-10-02T23:59:59+02:00",
37-
id: "FREE_WEEKEND_LIVE",
38-
isExtended: false
39-
},
40-
{
41-
banner: {
42-
assets: "LEVELUP2022",
43-
cta: "GET OFFER",
44-
link: "/sales/levelup2022",
45-
static: "LEVELUP2022",
46-
subtitle: "Access 800+ lessons including the Vue.js 3 Masterclass",
47-
title: "Less than <strong>_HOURS_ hours</strong> to get 45% off at Vue School"
48-
},
49-
ends: "2022-10-04T23:59:59+02:00",
50-
id: "LEVELUP2022",
51-
isExtended: false
52-
},
53-
{
54-
banner: {
55-
assets: "LEVELUP2022",
56-
cta: "GET OFFER",
57-
link: "/sales/levelup2022",
58-
static: "LEVELUP2022",
59-
subtitle: "Extended! Access 800+ lessons including the Vue.js 3 Masterclass",
60-
title: "Less than <strong>_HOURS_ hours</strong> to get 45% off at Vue School"
61-
},
62-
ends: "2022-10-06T23:59:59+02:00",
63-
id: "LEVELUP2022_EXTENDED",
64-
isExtended: true
65-
}
66-
]
67-
68-
const now = new Date()
69-
const phases = computed(() => items.map(phase => ({ ...phase, remaining: new Date(phase.ends) - now })))
70-
const activePhase = computed(() => phases.value.find(phase => phase.remaining > 0))
71-
const title = computed(() => {
72-
if (!activePhase.value) return null
73-
const hours = Math.ceil(activePhase.value.remaining / 1000 / 60 / 60)
74-
return activePhase.value.banner.title.replace('_HOURS_', hours)
75-
})
76-
const activeBanner = computed(() => {
77-
if (!activePhase.value) return null
78-
return activePhase.value.banner
13+
const banner = ref({
14+
assets: "LEVELUP2022",
15+
cta: "GET OFFER",
16+
link: "/sales/levelup2022",
17+
static: "LEVELUP2022",
18+
subtitle: "Access 800+ lessons including the Vue.js 3 Masterclass",
19+
title: "Less than <strong>48 hours</strong> to get 45% off at Vue School"
7920
})
8021
8122
/**
@@ -89,22 +30,22 @@ function dismiss() {
8930
</script>
9031

9132
<template>
92-
<div class="banner" v-if="open && activeBanner">
33+
<div class="banner" v-if="open">
9334
<a
9435
id="vs-top"
95-
:href="`https://vueschool.io${activeBanner.link}?friend=vuejs&utm_source=vuejs&utm_medium=website&utm_campaign=affiliate&utm_content=top_banner`"
36+
:href="`https://vueschool.io${banner.link}?friend=vuejs&utm_source=vuejs&utm_medium=website&utm_campaign=affiliate&utm_content=top_banner`"
9637
target="_blank"
97-
:class="activeBanner.assets">
38+
:class="banner.assets">
9839
<div class="vs-background-wrapper">
9940
<div class="vs-logo" />
10041
<div class="vs-core">
10142
<div class="vs-slogan-wrapper">
102-
<div class="vs-slogan" v-html="title" />
103-
<div class="vs-subline" v-html="activeBanner.subtitle" />
43+
<div class="vs-slogan" v-html="banner.title" />
44+
<div class="vs-subline" v-html="banner.subtitle" />
10445
</div>
10546
<div class="vs-button-wrapper">
10647
<div class="vs-button">
107-
{{ activeBanner.cta }}
48+
{{ banner.cta }}
10849
</div>
10950
</div>
11051
</div>
@@ -260,54 +201,6 @@ html:not(.banner-dismissed) {
260201
}
261202
}
262203
263-
/* FREE_WEEKEND
264-
******************************************/
265-
266-
#vs-top.FREE_WEEKEND {
267-
color: #FFF;
268-
background: linear-gradient(to left, #161a35, #283065);
269-
}
270-
271-
#vs-top.FREE_WEEKEND .vs-logo {
272-
background-image: url(https://vueschool.io/images/mark-vueschool-white.svg);
273-
}
274-
275-
#vs-top.FREE_WEEKEND .vs-core .vs-slogan {
276-
color: #fff;
277-
}
278-
279-
#vs-top.FREE_WEEKEND .vs-core .vs-slogan strong {
280-
color: #ff2556;
281-
}
282-
283-
#vs-top.FREE_WEEKEND .vs-core .vs-subline {
284-
color: #c6cdf7;
285-
}
286-
287-
#vs-top.FREE_WEEKEND .vs-background-wrapper {
288-
background-image: url(https://vueschool.io/images/banners/assets/FREE_WEEKEND/bg-mobile.png);
289-
background-repeat: no-repeat;
290-
background-size: cover;
291-
background-position: top right;
292-
}
293-
294-
@media (min-width: 680px) {
295-
#vs-top.FREE_WEEKEND .vs-background-wrapper {
296-
background-image: url(https://vueschool.io/images/banners/assets/FREE_WEEKEND/bg-tablet.svg);
297-
}
298-
}
299-
300-
@media (min-width: 1280px) {
301-
#vs-top.FREE_WEEKEND .vs-logo {
302-
background-image: url(https://vueschool.io/images/icons/logo-white.svg);
303-
}
304-
305-
#vs-top.FREE_WEEKEND .vs-background-wrapper {
306-
background-image: url(https://vueschool.io/images/banners/assets/FREE_WEEKEND/bg-desktop.svg);
307-
background-position: top right -60px;
308-
}
309-
}
310-
311204
/* LEVELUP2022
312205
******************************************/
313206

0 commit comments

Comments
 (0)