<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rotating Iframe Ad</title>
<style>
/* Full screen overlay */
.overlay {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
/* Ad container */
.ad-container {
width: 500px;
height: 500px;
background: white;
text-align: center;
padding: 20px;
border-radius: 10px;
}
/* Close button */
.close-btn {
margin-top: 10px;
padding: 10px 20px;
background-color: red;
color: white;
border: none;
cursor: pointer;
display: none; /* Initially hidden */
}
</style>
</head>
<body>
<div class="overlay" id="adOverlay">
<div class="ad-container">
<iframe id="adIframe" width="500" height="500" frameborder="0" allowfullscreen></iframe>
<button class="close-btn" id="closeBtn" onclick="closeAd()">Close</button>
</div>
</div>
<script>
// List of URLs to rotate through
const urls = [
"https://thousheek.com/4/6923542",
"https://upsaiwuwhooy.net/4/6923531",
"https://uchaihoo.com/4/6923526"
];
let currentIndex = 0;
// Function to close the ad overlay
function closeAd() {
document.getElementById('adOverlay').style.display = 'none';
}
// Function to rotate the iframe URL
function rotateIframe() {
const iframe = document.getElementById('adIframe');
iframe.src = urls[currentIndex];
currentIndex = (currentIndex + 1) % urls.length;
}
// Function to show the close button after 15 seconds
function showCloseButton() {
document.getElementById('closeBtn').style.display = 'block';
}
// Rotate the iframe URL every 10 seconds
setInterval(rotateIframe, 10000);
// Show the close button after 15 seconds
setTimeout(showCloseButton, 15000);
// Initial display of the ad
document.getElementById('adOverlay').style.display = 'flex';
// Start the iframe rotation
rotateIframe();
</script>
</body>
</html>
7
3
17KB
32KB
120.0ms
131.0ms
896.0ms