Skip to content

Update Vue School offer banner #1680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 58 additions & 39 deletions .vitepress/theme/components/VueSchoolBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a
v-if="isVisible"
id="vs"
href="https://vueschool.io/free-weekend?friend=vuejs"
href="https://vueschool.io/sales/price-increase-22?friend=vuejs"
target="_blank"
rel="noreferrer"
>
Expand All @@ -12,15 +12,17 @@
</div>
<div class="vs-core">
<div class="vs-slogan">
<div class="vs-slogan-subtitle">
VUE 3 MASTERCLASS - FREE WEEKEND
</div>
<div class="vs-slogan-title">
Register at <strong>vueschool.io/free-weekend</strong>
Get up to <strong>40% off</strong> your Vue School Subscription
</div>
<div class="vs-slogan-subtitle">
Time Limited Offer
</div>
</div>
<div class="vs-button">
Free Access
<div class="vs-button-inside">
GET OFFER
</div>
</div>
</div>
<div id="vs-close" class="vs-close" @click.stop.prevent="close">
Expand All @@ -35,27 +37,27 @@ import { ref, onMounted } from 'vue'
const isVisible = ref(false)

onMounted(() => {
isVisible.value = !localStorage.getItem('VS_FW_22')
isVisible.value = !localStorage.getItem('VS_FW_22_OFFER')
if (isVisible.value) document.body.classList.add('has-top-banner')
})

function close () {
isVisible.value = false
document.body.classList.remove('has-top-banner')
localStorage.setItem('VS_FW_22', 1)
localStorage.setItem('VS_FW_22_OFFER', 1)
}
</script>

<style>
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

#vs {
align-items: center;
background-color: #000c19;
box-sizing: border-box;
color: #fff;
display: flex;
font-family: 'Archivo', Roboto, Oxygen, Fira Sans, Helvetica Neue, sans-serif;
font-family: 'Roboto', Oxygen, Fira Sans, Helvetica Neue, sans-serif;
justify-content: center;
position: fixed;
padding: 0 10px;
Expand All @@ -65,7 +67,7 @@ function close () {
z-index: 100;
height: 5rem;
line-height: 1;
background-image: url(/images/vueschool/vs-fw-bg.svg);
background-image: url(/images/vueschool/vs-fw-bg-small.svg);
background-size: cover;
background-repeat: no-repeat;
}
Expand All @@ -80,17 +82,12 @@ function close () {
top: 20px;
}

#vs .vs-logo .logo-small {
display: none;
}

#vs .vs-logo .logo-big {
display: none;
}

#vs:hover .vs-core .vs-button {
background: linear-gradient(261deg, #e61463 100%, #db5248 3%);
border-color: #e61463;
#vs:hover .vs-core .vs-button-inside {
background: linear-gradient(257deg, #e19b09 99%, #ffca24 6%);
}

#vs .vs-core .vs-slogan {
Expand All @@ -107,37 +104,39 @@ function close () {

#vs .vs-core .vs-slogan .vs-slogan-subtitle {
font-size: 14px;
color: #47b785;
font-weight: bold;
color: #cdc5dc;
margin-top: 8px;
}

#vs .vs-core .vs-slogan .vs-slogan-title {
margin-top: 6px;
font-size: 16px;
font-weight: 800;
}

#vs .vs-core .vs-slogan .vs-slogan-title strong {
color: #48a0ff;
font-weight: 400;
color: #fdc722;
}

#vs .vs-core .vs-button {
color: #fff;
padding: 7px 10px;
font-weight: 600;
white-space: nowrap;
background: linear-gradient(0deg, #ffdf4c, #e29d0a);
padding: 2px;
margin-right: 18px;
margin-left: 16px;
object-fit: contain;
border-radius: 30px;
border-style: solid;
border-width: 2px;
background-image: linear-gradient(255deg, #d457d0 98%, #ed81eb 2%), linear-gradient(to bottom, #b349b0, #db61d9);
text-transform: uppercase;
border-color: #B349B0;
display: none;
}

#vs .vs-core .vs-button-inside {
color: #000;
padding: 7px 10px;
font-weight: 800;
font-size: 22px;
white-space: nowrap;
border-radius: 30px;
background: linear-gradient(90deg, #FFC828, #E19C0E);
text-transform: uppercase;
}

#vs .vs-close {
right: 6px;
position: absolute;
Expand All @@ -158,12 +157,17 @@ function close () {
}

@media (min-width: 680px) {
#vs {
background-image: url(/images/vueschool/vs-fw-bg.svg);
background-position: top right -110px;
}

#vs .vs-core .vs-slogan {
margin-left: 24px;
}

#vs .vs-core .vs-slogan .vs-slogan-subtitle {
font-size: 18px;
font-size: 16px;
}

#vs .vs-core .vs-slogan .vs-slogan-title {
Expand All @@ -173,10 +177,13 @@ function close () {
#vs .vs-core .vs-button {
display: inline-block;
margin-right: 0;
padding: 8px 24px;
margin-left: 22px;
}

#vs .vs-core .vs-button-inside {
padding: 8px 24px;
}

#vs .vs-close {
padding: 10px;
right: 20px;
Expand All @@ -185,21 +192,33 @@ function close () {

@media (min-width: 768px) {
#vs .vs-logo .logo-small {
display: none;
}

#vs .vs-logo .logo-big {
display: inline-block;
}

#vs .vs-core {
width: 430px;
}
}

@media (min-width: 1024px) {
#vs .vs-logo .logo-small {
display: none;
#vs {
background-position: top right;
}

#vs .vs-logo .logo-big {
display: inline-block;
#vs .vs-core .vs-slogan .vs-slogan-title {
font-size: 24px;
}

#vs .vs-core .vs-button {
margin-left: 69px;
}

#vs .vs-core {
width: auto;
}
}
</style>
4 changes: 1 addition & 3 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './styles/index.css'
import { h, App } from 'vue'
import { VPTheme } from '@vue/theme'
import Banner from './components/Banner.vue'
import PreferenceSwitch from './components/PreferenceSwitch.vue'
import VueSchoolLink from './components/VueSchoolLink.vue'
import VueSchoolBanner from './components/VueSchoolBanner.vue'
Expand All @@ -18,8 +17,7 @@ export default Object.assign({}, VPTheme, {
// @ts-ignore
return h(VPTheme.Layout, null, {
banner: () => h('div', {}, [
h(VueSchoolBanner),
h(Banner)
h(VueSchoolBanner)
]),
'sidebar-top': () => h(PreferenceSwitch),
'aside-mid': () => h(SponsorsAside),
Expand Down
Loading