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
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
@@ -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"
>
@@ -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">
@@ -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;
@@ -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;
}
@@ -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 {
@@ -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;
@@ -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 {
@@ -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;
@@ -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'
@@ -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),
183 changes: 183 additions & 0 deletions src/public/images/vueschool/vs-fw-bg-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions src/public/images/vueschool/vs-iso.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 6 additions & 11 deletions src/public/images/vueschool/vs-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.