Skip to content

Commit 1e78e50

Browse files
author
Joe Ray Gregory
authored
Add vuejs.de conf promotion for one week (#1872)
1 parent dbdabb3 commit 1e78e50

File tree

7 files changed

+51
-12
lines changed

7 files changed

+51
-12
lines changed

.vitepress/inlined-scripts/restorePreference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
restore('vue-docs-prefer-composition', 'prefer-composition')
99
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)
1010

11-
window.__VUE_BANNER_ID__ = 'wip'
11+
window.__VUE_BANNER_ID__ = 'vuejsdeConf2022'
1212
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

.vitepress/theme/components/Banner.vue

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,32 @@ function dismiss() {
1919
</script>
2020

2121
<template>
22-
<div class="banner" v-if="open">
23-
Vue 3 is now the new default version!
24-
<a
25-
href="https://blog.vuejs.org/posts/vue-3-as-the-new-default.html"
26-
target="_blank"
27-
>Learn more</a
28-
>
22+
<div class="banner banner-vuejsconf" v-if="open">
23+
<a href="https://conf.vuejs.de" target="_blank">
24+
<picture>
25+
<source
26+
media="(min-width:1200px)"
27+
srcset="/images/vuejsde-conf/vuejsdeconf_banner_large.png"
28+
/>
29+
<source
30+
media="(min-width:920px)"
31+
srcset="/images/vuejsde-conf/vuejsdeconf_banner_medium.png"
32+
/>
33+
<img
34+
src="/images/vuejsde-conf/vuejsdeconf_banner_small.png"
35+
alt=""
36+
/>
37+
</picture>
38+
</a>
39+
<div class="close-btn" @click.stop.prevent="dismiss">
40+
<img src="/images/vuejsde-conf/close.svg" alt="Close" />
41+
</div>
2942
</div>
3043
</template>
3144

3245
<style>
3346
html:not(.banner-dismissed) {
34-
--vt-banner-height: 24px;
47+
--vt-banner-height: 60px;
3548
}
3649
</style>
3750

@@ -44,7 +57,7 @@ html:not(.banner-dismissed) {
4457
left: 0;
4558
right: 0;
4659
height: var(--vt-banner-height);
47-
line-height: var(--vt-banner-height);
60+
line-height: 0;
4861
text-align: center;
4962
font-size: 12px;
5063
font-weight: 600;
@@ -59,4 +72,23 @@ html:not(.banner-dismissed) {
5972
a {
6073
text-decoration: underline;
6174
}
75+
76+
.banner-vuejsconf {
77+
background: linear-gradient(90deg, #fff 50%, var(--vt-c-green) 50%);
78+
}
79+
80+
.banner-vuejsconf a {
81+
display: inline-block;
82+
margin: 0 auto;
83+
}
84+
85+
.banner-vuejsconf .close-btn {
86+
top: 26%;
87+
right: 10px;
88+
z-index: 99;
89+
position: absolute;
90+
border-radius: 50%;
91+
background-color: var(--vt-c-brand-dark);
92+
padding: 8px;
93+
}
6294
</style>

.vitepress/theme/index.ts

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

1515
export default Object.assign({}, VPTheme, {
1616
Layout: () => {
1717
// @ts-ignore
1818
return h(VPTheme.Layout, null, {
19-
// banner: () => h(Banner),
19+
banner: () => h(Banner),
2020
'sidebar-top': () => h(PreferenceSwitch),
2121
'aside-mid': () => h(SponsorsAside),
2222
'aside-bottom': () => h(VueJobs)
Lines changed: 7 additions & 0 deletions
Loading
23 KB
Loading
19 KB
Loading
8.8 KB
Loading

0 commit comments

Comments
 (0)