-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-answer-day04.html
188 lines (156 loc) · 7.68 KB
/
get-answer-day04.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
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/newStyle.css">
<link rel="stylesheet" type="text/css" href="css/nav.css">
<link rel="stylesheet" type="text/css" href="css/new_main.css">
<link rel="stylesheet" type="text/css" href="css/code_windows.css">
<link rel="icon" href="img/logo_1.png" type="image/x-icon">
<link rel="shortcut icon" href="img/logo_1.png" type="image/x-icon">
<script async defer data-website-id="0a453f1f-f1bc-4f69-9772-6a1e6cfea828" src="https://stat.buctsnc.cn/umami.js"></script>
<title>Day 4</title>
</head>
<script src="./js/jquery.js"></script>
<script src="./js/typist.js"></script>
<body>
<header id="nav" style="display: none">
<img class="logo" src="img/buctlogo.png" alt="logo">
<img class="logo" src="img/snclogo.png" alt="logo">
</header>
<div class="answer_div" id="submit_form" style="display: none">
<form name="answer_form" method="post" class="answer_form" onsubmit="checkSubmit()">
<table>
<tr>
<td>用户名:</td>
<td><input id="nickname" name="nickname" type="text" placeholder="注册过用户名" autocomplete="off" class="text_area"></td>
<td>没有注册?<a href="register.html">注册</a></td>
</tr>
<tr>
<td>电话号码:</td>
<td><input id="contact" name="contact" type="text" placeholder="注册过的电话号码" autocomplete="off" class="text_area"></td>
<td></td>
</tr>
<tr>
<td>获得的答案:</td>
<td><input id="answer_q4" name="answer_q4" type="text" placeholder="Day 4答案" autocomplete="off" class="text_area"></td>
<td>没有找到?<a href="day-04-index.html">返回</a> </td>
</tr>
</table>
<div class="get_answer_button">
<button class="gab" type="reset" onclick="">重新输入</button>
<!-- <button class="gab" type="button" onclick="submits()">提交答案</button>-->
<button class="gab" type="button" onclick="submits()">提交答案</button>
</div>
</form>
</div>
<!--提交后显示内容-->
<div class="code_window" style="display: none; width: 800px; position:absolute; left: 50%; transform: translateX(-50%)">
<div class="code_window_title">
<div class="window_close"></div>
<div class="window_min"></div>
<div class="window_max"></div>
</div>
<div class="code_block">
<div id="input" style="display: none; font-size: 18px !important;">
<div style="font-size: 24px !important; background-color: rgb(23, 21, 21) !important;">《矩阵世界指南》</div>
<p> update at cyberyear 1010/10/01</p>
<p>“你好,古老的智慧体,欢迎来到矩阵世界,我是终端机04。如你所见,赛博文明在cyberyear 1010/10/00
毁灭了。届时赛博文明修复程序启动,将承载赛博文明的核心技术封存与矩阵内,跃迁至前赛博纪元的宇宙坐标,等待符合标准的智慧体,重启赛博文明的辉煌。</p>
<p>
赛博文明是一个人与机器平等的文明。由于通过矩阵科技可以实现有机体与程序体的相互转换,赛博公民们可以自由选择意识的存在形式(即以有机体存在或以程序体存在)。这一技术虽然在一定程度上奠定了人权与机械权的绝对平等,但是随着自私心理的膨胀,通过在人与机器的不断转换来规避公民义务的行为大为流行。至此,赛博文明走向衰落......在赛博文明苟延残喘的最后一年,遍地都是抽去意识的被抛弃的有机体,中央存储库也被支离破碎的混乱的程序体塞满。而我的创造者——赛博文明最后一个睿智的老人,早早的预言了这一天的到来,让我将这项技术改善,令其不在能够被滥用,再送回合适的时间点,以重启赛博文明。</p>
<p>
为了避免悲剧的再次发生,转换条件加入了严格的限制,防止频繁的转换影响社会秩序。如果有机体想要转换为程序体,则需找到愿意自我销毁的程序体,覆盖ta的存在。反之,程序体要想转换为有机体,也要找到愿意抛弃自己的灵魂的有机体。</p>
<p>“现在,你已被矩阵选中机会仅有一次,是否要参与转换?”</p>
<p>“我......”</p>
</div>
<div id="output" style="background-color: rgb(23, 21, 21) !important;"></div>
</div>
</div>
</body>
<script>
window.onload = function(){
$("#nav").fadeIn();
$("#submit_form").fadeIn();
}
let submit = false;
function checkSubmit() {
if(!submit) {
// 表单提交后设置标志位
submit = true;
return true;
}
// 表单已经提交,不允许再次提交
console.log("请不要重复提交表单!");
return false;
}
function isLegalName (str) {
let re = /^[0-9a-zA-Z]*$/;
if (!re.test(str) || str.indexOf(" ") != -1) {
return false;
} else {
return true;
}
}
function isLegalTel(str) {
let re = /^[0-9|+]*$/;
if (!re.test(str) || str.indexOf(" ") != -1) {
return false;
} else {
return true;
}
}
function check(nickname, contact, answer_q4) {
if(nickname.length < 1 || contact.length < 10 || answer_q4.length < 1){
return false;
}
return true;
}
function submits() {
let nickname = document.getElementById("nickname")
let contact = document.getElementById("contact")
let answer_q4 = document.getElementById("answer_q4")
if(check(nickname.value, contact.value, answer_q4.value) && isLegalName(nickname.value) && isLegalTel(contact.value)){
$.ajax({
url:"https://sncdeveloper.cn:8000/argProject/day04",
// url:"http://127.0.0.1:8000/ARG/day04",
method:"post",
async:"false",
data:{"nickname":nickname.value,"contact":contact.value,"answer_q4":answer_q4.value},
dataType:"json",
contentType:"application/x-www-form-urlencoded",
success(result){
nickname.value = ""
contact.value = ""
answer_q4.value = ""
window.alert(result.msg)
if(result.data.solveStatus==1){
onClick();
}
},
error(msg){
console.log("error"+msg)
window.alert("活动太火爆了,请稍后再试")
}
})
}else{
if (!isLegalName(nickname.value))
alert("用户名只能由数字和字母组成!");
else
alert("联系方式格式有误或答案为空,请重新输入")
}
}
function onClick() {
let source = document.getElementById('input');
let output = document.getElementById('output');
let typing = new Typing({
source,
output,
delay: 15
});
$("#submit_form").fadeOut();
$('.code_window').fadeIn();
typing.start();
}
</script>
</html>