-
-
Save arspuja/64d087b69ab2912c1ac337bf9914f7d3 to your computer and use it in GitHub Desktop.
Simple Script for Detected Adblock Plugin on Blogger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.overlay { | |
position: fixed; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
background: rgba(0, 0, 0, 0.7); | |
transition: opacity 500ms; | |
visibility: hidden; | |
opacity: 0; | |
} | |
.adblck { | |
visibility: visible; | |
opacity: 1; | |
z-index: 999; | |
} | |
.overlay:target { | |
visibility: visible; | |
opacity: 1; | |
} | |
.popup { | |
margin: 70px auto; | |
padding: 20px; | |
background: #fff; | |
border-radius: 5px; | |
width: 30%; | |
position: relative; | |
transition: all 5s ease-in-out; | |
text-align: center; | |
} | |
.popup h2 { | |
margin-top: 0; | |
color: #d70f0f; | |
font-family: Tahoma, Arial, sans-serif; | |
margin-bottom: 20px; | |
} | |
.popup .close { | |
position: absolute; | |
top: 20px; | |
right: 30px; | |
transition: all 200ms; | |
font-size: 30px; | |
font-weight: bold; | |
text-decoration: none; | |
color: #333; | |
} | |
.popup .close:hover { | |
color: #06D85F; | |
} | |
.popup .content { | |
max-height: 30%; | |
overflow: auto; | |
line-height: 2em; | |
} | |
@media screen and (max-width: 700px){ | |
.box{ | |
width: 70%; | |
} | |
.popup{ | |
width: 70%; | |
} | |
} | |
</style> | |
<div id="popup1" class="overlay"> | |
<div class="popup"><h2>Matikan ADBlock!</h2><div class="content">“Barang siapa yang menyulitkan (orang lain) maka Allah akan mempersulitnya pada hari kiamat” <br />(HR Al-Bukhari no 7152)</div></div> | |
</div> | |
<script> | |
window.onload = function() { | |
setInterval(function(){ | |
var ad = document.querySelector("ins.adsbygoogle"); | |
if(ad && ad.innerHTML.replace(/\s/g, "").length === 0){ | |
var ele = document.getElementById("popup1"); | |
adcss = "adblck"; | |
arr = ele.className.split(" "); | |
if (arr.indexOf(adcss) == -1) { ele.className += " " + adcss; } | |
}else{ | |
var ele = document.getElementById("popup1"); | |
ele.className = ele.className.replace(/\badblck\b/g, ""); | |
} | |
}, 4000); }; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HOW TO USE?
BAGAIMANA CARA MENGGUNAKAN?