Added ads, adblocker, fixed scrollbar, fixed route and asset links of blog

This commit is contained in:
Gitea
2025-04-28 04:10:24 +05:30
parent 08e1110abd
commit 68ad583258
9 changed files with 86 additions and 14 deletions

View File

@@ -129,3 +129,29 @@ window.addEventListener("printFile", function (event) {
printWindow.print();
printWindow.close();
});
(function detectAdBlockReal() {
const bait = document.createElement('div');
bait.className = 'adsbygoogle ad-banner ad-unit';
bait.style.cssText = 'width: 1px; height: 1px; position: absolute; left: -9999px;';
document.body.appendChild(bait);
setTimeout(() => {
const baitBlocked =
!bait ||
bait.offsetParent === null ||
bait.offsetHeight === 0 ||
window.getComputedStyle(bait).getPropertyValue('display') === 'none' ||
window.getComputedStyle(bait).getPropertyValue('visibility') === 'hidden';
if (baitBlocked) {
const elementShow = document.getElementById('sidebar-magic');
elementShow.classList.remove('hidden');
window.adBlockDetected = true;
} else {
window.adBlockDetected = false;
}
bait.remove();
}, 100);
})();