Files
tudoudilei/index.html
2026-06-02 17:27:58 +08:00

115 lines
3.9 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>土豆地雷</title>
<style>
body {
text-align: center;
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin-top: 50px;
}
.container {
position: relative;
display: inline-block;
}
#potato-mine {
width: 200px;
height: 200px;
transition: transform 0.5s ease-in-out;
position: relative;
z-index: 1; /* 土豆地雷在上层 */
}
.grass {
position: absolute;
width: 200px;
height: 30px;
background-color: #228B22; /* 草地颜色 */
bottom: 0px; /* 草地位于地面上方 */
left: 0;
z-index: 2; /* 草地在地面上方 */
border-radius: 5px 5px 0 0;
}
.ground {
position: absolute;
width: 200px;
height: 100px; /* 土地的厚度增加 */
background-color: #8B4513; /* 土色 */
bottom: -100px; /* 向下移动地面 */
left: 0;
z-index: 2; /* 地面在土豆地雷上方 */
border-radius: 5px;
}
#potato-mine:hover {
transform: translateY(100px); /* 鼠标悬停时土豆地雷缩进地下 */
}
</style>
</head>
<body>
<h2>我将会用尽全部力气,来保护土豆地雷</h2>
<h3>哪怕与全世界为敌,我也会坚定地和你在一块</h3>
<div class="container">
<img id="potato-mine" src="https://vip1.zhuantou.com.cn/2025/10/20/68f5d31a5f1e7.png" alt="土豆地雷">
<div class="grass"></div> <div class="ground"></div>
</div>
<br><br><br><br><br><br>
<br><a href="/saolei/">扫雷</a>
<br>土豆地雷,脑袋缺弦
<br>----老舍 1931.03.16
<br>
已经和土豆地雷相恋 <span id="timer">计算中...</span>
<script>
const potatoMine = document.getElementById('potato-mine');
potatoMine.addEventListener('mouseenter', function() {
potatoMine.style.transform = 'translateY(100px)'; // 鼠标放上去时,地雷“埋进地下”
});
potatoMine.addEventListener('mouseleave', function() {
potatoMine.style.transform = 'translateY(0)'; // 鼠标移开时,地雷返回原位置
});
// === 静态精准计时器逻辑 ===
const startTime = new Date(1699092000 * 1000); // 对应 2023-11-04 18:00:00
function updateTimer() {
const now = new Date();
let years = now.getFullYear() - startTime.getFullYear();
let months = now.getMonth() - startTime.getMonth();
let days = now.getDate() - startTime.getDate();
let hours = now.getHours() - startTime.getHours();
let minutes = now.getMinutes() - startTime.getMinutes();
let seconds = now.getSeconds() - startTime.getSeconds();
// 修正借位
if (seconds < 0) { seconds += 60; minutes--; }
if (minutes < 0) { minutes += 60; hours--; }
if (hours < 0) { hours += 24; days--; }
if (days < 0) {
const previousMonth = new Date(now.getFullYear(), now.getMonth(), 0);
days += previousMonth.getDate();
months--;
}
if (months < 0) {
months += 12;
years--;
}
// 输出原本格式的文本(年、月、天、小时、分钟、秒)
document.getElementById('timer').innerText = `${years}${months}${days}${hours}小时${minutes}分钟${seconds}`;
}
updateTimer();
setInterval(updateTimer, 1000); // 每一秒自动更新,数字会跳动
</script>
</body>
</html>