Code
<style>
;
overflow: hidden;
}
/* ფონი ეფექტი */
body::before {
content: "";
background: url('https://www.wallpapertip.com/wmimgs/9-96054_1920x1080-christmas-wallpapers-4k.jpg') no-repeat center center/cover;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.6;
z-index: -1;
}
.countdown {
font-size: 2.5rem;
color: white;
background-color: rgba(0, 0, 0, 0.6);
padding: 10px;
border-radius: 15px;
width: 362px;
margin: 10px -728px 1px;
box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6);
text-align: center;
position: absolute;
animation: fadeIn 2s ease-in-out;
}
}
.countdown p {
margin: 0;
font-size: 2rem;
font-weight: bold;
color: #ffcc00;
}
.countdown span {
font-size: 3rem;
font-weight: bolder;
color: #ff0000;
animation: pulse 1.5s infinite alternate;
}
/* ანიმაცია ტექსტისათვის */
@keyframes pulse {
0% {
transform: scale(1);
color: #ffcc00;
}
100% {
transform: scale(1.1);
color: #ff0000;
}
}
/* ჩრდილის და განათების ეფექტი */
.countdown::after {
content: "";
font-size: 3rem;
position: absolute;
top: -40px;
left: 50%;
transform: translateX(-50%);
animation: sparkle 2s linear infinite;
}
/* ანიმაცია განათებისთვის */
@keyframes sparkle {
0% {
opacity: 0;
transform: scale(1.2);
}
100% {
opacity: 1;
transform: scale(1);
}
}
</style>
</head>
<body>
<div id="countdown" class="countdown">
<p>დარჩა: <span id="days"></span> დღე</p>
</div>
<script>
// ფუნქცია, რომელიც დაათვლით რამდენი დღე დარჩა ახალ წლამდე
function updateCountdown() {
const newYear = new Date("January 1, 2025 00:00:00"); // ახალ წლამდე თარიღი
const now = new Date();
const timeDifference = newYear - now;
// დღეების გადათვლა
const daysRemaining = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
// შედეგის ჩვენება HTML-ში
document.getElementById("days").textContent = daysRemaining;
}
// ყოველ წამში განახლება
setInterval(updateCountdown, 1000);
</script>