diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 679c10541..80f898c66 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -21,7 +21,7 @@ export default defineUserConfig({ ], ["script", { src: "//at.alicdn.com/t/c/font_2601581_dhvis4jtn7m.js" }], ["script", { src: "/fast-request/js/baidu.js" }], - ["script", { src: "https://cdn.wwads.cn/js/makemoney.js" }], + // ["script", { src: "https://cdn.wwads.cn/js/makemoney.js" }], ], markdown: { @@ -74,18 +74,18 @@ export default defineUserConfig({ __dirname, "./layouts/Layout.vue", ), - "@theme-hope/components/HomePage": path.resolve( - __dirname, - "./components/HomePage.vue" - ), - "@theme-hope/components/NormalPage": path.resolve( - __dirname, - "./components/NormalPage.vue" - ), - "@theme-hope/modules/sidebar/components/Sidebar": path.resolve( - __dirname, - "./components/Sidebar.vue" - ), + // "@theme-hope/components/HomePage": path.resolve( + // __dirname, + // "./components/HomePage.vue" + // ), + // "@theme-hope/components/NormalPage": path.resolve( + // __dirname, + // "./components/NormalPage.vue" + // ), + // "@theme-hope/modules/sidebar/components/Sidebar": path.resolve( + // __dirname, + // "./components/Sidebar.vue" + // ), }, }); diff --git a/docs/.vuepress/public/js/ad.js b/docs/.vuepress/public/js/ad.js new file mode 100644 index 000000000..706d6b3cb --- /dev/null +++ b/docs/.vuepress/public/js/ad.js @@ -0,0 +1,19 @@ +function ABDetected() { + var adBlockDetected_div = document.createElement("div"); + document.body.appendChild(adBlockDetected_div); + var navbar = document.querySelector(".vp-navbar"); + navbar.style.cssText="transition:top 300ms;top:33px"; + adBlockDetected_div.style.cssText = "position: fixed; top: 0; left: 0; width: 100%; background: #E01E5A; color: #fff; z-index: 9999999999; font-size: 14px; text-align: center; line-height: 1.5; font-weight: bold; padding-top: 6px; padding-bottom: 6px;"; + adBlockDetected_div.innerHTML = "我们的广告服务商 并不跟踪您的隐私,为了支持本站的长期运营,请将我们的网站 加入广告拦截器的白名单。"; + document.getElementsByTagName("body")[0].appendChild(adBlockDetected_div); + // add a close button to the right side of the div + var adBlockDetected_close = document.createElement("div"); + adBlockDetected_close.style.cssText = "position: absolute; top: 0; right: 10px; width: 30px; height: 30px; background: #E01E5A; color: #fff; z-index: 9999999999; line-height: 30px; cursor: pointer;"; + adBlockDetected_close.innerHTML = "×"; + adBlockDetected_div.appendChild(adBlockDetected_close); + // add a click event to the close button + adBlockDetected_close.onclick = function() { + this.parentNode.parentNode.removeChild(this.parentNode); + navbar.style.cssText="transition:top 300ms;top:0"; + }; +} \ No newline at end of file