-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.html
178 lines (176 loc) · 4.92 KB
/
1.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui" charset="utf-8">
<meta charset="utf-8">
<title>外出登记</title>
<style type="text/css">
body, html{
background-color: #e1edfe;
margin: 0;
}
.topcard{
font-family: "comic sans ms";
font-size: 15px;
background-color: #1eb2b1;
height: 22vh;
padding: 5vw;
margin: 4vh 5vw 0 5vw;
width: 80vw;
border-radius: 10px;
color: white;
display:grid;
grid-template-columns: 65% 35%;
}
.topcard div{
margin-bottom: 0;
}
.pic{
height: 100%;
background-color: black;
background-image:src= "src/gaochunchun.jpg";
background-size: cover;
}
.topcard p{
padding-top: 2px;
margin-top: 1px;
margin-bottom: 1px;
padding-left: 5px;
}
.main{
background-color: #ffffff;
height: 58vh;
margin-left: 10vw;
width: 80vw;
border-radius: 0px 0px 10px 10px;
box-shadow:inset 0px 16px 15px -11px #a5d1cf;
}
.main img{
margin-top: 6vh;
margin-left: 10vw;
height: 60vw;
}
.main p{
text-align: center;
}
#date3, #time{
font-size: 20px;
font-weight: 700;
}
#time{
padding-left: 10px;
color:#ff2a2a;
}
#timer{
font-weight: 900;
color:#fe3434;
font-size: 4em;
position: absolute;
z-index: 10;
padding-top: 18vh;
padding-left: 18%;
-webkit-text-stroke: #fff003 2px;
}
.bottom{
margin-left: 0;
margin-right: 0;
margin-top: 4vh;
width: 100vw;
text-align: center;
font-weight: 200;
font-size: 12px;
color: #8d8f91;
}
[contenteditable="true"]{
transition: 200ms background-color;
}
[contenteditable="true"]:focus{
background-color:#265973;
}
</style>
</head>
<body>
<div class="topcard">
<div>
<p style="font-weight: 700; padding-top: 5px; font-size: 23px; padding: 4px;" contenteditable="true">
<span id="surname">高</span><span id="givenname">春春</span>
</p>
<p contenteditable="true">
学号:20<span id="18">18</span>02<span id="random">70</span><span id="random2">11</span><span id="random3">06</span>
</p>
<p contenteditable="true">
班级:电子信息工程1801
</p>
<p contenteditable="true">
开始:<span id="date1"></span> 07:00
</p>
<p contenteditable="true">
结束:<span id="date2">2020-01-10</span> 23:30
</p>
</div>
<label for="file" style="cursor: pointer;"><div class="pic"></label><img id="output" src="src/gaochunchun.jpg" style="overflow: hidden; height: 100%; width: 100%; min-height: 100%; max-height: 100%;"/>
</div>
</div>
<input type="file" name="image" id="file" onchange="loadFile(event)" accept="image/*" style="display: none;"/>
<div class="main">
<span id="timer"><span id="countdown">181</span>S</span>
<img src="https://ae01.alicdn.com/kf/U3c8bee9c59884da48cd2770c714641e0Y.jpg" >
<p><span id="date3">Date </span><span id="time"></span></p>
</div>
<p class="bottom">请尽快向保安出示该页面,倒计时结束后页面将失效</p>
<script>
function checkTime(i){
return (i < 10) ? "0" + i : i;
}
setInterval(displayTime, 100);
function displayTime (){
var currentTime = new Date(),
h = checkTime(currentTime.getHours()),
m = checkTime(currentTime.getMinutes()),
s = checkTime(currentTime.getSeconds());
document.getElementById("time").innerHTML = h+":"+m+":"+s;
}
</script>
<script>
var timeleft = 181;
var timer = setInterval(function(){
timeleft--;
document.getElementById("countdown").textContent = timeleft;
if (timeleft <=0)
clearInterval(timer)},1000);
</script>
<script>
var a = Math.floor((Math.random()*9)+1);
var x = Math.floor(a+10);
document.getElementById("random").innerHTML = x;
document.getElementById("random2").innerHTML = x + 13;
document.getElementById("random3").innerHTML = 4*x - a;
document.getElementById("randomsp").innerHTML = Math.floor(Math.random() * (3 + 1) + 17);
</script>
<script>
var loadFile = function(event) {
var image = document.getElementById('output');
image.src = URL.createObjectURL(event.target.files[0]);
}
</script>
<script>
var today = new Date();
var y = today.getFullYear();
var m = today.getMonth() + 1;
var d = today.getDate();
document.getElementById('date1').innerHTML = y+"-"+m+"-"+d;
document.getElementById('date2').innerHTML = y+"-"+m+"-"+d;
document.getElementById('date3').innerHTML = y+"-"+m+"-"+d;
</script>
<script>
var surList = new Array("高");
var randomName = Math.floor(Math.random()*surList.length);
document.getElementById("surname").innerHTML = surList[randomName];
</script>
<script>
var givenList = new Array("春春");
var randomName2 = Math.floor(Math.random()*givenList.length);
document.getElementById("givenname").innerHTML = givenList[randomName2];
</script>
</body>
</html>