This commit is contained in:
2026-06-02 17:27:58 +08:00
parent 2a2337042f
commit 044e449a0a
2 changed files with 157 additions and 23 deletions

65
index.php → index.html Executable file → Normal file
View File

@@ -54,33 +54,16 @@
<h2>我将会用尽全部力气,来保护土豆地雷</h2> <h2>我将会用尽全部力气,来保护土豆地雷</h2>
<h3>哪怕与全世界为敌,我也会坚定地和你在一块</h3> <h3>哪怕与全世界为敌,我也会坚定地和你在一块</h3>
<div class="container"> <div class="container">
<img id="potato-mine" src="https://ningbo1.picpic.yuheng.hl.cn/2025/01/29/679a333aeac50.jpg" alt="土豆地雷"> <img id="potato-mine" src="https://vip1.zhuantou.com.cn/2025/10/20/68f5d31a5f1e7.png" alt="土豆地雷">
<div class="grass"></div> <!-- 草地区域 --> <div class="grass"></div> <div class="ground"></div>
<div class="ground"></div>
</div> </div>
<br><br><br><br><br><br> <br><br><br><br><br><br>
<br><a href="/saolei/">扫雷</a> <br><a href="/saolei/">扫雷</a>
<br>土豆地雷,脑袋缺弦 <br>土豆地雷,脑袋缺弦
<br>----老舍 1931.03.16 <br>----老舍 1931.03.16
<br>已经和土豆地雷相恋<? <br>
$times = time() - 1699092000; 已经和土豆地雷相恋 <span id="timer">计算中...</span>
// 计算年数
$years = floor($times / (365 * 24 * 60 * 60));
$times %= (365 * 24 * 60 * 60);
// 计算月数
$months = floor($times / (30 * 24 * 60 * 60));
$times %= (30 * 24 * 60 * 60);
// 计算天数
$days = floor($times / (24 * 60 * 60));
$times %= (24 * 60 * 60);
// 计算小时数
$hours = floor($times / (60 * 60));
$times %= (60 * 60);
// 计算分钟数
$minutes = floor($times / 60);
$seconds = $times % 60;
echo "{$years}年{$months}月{$days}日{$hours}时{$minutes}分{$seconds}秒";
?>
<script> <script>
const potatoMine = document.getElementById('potato-mine'); const potatoMine = document.getElementById('potato-mine');
@@ -91,6 +74,42 @@ echo "{$years}年{$months}月{$days}日{$hours}时{$minutes}分{$seconds}秒";
potatoMine.addEventListener('mouseleave', function() { potatoMine.addEventListener('mouseleave', function() {
potatoMine.style.transform = 'translateY(0)'; // 鼠标移开时,地雷返回原位置 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> </script>
</body> </body>
</html> </html>

115
old/v3.html Normal file
View File

@@ -0,0 +1,115 @@
<!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>