-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
295 lines (259 loc) · 12.1 KB
/
index.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html>
<html>
<head>
<!--彩蛋画-->
<script type="text/javascript" src="js/log.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!--百度统计-->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?ecee3ae7c3d79d2324688ed651f923f2";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!--禁止缓存-->
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<!--<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>-->
<link rel="stylesheet" type="text/css" href="4.css">
<title>橙子背书系统_背书</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div id="jieshao">
<header>
<a href="javascript:void(0);" onclick="huana('study.html?bs=true');"><img src="images/back.png" id="b" alt="back"/></a>
<h1 id="oes">橙子背书系统_背书<工具升级中,升级回来更精彩!></h1>
</header>
<div id="main2">
<h1 id="btbt"><<这是一个标题哦!>></h1>
<h2 id="msms">一些描述文字</h2>
<a href="javascript:void(0);" onclick="document.getElementById('jieshao').style.display='none';document.getElementById('dati').style.display='block';sessionStorage.setItem('zi','0');sessionStorage.time=0;choose('0');sessionStorage.right=0;sessionStorage.wrong=0;sessionStorage.finish = 0;"><h2>开始背书!</h2></a>
<a href="javascript:void(0);" onclick="updateUrl('is_ai','true');alert('已经在这个模式了!');"><h3>背书双人对战V0.1(BETA)>>(维护中)</h3></a>
</div>
</div>
<div id="dati" style="display: none;">
<header>
<h1 id="oes1"><<这是一个标题哦!>>------0秒</h1>
</header>
<div id="main2">
<a href="javascript:void(0);" onclick="tap('1');"><textarea id="xx1" style="resize:none;width: 10vw;height:10vh;font-size:8vh;" readonly>第1个字</textarea></a>
<a href="javascript:void(0);" onclick="tap('2');"><textarea id="xx2" style="resize:none;width: 10vw;height:10vh;font-size:8vh;" readonly>第2个字</textarea></a>
<a href="javascript:void(0);" onclick="tap('3');"><textarea id="xx3" style="resize:none;width: 10vw;height:10vh;font-size:8vh;" readonly>第3个字</textarea></a>
<a href="javascript:void(0);" onclick="tap('4');"><textarea id="xx4" style="resize:none;width: 10vw;height:10vh;font-size:8vh;" readonly>第4个字</textarea></a>
<a href="javascript:void(0);" onclick="tap('0');"><textarea id="xx0" style="resize:none;width: 10vw;height:10vh;font-size:8vh;" readonly>第5个字</textarea></a>
<div id="beidezii" style="position: absolute;left:0vw;top:10vh;width:50vw;height:70vh;overflow-y:scroll;">
<br>
</div>
<div id="beidezii2" style="position: absolute;left:52vw;top:10vh;width:48vw;height:70vh;overflow-y:scroll;">
<br>
</div>
</div>
</div>
<div id="share" style="display: none;">
<header>
<a href="javascript:void(0);" onclick="document.getElementById('jieshao').style.display='block';document.getElementById('share').style.display='none';sessionStorage.clear();"><img src="images/back.png" id="b" alt="back"/></a>
<h1 id="oes">橙子背书系统</h1>
</header>
<div id="main2">
<h2 id="btbt1"><<这是一个标题哦!>></h2>
<h3 id="tmtm">time</h3>
<h3 id="rjrj"></h3>
<h3 id="sss">score</h3>
<h3 id="duii" style='color:green;'>对了</h3>
<h3 id="cuole" style='color:red;'>x了</h3>
<h3>默写错误(红色)</h3><br>
<h3 id="ywyw" style="position: absolute;left:0vw;top:50vh;width:50vw;height:70vh;overflow-y:scroll;">原文</h3>
<h3 id="ywyw2" style="position: absolute;left:52vw;top:50vh;width:48vw;height:70vh;overflow-y:scroll;">原文</h3>
</div>
</div>
<script type="text/javascript">
sessionStorage.rrrr = 0;
//获取参数
var request =
{QueryString : function(val){
var uri = window.location.search;
var re = new RegExp("" +val+ "=([^&?]*)", "ig");
return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);}}
var wenzhangid = request.QueryString("wenzhangid");
var is_ai = request.QueryString("is_ai");
function updateUrl(key, value){
var newurl = updateQueryStringParameter(key, value)
window.history.replaceState({path: newurl},'', newurl);}
function updateQueryStringParameter(key, value) {
var uri = window.location.href
if(!value) {return uri;}
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");var separator = uri.indexOf('?') !== -1 ? "&" : "?";if (uri.match(re)) {return uri.replace(re, '$1' + key + "=" + value + '$2');}else {return uri + separator + key + "=" + value;}}
//document.write("<script type='text/javascript' src=paper/" + wenzhangid + ".js?v=" + new Date().getTime() + ">");
document.write("<script type='text/javascript' src='example.js?v=" + new Date().getTime() + "'><\/script>");
</script>
<script>
document.getElementById('btbt').innerHTML=title;
document.getElementById('msms').innerHTML=tishi;
document.getElementById('btbt1').innerHTML=title;
window.onload=function(){setInterval(function(){yimiao();},1000);}
function yimiao(){
if(is_ai == "true")
{document.getElementById('oes').innerHTML="橙子背书系统_人机对战";}
var right = sessionStorage.right;//答对数量
var wrong = sessionStorage.wrong;//答错数量
var ygyw =document.getElementById('beidezii').innerHTML;
var ygyw2 =document.getElementById('beidezii2').innerHTML;
var wancheng = sessionStorage.finish;//判断游戏是否介绍哦
var xxxh = sessionStorage.zi;//第几个字
var oldtime = sessionStorage.time;//答题时间
if(oldtime != null && oldtime != undefined && wancheng != 1){
var ntt = Number(oldtime)+Number(1);
sessionStorage.time = ntt;}
document.getElementById('oes1').innerHTML = title + "------" + oldtime + "秒";
if (xxxh >= answer.length){document.getElementById('dati').style.display='none';document.getElementById('share').style.display='block';sessionStorage.finish = 1;
var scoreold = Number(right)*4 - Number(wrong);
if(oldtime < AI_FAST && Number(right) * Number(2) >= Number(answer.length)) {score = Number(scoreold) + (Number(AI_FAST) - Number(oldtime))*Number(5)}
if(oldtime > AI_FAST && oldtime < AI_SLOW) {score = Number(scoreold) + (Number(AI_SLOW) - Number(oldtime))*Number(0.5)}
if(oldtime > AI_SLOW) {score = Number(scoreold) - (Number(oldtime) - Number(AI_SLOW))*Number(0.5)}
document.getElementById('duii').innerHTML="你答对了:"+right+"个";
document.getElementById('cuole').innerHTML="你答错了:"+wrong+"个";
document.getElementById('ywyw').innerHTML=ygyw;
document.getElementById('tmtm').innerHTML="你的用时:"+oldtime+"秒";
document.getElementById('sss').innerHTML="你的得分:"+score+"分";
document.getElementById('ywyw2').innerHTML=ygyw2;
var rrrr = sessionStorage.rrrr;
if(is_ai == "true" && rrrr !=1)
{jqr();}
}
}
//jqr
function jqr(){
if(is_ai == "true")
{
var ssssss = Number(answer.length) / Number(3);
var rwrong = Math.floor(Math.random() * Number(ssssss));//r答错数量
var rright = Number(answer.length) - Number(rwrong);//r答对数量
var rtime = Math.floor(Math.random() * (Number(AI_SLOW) - Number(AI_FAST) + Number(1))) + Number(AI_FAST);
var rscore = Number(rright)*5 - Number(rwrong);
//var rscore = Number(rscoreold) + (Number(AI_SLOW) - Number(rtime))*Number(0.5);
if(rscore < score)
{var name = localStorage.name;document.getElementById('rjrj').innerHTML=name+" VS AI机器人----胜利!\n(AI得分:"+rscore+",正确"+rright+"个,错误"+rwrong+"个,用时"+rtime+"秒)";}
else if(rscore = score)
{var name = localStorage.name;document.getElementById('rjrj').innerHTML=name+" VS AI机器人----平局!\n(AI得分:"+rscore+",正确"+rright+"个,错误"+rwrong+"个,用时"+rtime+"秒)";}
else if(rscore > score)
{var name = localStorage.name;document.getElementById('rjrj').innerHTML=name+" VS AI机器人----失败!\n(AI得分:"+rscore+",正确"+rright+"个,错误"+rwrong+"个,用时"+rtime+"秒)";}}
sessionStorage.rrrr = 1;}
//选择
function tap(xuhao){
var laodezi =document.getElementById('beidezii').innerHTML;
var laodezi2 =document.getElementById('beidezii2').innerHTML;
var right = sessionStorage.right;//答对数量
var wrong = sessionStorage.wrong;//答错数量
var xxxh = sessionStorage.zi;
var xiedezixuhao = "xx" + xuhao;
var xiedezi = document.getElementById(xiedezixuhao).value;
if(xiedezi == answer[xxxh]){
sessionStorage.right = Number(right)+Number(1);
document.getElementById('beidezii').innerHTML=laodezi + "<p style='color:green;float:left;'>" +answer[xxxh]+ "</p>";
document.getElementById('beidezii2').innerHTML=laodezi2 + "<p style='color:green;float:left;'>" +answer[xxxh]+ "</p>";
}
if(xiedezi != answer[xxxh]){
sessionStorage.wrong = Number(wrong)+Number(1);
//document.getElementById('beidezii').innerHTML=laodezi + "<p style='color:red;float:left;'>" +answer[xxxh]+ "</p>";
document.getElementById('beidezii').innerHTML=laodezi + "<p style='color:red;float:left;'>" +xiedezi+ "</p>";
document.getElementById('beidezii2').innerHTML=laodezi2 + "<p style='color:red;float:left;'>" +answer[xxxh]+"</p>";
}
sessionStorage.zi = Number(xxxh) + Number(1);
var xxxh2 = sessionStorage.zi;
choose(xxxh2);
}
//生成
function choose(xh){
for(i=0;i<5;i++){
var id1 = Math.floor(Math.random() * answer.length);
var idd = "xx" + i;
var fff = document.getElementById(idd);
fff.innerHTML=answer[id1];
}
var id2 = Math.floor(Math.random() * 5);
var id3 = "xx" + id2;
var fullid = document.getElementById(id3);
fullid.innerHTML = answer[xh];
}
</script>
<audio src="audios/thebululessiscalling_compress.mp3" id="auaua" autoplay=autoplay loop="loop" style="display: block;">音乐加载失败</audio>
<script>
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', '/api/HSP_OES/uploadtime.php?'+Number(new Date()), true);
httpRequest.send();
httpRequest.open('GET', '/api/HSP_OES/checkvip.php?'+Number(new Date()), true);
httpRequest.send();
function huan(){
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', '/api/HSP_OES/uploadtime.php?'+Number(new Date()), true);
httpRequest.send();
window.onbeforeunload = huan;
}
setInterval(function(){ttime();},10000);
function ttime(){
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', '/api/HSP_OES/uploadtime.php?'+Number(new Date()), true);
httpRequest.send();
}
setInterval(function(){bgmusic();},500);
function bgmusic(){
var onn = localStorage.hsp_bg_music_on;
var time = localStorage.hsp_bg_music_time;
if (onn == null){localStorage.hsp_bg_music_on = "true";}
if (time == null){localStorage.hsp_bg_music_time = "0";}
var mid = document.getElementById("auaua");
localStorage.hsp_bg_music_time = Number(mid.currentTime);
}
if(localStorage.hsp_bg_music_on == "true"){bgmusicon();}
else if(localStorage.hsp_bg_music_on == "false"){bgmusicoff();}
function bgmusicon(){document.getElementById('auaua').play();localStorage.hsp_bg_music_on = "true";}
function bgmusicoff(){document.getElementById('auaua').pause();localStorage.hsp_bg_music_on = "false";}
function start(){
var timee = localStorage.hsp_bg_music_time;
var midd = document.getElementById("auaua");
midd.currentTime = Number(timee);}
start();
setInterval(function(){start();},50000);
function huana(a){
// if(a == 0){}
// else if(a == 1){}
// else if(a == 2){}
// else if(a == 3){}
var aa = "window.location.href='" + a + "'";
document.getElementById('aaa').style.display='block';
$(".aaa").addClass('change');
window.setTimeout(aa,800);
}
</script>
<style>
.aaa{
position: absolute;
background-color: #878787;
top: 0px;
left: 120vw;
width: 500vw;
height: 200vh;
transform:skew(-10deg);
-webkit-transform: skew(-10deg);
-moz-transform: skew(-10deg);
-o-transform:skew(-10deg);
-ms-transform:skew(-10deg);
}
.change{
animation: hahh 2s;
-webkit-animation: hahh 2s;
}
@-webkit-keyframes hahh /* Safari and Chrome */
{
from { left: 120vw;}
to {left: -200vw;}
}
</style>
<div class="aaa" style="display: none;" id="aaa"></div>
</body>
</html>