-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprov_dongIn.html
71 lines (69 loc) · 2.12 KB
/
prov_dongIn.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>郑州大学数据中台2020</title>
</head>
<style>
title{
text-align: left;
}
*{
margin: 0;
padding: 0;
}
p{
border-top: 1px solid rgb(233, 232, 232);
border-bottom: 1px solid rgb(233, 232, 232);
height: 40px;
line-height: 40px;
margin:5px 5px;
font-size: 12px;
}
span{
display: inline-block;
}
</style>
<body>
<div id="box">
<div class="top">
<img src="./title-1.png" style="width: 100%;height: 100%;" alt="">
</div>
<div class="main">
<p><span>获取时间:</span><span id="data" style="color:#aa00a9;font-size: 16px;">12月22日</span> <span id="data2" style="color:#aa00a9;font-size: 16px;">08:16</span>
<span style="margin-left: 5px;">有效期剩余</span><span id="time" style="font-size: 23px;margin-left: 10px;color: #cc0001;font-weight: 400;">9分23秒</span></p>
</div>
<div class="foot">
<img src="./dongInZhang.gif" style="width: 100%;height: 100%;" alt="">
</div>
</div>
<script>
var myDate = new Date();
let minutes=myDate.getMinutes()
if(minutes<10){
minutes='0'+minutes
}
document.getElementById('data').innerHTML = myDate.getMonth()+1+'月'+myDate.getDate()+'日'
document.getElementById('data2').innerHTML = myDate.getHours()+':'+minutes
var maxtime = 10 * 60; //
function CountDown() {
if (maxtime >= 0) {
let minutes = Math.floor(maxtime / 60);
let seconds = Math.floor(maxtime % 60);
if(seconds<10){
seconds='0'+seconds
}
msg =minutes + "分" + seconds + "秒";
document.all["time"].innerHTML = msg;
if (maxtime == 5 * 60)alert("距离结束仅剩5分钟");
--maxtime;
} else{
clearInterval(timer);
alert("时间到,结束!");
}
}
timer = setInterval("CountDown()", 1000);
</script>
</body>
</html>