console
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>桌面美化方案收集倒计时</title>
<style>
body {
background-color: #fff3f3;
font-family: 'Arial', sans-serif;
text-align: center;
padding-top: 15%;
margin: 0;
}
h1 {
font-size: 28px;
color: #2c3e50;
margin-bottom: 20px;
}
#timer {
font-size: 64px;
font-weight: bold;
color: #e74c3c;
margin-bottom: 15px;
}
.hint {
font-size: 18px;
color: #7f8c8d;
}
</style>
</head>
<body>
<h1>桌面美化方案收集倒计时</h1>
<div id="timer">--:--:--</div>
<div class="hint">请在今日 17:30 前提交</div>
<script>
function updateCountdown() {
const now = new Date();
const deadline = new Date();
deadline.setHours(17, 30, 0, 0);
const diff = deadline - now;
const timerEl = document.getElementById("timer");
if (diff <= 0) {
timerEl.innerText = "已截止";
clearInterval(intervalId);
return;
}
const hours = String(Math.floor(diff / (1000 * 60 * 60))).padStart(2, '0');
const minutes = String(Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0');
const seconds = String(Math.floor((diff % (1000 * 60)) / 1000)).padStart(2, '0');
timerEl.innerText = `${hours}:${minutes}:${seconds}`;
}
updateCountdown();
const intervalId = setInterval(updateCountdown, 1000);
</script>
</body>
</html>