diff --git a/src/.vuepress/theme/layouts/Layout.vue b/src/.vuepress/theme/layouts/Layout.vue
index b5780ce39b..82666fbebf 100644
--- a/src/.vuepress/theme/layouts/Layout.vue
+++ b/src/.vuepress/theme/layouts/Layout.vue
@@ -5,11 +5,6 @@
@touchstart="onTouchStart"
@touchend="onTouchEnd"
>
-
@@ -53,7 +48,6 @@ import Home from '@theme/components/Home.vue'
import Navbar from '@theme/components/Navbar.vue'
import Page from '@theme/components/Page.vue'
import Sidebar from '@theme/components/Sidebar.vue'
-import VueMasteryBanner from '@theme/components/sponsors/VueMasteryBanner.vue'
import BuySellAds from '@theme/components/BuySellAds.vue'
import CarbonAds from '@theme/components/CarbonAds.vue'
import { resolveSidebarItems } from '../util'
@@ -66,18 +60,13 @@ export default {
Page,
Sidebar,
Navbar,
- VueMasteryBanner,
BuySellAds,
CarbonAds
},
data() {
return {
- isSidebarOpen: false,
- isBannerOpen: true,
- isMenuFixed: false,
- nameStorage: 'vuemastery-black-firday-2020-banner',
- menuPosition: 0
+ isSidebarOpen: false
}
},
@@ -121,9 +110,7 @@ export default {
{
'no-navbar': !this.shouldShowNavbar,
'sidebar-open': this.isSidebarOpen,
- 'no-sidebar': !this.shouldShowSidebar,
- 'vuemastery-menu-fixed': this.isMenuFixed,
- 'vuemastery-promo': this.isBannerOpen
+ 'no-sidebar': !this.shouldShowSidebar
},
userPageClass
]
@@ -138,13 +125,6 @@ export default {
this.$router.afterEach(() => {
this.isSidebarOpen = false
})
-
- // Load component according to user preferences
- if (!localStorage.getItem(this.nameStorage)) {
- this.initBanner()
- } else {
- this.isBannerOpen = false
- }
},
methods: {
@@ -171,54 +151,6 @@ export default {
this.toggleSidebar(false)
}
}
- },
-
- // Vue Mastery Banner
- initBanner() {
- // Add event listeners
- this.toggleBannerEvents(true)
- // Add class to the body to push fixed elements
- this.isBannerOpen = true
- // Get the menu position
- this.getMenuPosition()
- // Check current page offset position
- this.isMenuFixed = this.isUnderBanner()
- },
-
- closeBanner(e) {
- // Remove events
- this.toggleBannerEvents(false)
- // Hide the banner
- this.isBannerOpen = false
- // Save action in the local storage
- localStorage.setItem(this.nameStorage, true)
- },
-
- getMenuPosition() {
- this.menuPosition = this.$refs.vueMasteryBanner.$el.clientHeight
- },
-
- isUnderBanner() {
- return window.pageYOffset > this.menuPosition
- },
-
- fixMenuAfterBanner() {
- if (this.isUnderBanner()) {
- if (!this.isMenuFixed) {
- // The menu will be fixed
- this.isMenuFixed = true
- }
- } else if (this.isMenuFixed) {
- // The menu stay under the banner
- this.isMenuFixed = false
- }
- },
-
- toggleBannerEvents(on) {
- // Add or remove event listerners attached to the DOM
- let method = on ? 'addEventListener' : 'removeEventListener'
- window[method]('resize', this.getMenuPosition)
- window[method]('scroll', this.fixMenuAfterBanner)
}
}
}
diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl
index 52efc869fc..a35b13f7c0 100644
--- a/src/.vuepress/theme/styles/index.styl
+++ b/src/.vuepress/theme/styles/index.styl
@@ -4,7 +4,6 @@
@require './arrow'
@require './wrapper'
@require './toc'
-@require './vuemastery-banner'
html, body
padding 0
@@ -252,5 +251,3 @@ th, td
img
max-width: 140px;
max-height: 60px;
-
-