-
Notifications
You must be signed in to change notification settings - Fork 0
/
name.html
107 lines (93 loc) · 2.22 KB
/
name.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
<!-- Powered By PanDaoxi -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>随机点名器</title>
<link rel="shortcut icon" href="https://2022-14.github.io/files/images/23.ico">
<script>
var names = [/*名字*/];
var timer = null;
function fun() {
var val = document.getElementById("click");
if(val.value == "Start!") {
val.value = "Stop!";
val.style.backgroundColor = "#9d2933";
timer = setInterval("rotation()", 50);
}
else {
val.value = "Start!";
clearInterval(timer);
val.style.backgroundColor= "#003472";
}
}
function Random(max) {
var num1 = Math.random() * max;
return Math.floor(num1);
}
function rotation() {
var ranNum = Random(names.length);
document.getElementById("display").innerHTML = names[ranNum];
}
</script>
<style>
* {
margin: 0;
padding: 0;
}
.top {
width: 100%;
height: 70px;
}
.mid {
width: 550px;
height: 280px;
margin: auto;
padding: 15px;
border-radius: 25px;
background-color: #ffc64b;
}
.mid_top {
height: 55px;
background-color: #ffc64b;
}
.mid_mid {
width: 300px;
height: 87px;
margin: auto;
background-color: #fff2df;
border-radius: 15px;
vertical-align: middle;
line-height: 87px;
font-family: "SIMSUN";
font-weight: bolder;
font-size: 288%;
}
.kk {
height: 26px;
}
.button {
width: 145px;
height: 50px;
border-radius: 8px;
border: 0px;
background-color: #003472;
font-size: 25px;
color: #e0eee8;
font-family: "Consolas";
}
body {
background-image: url(https://pica.zhimg.com/80/069d69ab48864078ecfa6ae212f8d5d8_1440w.webp?source=1940ef5c)
}
</style>
</head>
<body>
<div class="top"></div>
<div class="mid">
<div class="mid_top"></div>
<div id="display" class="mid_mid" align="center">随机点名</div>
<div class="kk"></div>
<div class="mid_bottom" align="center"><input id="click" class="button" type="button" value="Start!" onclick="fun()"/></div>
</div>
</body>
</html>