Skip to content

Commit

Permalink
feat: add vuejsde conf 2024 banner (vuejs#2797)
Browse files Browse the repository at this point in the history
  • Loading branch information
antony-k1208 authored and szymonlicau committed Jun 11, 2024
1 parent 0b1408f commit b9e0e8d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 73 deletions.
4 changes: 2 additions & 2 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__ = 'vueconfus2024'
window.__VUE_BANNER_ID__ = 'vuejsdeconf2024-promo-may'
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
})()
95 changes: 24 additions & 71 deletions .vitepress/theme/components/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,18 @@ function dismiss() {
</script>

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

Expand All @@ -64,10 +57,6 @@ html:not(.banner-dismissed) {
font-weight: 600;
color: #fff;
background-color: var(--vt-c-green);
background: #11252b;
display: flex;
justify-content: center;
align-items: center;
}
.banner-dismissed .banner {
Expand All @@ -92,58 +81,22 @@ button {
transform: rotate(45deg);
}
.vt-banner-text {
color: #fff;
font-size: 16px;
.banner-vuejsconf {
background: linear-gradient(90deg, #fff 50%, #43b883 50%);
}
.vt-text-primary {
color: #75c05e;
.banner-vuejsconf a {
display: inline-block;
margin: 0 auto;
}
.vt-primary-action {
background: #75c05e;
color: #121c1a;
padding: 8px 15px;
border-radius: 5px;
font-size: 14px;
text-decoration: none;
margin: 0 20px;
font-weight: bold;
}
.vt-primary-action:hover {
text-decoration: none;
background: #5a9f45;
}
@media (max-width: 1280px) {
.banner .vt-banner-text {
font-size: 14px;
}
.vt-tagline {
display: none;
}
}
@media (max-width: 780px) {
.vt-tagline {
display: none;
}
.vt-coupon {
display: none;
}
.vt-primary-action {
margin: 0 10px;
padding: 7px 10px;
}
.vt-time-now {
display: none;
}
}
@media (max-width: 560px) {
.vt-place {
display: none;
}
.banner-vuejsconf .close-btn {
top: 10px;
right: 10px;
z-index: 99;
position: absolute;
border-radius: 50%;
padding: 10px;
cursor: pointer;
}
</style>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b9e0e8d

Please sign in to comment.