Skip to content

Commit

Permalink
Revert "Vuejsde conf banner september 16 22 2024"This reverts commit 1…
Browse files Browse the repository at this point in the history
…7bd491. (#1390) (#1391)

Co-authored-by: Evan You <[email protected]>
  • Loading branch information
edimitchel and yyx990803 authored Oct 1, 2024
1 parent d6401ab commit 3261c33
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .vitepress/inlined-scripts/restorePreference.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; (() => {
;(() => {
const restore = (key, cls, def = false) => {
const saved = localStorage.getItem(key)
if (saved ? saved !== 'false' : def) {
Expand All @@ -8,6 +8,6 @@
restore('vue-docs-prefer-composition', 'prefer-composition', true)
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)

window.__VUE_BANNER_ID__ = 'vuejsdeconf2024-promo-september'
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
// window.__VUE_BANNER_ID__ = ''
// restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
})()
55 changes: 12 additions & 43 deletions .vitepress/theme/components/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,17 @@ function dismiss() {
</script>

<template>
<div class="banner banner-vuejsconf" v-if="open">
<a href="https://conf.vuejs.de/tickets/?voucher=VUEJS_SPECIAL_OFFER&utm_source=vuejs&utm_medium=referral&utm_campaign=banner-placement&utm_content=banner"
target="_blank">
<picture>
<source media="(min-width:1260px)"
srcset="/vuejsde-conf/vuejsdeconf_banner_large.png, /vuejsde-conf/vuejsdeconf_banner_large_2x.png 2x" />
<source media="(min-width:970px)"
srcset="/vuejsde-conf/vuejsdeconf_banner_medium.png, /vuejsde-conf/vuejsdeconf_banner_medium_2x.png 2x" />
<source media="(min-width:576px)"
srcset="/vuejsde-conf/vuejsdeconf_banner_small.png, /vuejsde-conf/vuejsdeconf_banner_small_2x.png 2x" />
<source media="(min-width:320px)"
srcset="/vuejsde-conf/vuejsdeconf_banner_smallest.png, /vuejsde-conf/vuejsdeconf_banner_smallest_2x.png 2x"
alt="" />
<img src="/vuejsde-conf/vuejsdeconf_banner_smallest_2x.png" alt="" />
</picture>
</a>
<div class="close-btn" @click.stop.prevent="dismiss">
<div class="banner" v-if="open">
<a target="_blank"></a>
<button @click="dismiss">
<VTIconPlus class="close" />
</div>
</button>
</div>
</template>

<style>
html:not(.banner-dismissed) {
--vt-banner-height: 72px;
--vt-banner-height: 30px;
}
</style>

Expand All @@ -64,10 +50,12 @@ html:not(.banner-dismissed) {
font-weight: 600;
color: #fff;
background-color: var(--vt-c-green);
background: linear-gradient(90deg,
rgba(66, 184, 131, 1) 0%,
rgba(39, 179, 137, 1) 19%,
rgba(100, 126, 255, 1) 100%);
background: linear-gradient(
90deg,
rgba(66, 184, 131, 1) 0%,
rgba(39, 179, 137, 1) 19%,
rgba(100, 126, 255, 1) 100%
);
}
.banner-dismissed .banner {
Expand All @@ -88,28 +76,9 @@ a:hover {
.close {
width: 20px;
height: 20px;
fill: #000;
fill: #fff;
transform: rotate(45deg);
}
.banner-vuejsconf {
background: linear-gradient(90deg, #fff 50%, #6f97c4 50%);
}
.banner-vuejsconf a {
display: inline-block;
margin: 0 auto;
}
.banner-vuejsconf .close-btn {
top: 0px;
left: 0px;
z-index: 99;
position: absolute;
border-radius: 50%;
cursor: pointer;
}
/*
@media (max-width: 720px) {
a > span {
Expand Down
4 changes: 2 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
} from './components/preferences'
import SponsorsAside from './components/SponsorsAside.vue'
import VueSchoolLink from './components/VueSchoolLink.vue'
import Banner from './components/Banner.vue'
// import Banner from './components/Banner.vue'
// import TextAd from './components/TextAd.vue'

export default Object.assign({}, VPTheme, {
Layout: () => {
// @ts-ignore
return h(VPTheme.Layout, null, {
banner: () => h(Banner),
// banner: () => h(Banner),
'sidebar-top': () => h(PreferenceSwitch),
'sidebar-bottom': () => h(SecurityUpdateBtn),
'aside-mid': () => h(SponsorsAside)
Expand Down
Binary file removed src/public/vuejsde-conf/vuejsdeconf_banner_large.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/public/vuejsde-conf/vuejsdeconf_banner_small.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 3261c33

Please sign in to comment.