[COD] <div class="new-year-countdown-widget">
<div class="countdown-title">До Нового Года осталось:</div>
<div class="countdown-timer">
<div class="countdown-unit">
<span class="countdown-number" id="countdown-days">00</span>
<span class="countdown-label">дней</span>
</div>
<div class="countdown-unit">
<span class="countdown-number" id="countdown-hours">00</span>
<span class="countdown-label">часов</span>
</div>
<div class="countdown-unit">
<span class="countdown-number" id="countdown-minutes">00</span>
<span class="countdown-label">минут</span>
</div>
<div class="countdown-unit">
<span class="countdown-number" id="countdown-seconds">00</span>
<span class="countdown-label">секунд</span>
</div>
</div>
<div class="new-year-message" id="new-year-message"></div>
</div>
<style>
.new-year-countdown-widget {
background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
border-radius: 10px;
padding: 20px;
color: white;
text-align: center;
margin: 10px 0;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
font-family: Arial, sans-serif;
}
.countdown-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 1px;
}
.countdown-timer {
display: flex;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
}
.countdown-unit {
background: rgba(255,255,255,0.2);
border-radius: 8px;
padding: 10px;
min-width: 70px;
backdrop-filter: blur(10px);
}
.countdown-number {
font-size: 24px;
font-weight: bold;
display: block;
}
.countdown-label {
font-size: 12px;
opacity: 0.9;
text-transform: uppercase;
}
.new-year-message {
margin-top: 15px;
font-size: 16px;
font-weight: bold;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { opacity: 0.7; }
50% { opacity: 1; }
100% { opacity: 0.7; }
}
@media (max-width: 480px) {
.countdown-unit {
min-width: 60px;
padding: 8px;
}
.countdown-number {
font-size: 20px;
}
.countdown-title {
font-size: 16px;
}
}
</style>
<script>
function updateNewYearCountdown() {
const now = new Date();
const currentYear = now.getFullYear();
const nextYear = currentYear + 1;
const newYear = new Date(nextYear, 0, 1, 0, 0, 0, 0);
const diff = newYear - now;
if (diff <= 0) {
document.getElementById('new-year-message').textContent = 'С Новым Годом!

';
document.getElementById('countdown-days').textContent = '00';
document.getElementById('countdown-hours').textContent = '00';
document.getElementById('countdown-minutes').textContent = '00';
document.getElementById('countdown-seconds').textContent = '00';
return;
}
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
document.getElementById('countdown-days').textContent = days.toString().padStart(2, '0');
document.getElementById('countdown-hours').textContent = hours.toString().padStart(2, '0');
document.getElementById('countdown-minutes').textContent = minutes.toString().padStart(2, '0');
document.getElementById('countdown-seconds').textContent = seconds.toString().padStart(2, '0');
}
// Запускаем отсчет сразу и обновляем каждую секунду
updateNewYearCountdown();
setInterval(updateNewYearCountdown, 1000);
</script> [/COD]