-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
107 lines (93 loc) · 3.27 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-control" content="no-cache">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>恋爱计时器</title>
<style>
body {
-webkit-font-smoothing: antialiased;
font-family: Helvetica Neue, Helvetica, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
font-size: 85%;
margin: 0;
width:100%;
height:100%;
/*
background-image: url('1.jpg') no-repeat;
background-size:100%;*/
}
h2 {
font-size: 220%;
font-weight: 400;
}
.content {
position: absolute;
width: 100%;
top: 25%;
transform: translate(0, -50%);
text-align: center;
}
.timer {
font-size: 180%;
line-height: 1.5;
margin: 1em 0;
}
.timer b {
color: rgb(253, 99, 125);
}
</style>
</head>
<body>
<div id="Layer1" style="position:fixed; left:0px; top:0px; width:100%; height:100%">
<img src="bg.jpg" width="100%" height="100%"/>
</div>
<div class="content">
<h2>GBQ & ZZC</h2>
<h2>宝,我们已经在一起了</h2>
<div class="timer">
<b id="d"></b> Days <b id="h"></b> Hours <b id="m"></b> Minutes <b id="s"></b> Seconds
</div>
<h1 style="color:#EA0000">冲鸭!!!</h1>
</div>
<script>
function timer() {
var date1= '2024/06/10 00:00:00'; //开始时间
var date2 = new Date(); //结束时间
var date3 = date2.getTime() - new Date(date1).getTime(); //时间差的毫秒数
//------------------------------
//计算出相差天数
var days=Math.floor(date3/(24*3600*1000))
//计算出小时数
var leave1=date3%(24*3600*1000) //计算天数后剩余的毫秒数
var hours=Math.floor(leave1/(3600*1000))
if (hours < 10) {
hours = "0" + hours;
}
//计算相差分钟数
var leave2=leave1%(3600*1000) //计算小时数后剩余的毫秒数
var minutes=Math.floor(leave2/(60*1000))
if (minutes < 10) {
minutes = "0" + minutes;
}
//计算相差秒数
var leave3=Math.floor(leave2%(60*1000)/1000) //计算分钟数后剩余的毫秒数
if (leave3 < 10) {
leave3 = "0" + leave3;
}
document.getElementById('d').innerHTML = days;
document.getElementById('h').innerHTML = hours;
document.getElementById('m').innerHTML = minutes;
document.getElementById('s').innerHTML = leave3;
}
timer();
setInterval(timer, 1000);
</script>
<audio autoplay="autoplay" loop="loop">
<source src="https://magic-chao.github.io/romantic/love.mp3" type="audio/mpeg">
</audio>
</body>
</html>