Skip to content

Commit

Permalink
add vueconf.us banner (#2736)
Browse files Browse the repository at this point in the history
  • Loading branch information
prpatel committed Mar 11, 2024
1 parent 4171256 commit 0910c20
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.idea

# Directories potentially created on remote AFP share
.AppleDB
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/docs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .vitepress/inlined-scripts/restorePreference.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
restore('vue-docs-prefer-composition', 'prefer-composition', true)
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)

// window.__VUE_BANNER_ID__ = ''
// restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
window.__VUE_BANNER_ID__ = 'vueconfus2024'
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
})()
87 changes: 74 additions & 13 deletions .vitepress/theme/components/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,30 @@ function dismiss() {

<template>
<div class="banner" v-if="open">
<a target="_blank"></a>
<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">
<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>
</template>

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

Expand All @@ -50,12 +64,10 @@ 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: #11252b;
display: flex;
justify-content: center;
align-items: center;
}
.banner-dismissed .banner {
Expand All @@ -70,7 +82,7 @@ button {
position: absolute;
right: 0;
top: 0;
padding: 5px;
padding: 20px 10px;
}
.close {
Expand All @@ -79,10 +91,59 @@ button {
fill: #fff;
transform: rotate(45deg);
}
/*
@media (max-width: 720px) {
a > span {
.vt-banner-text {
color: #fff;
font-size: 16px;
}
.vt-text-primary {
color: #75c05e;
}
.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;
}
} */
}
</style>
4 changes: 2 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,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),
'aside-mid': () => h(SponsorsAside)
})
Expand Down

0 comments on commit 0910c20

Please sign in to comment.