<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>星期查询</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
background: linear-gradient(135deg, #6e8efb, #a777e3);
font-family: 'Segoe UI', sans-serif;
}
.container {
background: rgba(255, 255, 255, 0.9);
padding: 2rem;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
text-align: center;
transition: transform 0.3s ease;
}
.container:hover {
transform: translateY(-5px);
}
.weekday {
font-size: 2.5em;
color: #2c3e50;
margin: 1rem 0;
font-weight: 600;
}
.date {
color: #7f8c8d;
font-size: 1.2em;
}
</style>
</head>
<body>
<div class="container">
<div class="weekday" id="weekday"></div>
<div class="date" id="currentDate"></div>
</div>
<script>
const weekdayElement = document.getElementById('weekday');
const dateElement = document.getElementById('currentDate');
const days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const months = ['一月', '二月', '三月', '四月', '五月', '六月',
'七月', '八月', '九月', '十月', '十一月', '十二月'];
const now = new Date();
const dayName = days[now.getDay()];
const dateStr = `${now.getFullYear()}年 ${months[now.getMonth()]} ${now.getDate()}日`;
weekdayElement.textContent = dayName;
dateElement.textContent = dateStr;
</script>
</body>
</html>