Skip to content

Commit a9ac596

Browse files
nicodevsatinux
andauthored
Add Mastering Nuxt banner for Black Friday 2021 (#1940)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
1 parent 9446771 commit a9ac596

File tree

6 files changed

+76
-1
lines changed

6 files changed

+76
-1
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<template>
2+
<a
3+
v-if="show"
4+
href="https://masteringnuxt.com/?utm_source=nuxt&amp;utm_medium=link&amp;utm_campaign=black_friday"
5+
target="_blank"
6+
rel="noopener"
7+
class="group block relative h-10"
8+
:style="{ background: '#21272D' }"
9+
>
10+
<div class="absolute z-0 h-full w-full flex justify-center">
11+
<img
12+
:src="`/img/banners/mastering-nuxt/bg-desktop.png`"
13+
class="h-full hidden xl:inline-block"
14+
alt="Banner Background"
15+
/>
16+
<img
17+
:src="`/img/banners/mastering-nuxt/bg-tablet.png`"
18+
class="h-full md:inline-block xl:hidden"
19+
alt="Banner Background"
20+
/>
21+
</div>
22+
<div class="relative z-10 h-full inset-0 text-white font-bold flex justify-between items-center px-1 md:px-6">
23+
<div>
24+
<img :src="`/img/banners/mastering-nuxt/logo.png`" alt="Mastering Nuxt Logo" class="w-10" />
25+
</div>
26+
<div class="flex items-center justify-center gap-2 text-center md:text-left md:gap-6">
27+
<div>
28+
Black Friday Sale!
29+
<span class="block md:inline"
30+
>Get the Mastering Nuxt Course at <span :style="{ color: '#00dc82' }">40% OFF</span></span
31+
>
32+
</div>
33+
<div class="whitespace-nowrap py-1 px-3 rounded-md bg-azure-radiance group-hover:bg-indigo">Get Discount</div>
34+
</div>
35+
<div @click.stop.prevent="close">
36+
<svg width="14" height="14" xmlns="http://www.w3.org/2000/svg">
37+
<path
38+
d="M13.69.321a1.057 1.057 0 0 0-1.498 0L7 5.503 1.808.31A1.057 1.057 0 1 0 .31 1.808L5.503 7 .31 12.192a1.057 1.057 0 1 0 1.497 1.497L7 8.497l5.192 5.192a1.057 1.057 0 1 0 1.497-1.497L8.497 7l5.192-5.192a1.064 1.064 0 0 0 0-1.487z"
39+
fill="#FFF"
40+
/>
41+
</svg>
42+
</div>
43+
</div>
44+
</a>
45+
</template>
46+
47+
<script>
48+
export default {
49+
data() {
50+
return {
51+
show: false
52+
}
53+
},
54+
mounted() {
55+
this.show = !localStorage.getItem('VS_BF21_BANNER_CLOSED')
56+
},
57+
methods: {
58+
close() {
59+
this.show = false
60+
localStorage.setItem('VS_BF21_BANNER_CLOSED', 1)
61+
}
62+
}
63+
}
64+
</script>
65+
66+
<style scoped>
67+
a {
68+
font-size: 10px;
69+
@screen md {
70+
@apply text-sm;
71+
}
72+
}
73+
</style>

components/theme/app/AppLayout.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div class="relative w-full">
3+
<BannerMasteringNuxt />
34
<AppBanner />
45
<AppHeader :links="headerLinks" />
56
<Notifications />
26.2 KB
Loading
15.8 KB
Loading
815 Bytes
Loading

windi.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export default {
9999
darker: '#3B3B00',
100100
darkest: '#2D2E01',
101101
black: '#1F2100'
102-
}
102+
},
103+
'azure-radiance': '#0086f6'
103104

104105
// 'green-lighter': '#80EEC0',
105106
// 'green-light': '#40E5A1',

0 commit comments

Comments
 (0)