Juli 13, 2023
<style>
#floating-ad {position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9999;
}
#floating-ad .ad-content {
max-width: 90%;
max-height: 90%;
background-color: #ffff;
text-align: center;
position: relative;
padding: 25px;
}
#floating-ad img {
width: 100%;
height: auto;
}
#floating-ad .close-btn {
position: absolute;
top: 0;
right: 0;
padding: 9px;
cursor: pointer;
}
/* Full screen on all devices */
@media only screen and (max-width: 767px) {
#floating-ad .ad-content {
max-width: 100%;
max-height: 100%;
}
}
/* Full screen on Android devices in desktop mode */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
#floating-ad .ad-content {
max-width: 100%;
max-height: 100%;
}
}
</style>
<div id="floating-ad">
<div class="ad-content">
<span class="close-btn" onclick="hideAd()">
<p> X</p>
</span>
<p></p><figure>
<br />
<h2 style="text-align: center;"><span style="background-color: white; font-family: Bungee;"><span style="color: red;">Notification!</span><span style="color: #ffa400;"> </span><span style="color: #ffa400;"> </span></span></h2><h2 style="text-align: center;"><span style="background-color: white; color: #20124d; font-family: Bebas Neue;">This is an "ADVERTISEMENT" page, please click the "CONTINUE" button to proceed.</span></h2>
<div id="countdown-timer"></div>
<button class="go-to-ad" onclick="goToAd()" style="display: none;">
<p>
</p><h2>
<a href="http://virtual-doctor.net" onclick="window.open('https://www.highrevenuegate.com/xwtymwf7r?key=47bc65bf437c940a1c247810b80624c7'); return true;" style="background-color: black; display: inline-block; padding: 5px 10px;">
<span style="vertical-align: inherit;"><span style="color: mediumaquamarine; vertical-align: inherit;"><b><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">CONTINUE</span></span></b></span></span>
</a>
</h2>
<p></p>
</button>
<script>
var countDownDate = new Date().getTime() + 35000; // countdown selama 35 detik
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("countdown-timer").innerHTML = "please wait : " + seconds + "s";
if (distance < 0) {
clearInterval(x);
document.getElementById("countdown-timer").innerHTML = "";
document.getElementsByClassName("go-to-ad")[0].style.display = "block"; // menampilkan tombol continue setelah countdown selesai
}
}, 1000);
function goToAd() {
}
</script>
<br />
<p></p><figure>
<div class="holidAds"></div>
<p></p><figure>
<div class="article-box">
<h2>Judul Artikel</h2>
<p>Isi artikel...</p>
</div>
</figure></figure></div>
</figure></div>
<script>
function hideAd() {
document.getElementById("floating-ad").style.display = "none";
setCookie("ad_hidden", "true", 1); // set cookie for 1 day
}
function goToAd() {
hideAd();
}
function checkAdCookie() {
if (getCookie("ad_hidden") == "true") {
document.getElementById("floating-ad").style.display = "none";
}
}
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); }
return null;
}
checkAdCookie();
window.addEventListener('resize', function() {
if (document.getElementById('floating-ad').style.display !== 'none') {
var adContent = document.querySelector('.ad-content');
var adHeight = adContent.offsetHeight;
var windowHeight = window.innerHeight;
if (adHeight > windowHeight) {
adContent.style.height = (windowHeight - 60) + 'px';
} else {
adContent.style.height = 'auto';
}
}
});
</script>
