-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
91 lines (83 loc) · 4.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="zh-hans">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<title id="html_title">LuoTianyi</title>
<link rel="shortcut icon" href="favicon.svg" type="image/x-icon">
<link rel="icon" href="favicon.svg" type="image/x-icon">
<meta name="description" content="洛天依十三周年生日会倒计时,让我们一起祝福洛天依生日快乐!">
<meta name="keywords" content="洛天依,生日会,十三周年,倒计时,洛天依十三周年生日会倒计时">
<meta name="robots" content="index">
<meta http-equiv="Content-Language" contect="zh-CN">
<!-- JQuery -->
<script src="./js/jquery.min.js"></script>
<!-- Style -->
<link rel="stylesheet" href="css/style.css">
<!-- Main Script (I can't separate them into a .js file, so i put them here...) -->
<script type="text/javascript" src="./js/main.js"></script>
<script type="text/javascript">
function PrefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length); //位数不够,则在前面补0
}
function countDown() {
// 创建目标时间对象
var target_time = new Date("2025/7/12 19:12:12");
// 计算目标时间对象到当前时间的毫秒数
var reduce_ms = target_time.getTime() - Date.now();
// 返回需要的数据
return {
day: parseInt(reduce_ms / 1000 / 3600 / 24),
hour: parseInt(reduce_ms / 1000 / 3600 % 24),
min: parseInt(reduce_ms / 1000 / 60 % 60),
sec: Math.round(reduce_ms / 1000 % 60)
}
}
function render() {
var title = "LuoTianyi";
var res = countDown();
var d = document.getElementById("day");
var h = document.getElementById("hour");
var m = document.getElementById("minute");
var s = document.getElementById("second");
if (res.day != 0) {
d.innerHTML = res.day + '<span class="Tian_char">天</span>'
} else {
d.setAttribute("style", "display:none;");
}
h.innerHTML = PrefixInteger(res.hour, 2);
m.innerHTML = PrefixInteger(res.min, 2);
s.innerHTML = PrefixInteger(res.sec, 2);
document.getElementById('html_title').innerHTML = title + ' | 还有' + res.day + '天' + res.hour + '小时' + res.min + '分' + res.sec + '秒';
} setInterval(render, 1000);
</script>
</head>
<body onload="render();console.log('Copyright 天依社 2025, All Rights Reserved.');console.log('Fork me on GitHub! :\ngithub.com/LTY-Followers/Birthday-Countdown/');">
<div class="warning">
请使用最新Chromium内核浏览器,并将浏览器全屏,以获得最佳体验!
<br>
(移动设备请横屏并缩小网页以消除此警告)
</div>
<div class="title">
洛天依十三周年生日会倒计时<img src="./img/QianMing.png" onclick="times++;go_easter_eggs()"/>
</div>
<div class="holiday" id="countDown">
<span id="day" class="CountDown_Number"></span>
<span id="hour" class="CountDown_Number"></span>
<span class="split">:</span>
<span id="minute" class="CountDown_Number"></span>
<span class="split">:</span>
<span id="second" class="CountDown_Number"></span>
</div>
<div class="info">
<span class="info1"><img src="./img/bilibili.svg" /><div class="B">B</div>站:
<a href="https://space.bilibili.com/36081646">https://space.bilibili.com/36081646</a></span>
<br>
<span class="info2"><img src="./img/weibo.svg" />微博: <a
href="https://m.weibo.cn/u/5146173015">https://m.weibo.cn/u/5146173015</a></span>
<br>
<span class="info3"><img src="./img/website.svg" />官网: <a
href="https://vsinger.com/vsinger/">https://vsinger.com/vsinger</a></span>
</div>
</body>
</html>