-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
105 lines (105 loc) · 4.01 KB
/
index.html
File metadata and controls
105 lines (105 loc) · 4.01 KB
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
<!DOCTYPE html>
<!--
作者:XCSOFT
时间:2020/07/07
Web:https://xsot.cn
Github: https://github.com/soxft/bugbug
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/soxft/cdn@1.0.1/mdui/css/mdui.min.css">
<script src="https://cdn.jsdelivr.net/gh/soxft/cdn@1.0.1/mdui/js/mdui.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>BUGBUGBUG</title>
</head>
<body>
<center>
<br />
<div class="mdui-container">
<div class="mdui-typo">
<h2 class="doc-chapter-title doc-chapter-title-first">BUG</h2>
<label class="mdui-switch">
BUG1 -> <input id="1" onclick="rand('1')" type="checkbox" /> <i class="mdui-switch-icon"></i>
</label>
<!--bug1-->
<br />
<label class="mdui-switch">
BUG2 -> <input id="2" onclick="rand('2')" type="checkbox" /> <i class="mdui-switch-icon"></i>
</label>
<!--bug2-->
<br />
<label class="mdui-switch">
BUG3 -> <input id="3" onclick="rand('3')" type="checkbox" /> <i class="mdui-switch-icon"></i>
</label>
<!--bug3-->
<br />
<label class="mdui-switch">
BUG4 -> <input id="4" onclick="rand('4')" type="checkbox" /> <i class="mdui-switch-icon"></i>
</label>
<!--bug4-->
<br />
<label class="mdui-switch">
BUG5 -> <input id="5" onclick="rand('5')" type="checkbox" /> <i class="mdui-switch-icon"></i>
</label>
<!--bug5-->
</div>
</div>
</center>
<script>
var $ = mdui.JQ;
//欢迎
mdui.snackbar({
message: "Welcome To Bugbug<br />Try how many times you can fix all Bugs"
});
function rand(x)
{
//随机指令
var result = $('#' + x + '').is(':checked', true);
console.log('[userControl]Turn ' + x + ' => ' + result); //获取用户操作
var items = [true,true,false]; //true的可能性必须大点对不对
for(j = 1;j <= 5;j++)
{
if(j == x)
{
//console.log("pass")
//如果操作与目前一致,则跳过
}else{
rex = items[Math.floor(Math.random()*items.length)];
$('#' + j + '').prop('checked', rex);
//console.log('(autoControl)Turn ' + j + ' => ' + rex)
}
}
//判断是否全部关闭
for(k = 1;k <= 5;k++)
{
if($('#' + k + '').is(':checked', true))
{
break;
}else{
if(k == 5)
{
mdui.snackbar({
message: "Unbelievable!You fixall Bugs!Why not try again?<br />You can contact me at contact@xcsoft.top"
});
}
}
}
}
//首先随机打开几个
num = Math.floor((Math.random()*3)+1); //获取随即打开的次数
console.log("[random_num] => " + num)
for (i = 1; i <= num; i++) {
re = Math.floor((Math.random()*5)+1);
if($('#' + re + '').is(':checked', true))
{
num++
//如果本来就是开着的
}else{
$('#' + re + '').prop('checked', true);
console.log("[OPEN] => " + re)
}
}
</script>
</body>
</html>