Skip to content

Commit 167d2fd

Browse files
Update index.html
1 parent d7356d4 commit 167d2fd

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

index.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,43 @@ <h3>Lama TD</h3>
118118
<!-- AdForGames.com code end -->
119119
</div>
120120
<script src="script.js"></script>
121+
<script>
122+
window.addEventListener('load', () => {
123+
const popup = document.getElementById('popup-ad');
124+
const closeBtn = document.getElementById('close-btn');
125+
126+
// Show the popup
127+
popup.style.display = 'flex';
128+
129+
// Countdown for close button
130+
let seconds = 5;
131+
closeBtn.disabled = true;
132+
closeBtn.textContent = `Close (${seconds})`;
133+
closeBtn.style.cursor = 'not-allowed';
134+
closeBtn.style.background = '#ccc';
135+
closeBtn.style.color = '#000';
136+
137+
const countdown = setInterval(() => {
138+
seconds--;
139+
closeBtn.textContent = `Close (${seconds})`;
140+
141+
if (seconds <= 0) {
142+
clearInterval(countdown);
143+
closeBtn.textContent = 'Close';
144+
closeBtn.disabled = false;
145+
closeBtn.style.cursor = 'pointer';
146+
closeBtn.style.background = '#f33';
147+
closeBtn.style.color = '#fff';
148+
}
149+
}, 1000);
150+
151+
// Close popup on click
152+
closeBtn.addEventListener('click', () => {
153+
if (!closeBtn.disabled) {
154+
popup.style.display = 'none';
155+
}
156+
});
157+
});
158+
</script>
121159
</body>
122160
</html>

0 commit comments

Comments
 (0)