Code
<style>
/* Popup Overlay */
.popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent; /* აღარ აბნელებს */
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
/* Popup Window */
.popup-window {
width: 420px;
background: #fff;
box-shadow: 0 0 20px rgba(0,0,0,0.3);
overflow: hidden;
text-align: center;
border-radius: 0;
}
/* Header */
.popup-header {
background: #111;
padding: 12px 20px;
color: #fff;
font-size: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}
/* Close button */
.popup-close {
background: #c62828;
border: none;
color: #fff;
padding: 6px 12px;
font-size: 16px;
cursor: pointer;
transition: background 0.25s ease;
}
.popup-close:hover {
background: #e53935;
}
/* Body */
.popup-body {
padding: 20px;
}
/* Tree image */
.popup-tree {
max-width: 100%;
height: auto;
margin-bottom: 15px;
}
/* Timer */
.popup-timer {
font-weight: bold;
color: #b71c1c;
font-size: 15px;
}
</style>
<div class="popup-overlay" id="popup">
<div class="popup-window">
<div class="popup-header">
/ ახალ / წლამდე / დარჩა /
<button class="popup-close" onclick="closePopup()">დახურვა</button>
</div>
<div class="popup-body">
<img
class="popup-tree"
src="https://latestsms.in/pictures/best-merry-christmas-gif-for-girlfriend.gif?m=1629787615"
alt="ნაძვის ხე"
>
<div class="popup-timer" id="countdown-timer"></div>
</div>
</div>
</div>
<script>
function updateCountdown() {
const now = new Date();
const nextYear = now.getFullYear() + 1;
const newYear = new Date(`January 1, ${nextYear} 00:00:00`);
const diff = newYear - now;
if (diff <= 0) {
document.getElementById("countdown-timer").textContent =
"ახალი წელი მოვიდა! 🎉";
return;
}
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff / (1000 * 60 * 60)) % 24);
const minutes = Math.floor((diff / (1000 * 60)) % 60);
const seconds = Math.floor((diff / 1000) % 60);
document.getElementById("countdown-timer").textContent =
`დარჩა: ${days} დღე ${hours} საათი ${minutes} წუთი ${seconds} წამი`;
}
function closePopup() {
document.getElementById("popup").style.display = "none";
}
setInterval(updateCountdown, 1000);
updateCountdown();
</script>