Skip to content

Commit 17bd491

Browse files
authored
Vuejsde conf banner september 16 22 2024 (#2798)
1 parent 9c3535f commit 17bd491

11 files changed

+48
-17
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;(() => {
1+
; (() => {
22
const restore = (key, cls, def = false) => {
33
const saved = localStorage.getItem(key)
44
if (saved ? saved !== 'false' : def) {
@@ -8,6 +8,6 @@
88
restore('vue-docs-prefer-composition', 'prefer-composition', true)
99
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)
1010

11-
// window.__VUE_BANNER_ID__ = ''
12-
// restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
11+
window.__VUE_BANNER_ID__ = 'vuejsdeconf2024-promo-september'
12+
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

β€Ž.vitepress/theme/components/Banner.vue

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,31 @@ function dismiss() {
2121
</script>
2222

2323
<template>
24-
<div class="banner" v-if="open">
25-
<a target="_blank"></a>
26-
<button @click="dismiss">
24+
<div class="banner banner-vuejsconf" v-if="open">
25+
<a href="https://conf.vuejs.de/tickets/?voucher=VUEJS_SPECIAL_OFFER&utm_source=vuejs&utm_medium=referral&utm_campaign=banner-placement&utm_content=banner"
26+
target="_blank">
27+
<picture>
28+
<source media="(min-width:1260px)"
29+
srcset="/vuejsde-conf/vuejsdeconf_banner_large.png, /vuejsde-conf/vuejsdeconf_banner_large_2x.png 2x" />
30+
<source media="(min-width:970px)"
31+
srcset="/vuejsde-conf/vuejsdeconf_banner_medium.png, /vuejsde-conf/vuejsdeconf_banner_medium_2x.png 2x" />
32+
<source media="(min-width:576px)"
33+
srcset="/vuejsde-conf/vuejsdeconf_banner_small.png, /vuejsde-conf/vuejsdeconf_banner_small_2x.png 2x" />
34+
<source media="(min-width:320px)"
35+
srcset="/vuejsde-conf/vuejsdeconf_banner_smallest.png, /vuejsde-conf/vuejsdeconf_banner_smallest_2x.png 2x"
36+
alt="" />
37+
<img src="/vuejsde-conf/vuejsdeconf_banner_smallest_2x.png" alt="" />
38+
</picture>
39+
</a>
40+
<div class="close-btn" @click.stop.prevent="dismiss">
2741
<VTIconPlus class="close" />
28-
</button>
42+
</div>
2943
</div>
3044
</template>
3145

3246
<style>
3347
html:not(.banner-dismissed) {
34-
--vt-banner-height: 30px;
48+
--vt-banner-height: 72px;
3549
}
3650
</style>
3751

@@ -50,12 +64,10 @@ html:not(.banner-dismissed) {
5064
font-weight: 600;
5165
color: #fff;
5266
background-color: var(--vt-c-green);
53-
background: linear-gradient(
54-
90deg,
55-
rgba(66, 184, 131, 1) 0%,
56-
rgba(39, 179, 137, 1) 19%,
57-
rgba(100, 126, 255, 1) 100%
58-
);
67+
background: linear-gradient(90deg,
68+
rgba(66, 184, 131, 1) 0%,
69+
rgba(39, 179, 137, 1) 19%,
70+
rgba(100, 126, 255, 1) 100%);
5971
}
6072
6173
.banner-dismissed .banner {
@@ -76,9 +88,28 @@ button {
7688
.close {
7789
width: 20px;
7890
height: 20px;
79-
fill: #fff;
91+
fill: #000;
8092
transform: rotate(45deg);
8193
}
94+
95+
.banner-vuejsconf {
96+
background: linear-gradient(90deg, #fff 50%, #6f97c4 50%);
97+
}
98+
99+
.banner-vuejsconf a {
100+
display: inline-block;
101+
margin: 0 auto;
102+
}
103+
104+
.banner-vuejsconf .close-btn {
105+
top: 0px;
106+
left: 0px;
107+
z-index: 99;
108+
position: absolute;
109+
border-radius: 50%;
110+
cursor: pointer;
111+
}
112+
82113
/*
83114
@media (max-width: 720px) {
84115
a > span {

β€Ž.vitepress/theme/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import {
1010
} from './components/preferences'
1111
import SponsorsAside from './components/SponsorsAside.vue'
1212
import VueSchoolLink from './components/VueSchoolLink.vue'
13-
// import Banner from './components/Banner.vue'
13+
import Banner from './components/Banner.vue'
1414
// import TextAd from './components/TextAd.vue'
1515

1616
export default Object.assign({}, VPTheme, {
1717
Layout: () => {
1818
// @ts-ignore
1919
return h(VPTheme.Layout, null, {
20-
// banner: () => h(Banner),
20+
banner: () => h(Banner),
2121
'sidebar-top': () => h(PreferenceSwitch),
2222
'sidebar-bottom': () => h(SecurityUpdateBtn),
2323
'aside-mid': () => h(SponsorsAside)
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
Β (0)