Skip to content

Commit 294c48d

Browse files
authored
feat: add vuejsde conf 2024 banner (vuejs#2797)
1 parent 680c9a8 commit 294c48d

File tree

5 files changed

+26
-73
lines changed

5 files changed

+26
-73
lines changed
Lines changed: 2 additions & 2 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__ = 'vueconfus2024'
11+
window.__VUE_BANNER_ID__ = 'vuejsdeconf2024-promo-may'
1212
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

.vitepress/theme/components/Banner.vue

Lines changed: 24 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,18 @@ function dismiss() {
2121
</script>
2222

2323
<template>
24-
<div class="banner" v-if="open">
25-
<p class="vt-banner-text">
26-
<span class="vt-text-primary">VueConf US</span>
27-
<span class="vt-tagline"> - Join the official Vue.js conference</span>
28-
| May 15-17, 2024 <span class="vt-place"> - New Orleans, USA</span>
29-
<a
30-
target="_blank"
31-
class="vt-primary-action"
32-
href="https://vueconf.us?utm_source=vuejs&utm_content=top_banner"
33-
>Register <span class="vt-time-now">Now</span></a
34-
>
35-
</p>
36-
<button @click="dismiss">
24+
<div class="banner banner-vuejsconf" v-if="open">
25+
<a href="https://conf.vuejs.de/?utm_source=vuejs&utm_medium=referral&utm_campaign=banner-placement&utm_content=banner"
26+
target="_blank">
27+
<picture>
28+
<source media="(min-width:1200px)" srcset="/vuejsde-conf/vuejsdeconf_banner_large.png" />
29+
<source media="(min-width:920px)" srcset="/vuejsde-conf/vuejsdeconf_banner_medium.png" />
30+
<img src="/vuejsde-conf/vuejsdeconf_banner_small.png" alt="" />
31+
</picture>
32+
</a>
33+
<div class="close-btn" @click.stop.prevent="dismiss">
3734
<VTIconPlus class="close" />
38-
</button>
39-
<p class="vt-banner-text vt-coupon">
40-
<span class="vt-text-primary">Use code</span> VUEJSDOCS
41-
<span class="vt-text-primary">to get $100 off!</span>
42-
</p>
35+
</div>
4336
</div>
4437
</template>
4538

@@ -64,10 +57,6 @@ html:not(.banner-dismissed) {
6457
font-weight: 600;
6558
color: #fff;
6659
background-color: var(--vt-c-green);
67-
background: #11252b;
68-
display: flex;
69-
justify-content: center;
70-
align-items: center;
7160
}
7261
7362
.banner-dismissed .banner {
@@ -92,58 +81,22 @@ button {
9281
transform: rotate(45deg);
9382
}
9483
95-
.vt-banner-text {
96-
color: #fff;
97-
font-size: 16px;
84+
.banner-vuejsconf {
85+
background: linear-gradient(90deg, #fff 50%, #43b883 50%);
9886
}
9987
100-
.vt-text-primary {
101-
color: #75c05e;
88+
.banner-vuejsconf a {
89+
display: inline-block;
90+
margin: 0 auto;
10291
}
10392
104-
.vt-primary-action {
105-
background: #75c05e;
106-
color: #121c1a;
107-
padding: 8px 15px;
108-
border-radius: 5px;
109-
font-size: 14px;
110-
text-decoration: none;
111-
margin: 0 20px;
112-
font-weight: bold;
113-
}
114-
.vt-primary-action:hover {
115-
text-decoration: none;
116-
background: #5a9f45;
117-
}
118-
119-
@media (max-width: 1280px) {
120-
.banner .vt-banner-text {
121-
font-size: 14px;
122-
}
123-
.vt-tagline {
124-
display: none;
125-
}
126-
}
127-
128-
@media (max-width: 780px) {
129-
.vt-tagline {
130-
display: none;
131-
}
132-
.vt-coupon {
133-
display: none;
134-
}
135-
.vt-primary-action {
136-
margin: 0 10px;
137-
padding: 7px 10px;
138-
}
139-
.vt-time-now {
140-
display: none;
141-
}
142-
}
143-
144-
@media (max-width: 560px) {
145-
.vt-place {
146-
display: none;
147-
}
93+
.banner-vuejsconf .close-btn {
94+
top: 10px;
95+
right: 10px;
96+
z-index: 99;
97+
position: absolute;
98+
border-radius: 50%;
99+
padding: 10px;
100+
cursor: pointer;
148101
}
149102
</style>
Loading
Loading
Loading

0 commit comments

Comments
 (0)