-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
151 lines (151 loc) · 8.62 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>和时九一起记单词!</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="css/main.css">
<link rel="shortcut icon" type="image/png" href="./pics/favicon.png"/>
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="./jquery-3.3.1.min.js"></script>
<script src="./base64.min.js"></script>
<script>if (window.module) module = window.module;</script>
</head>
<body>
<div id="wholePage">
<div id="preloadCover">
<h1>和时九一起记单词!</h1>
<h2>Study With Nineteen</h2>
<p><a href="https://github.com/BeautyYuYanli/StudyWithNineteen">项目地址</a></p>
<p>加载中......</p>
<h3>程序&策划&剧本: Beautyyu @微笙无上计算机协会</h3>
<h3>立绘: 忆棠 @Stefanie漫研社</h3>
</div>
<div id="backgroundBoard">
<div id="coreGame" class="win1st" hidden>
<p>使用回车键提交答案</p>
<div id="gameArea" class="win2nd"></div>
<div id="inputArea" class="win2nd">
<div id="showTrans" class="win3rd"></div>
<div id="showHandle" class="win3rd">
<div id="exitGame" class="buttons" onclick="exitGame(1)"><img src="./pics/icons/baseline_arrow_back_white_48dp.png"></div>
<input id="inputWord" onkeydown="submitEvent(event)">
<div id="checkAnswer" class="buttons" onclick="submitWord(inputElement.value);inputElement.value='';inputElement.focus()"><img src="./pics/icons/baseline_check_white_48dp.png"></div>
</div>
</div>
<div id="gameOver" class="win2nd" hidden>
<div id="overTitle" class="win3rd">Game Over!</div>
<div id="showScore" class="win3rd"></div>
<div id="returnButton" class="buttons" onclick="returnButton()">返回主页</div>
</div>
</div>
<div id="mainBoard" class="win1st" hidden>
<div id="front">
<div id="showLevel" class="_win3rd">
<p class="secondaryWord colorDark">等级Level:</p>
<p class="primaryWord colorDark"></p>
</div>
<div id="showTotleEx" class="_win3rd">
<p class="secondaryWord colorDark">熟练度Ex:</p>
<p class="primaryWord colorDark"></p>
</div>
<div id="showUnlockedEvents" class="_win3rd">
<p class='secondaryWord colorDark'>已解锁的剧情事件:</p>
<div id="eventIcons"></div>
</div>
<div id="mainBoardButtons">
<div id="hardModeButton" class="buttons" onclick="playButton(1)">
<img src="./pics/icons/baseline_gamepad_white_48dp.png" class="icons">
<div>挑战!</div>
</div>
<div id="playButton" class="buttons" onclick="playButton()">
<img src="./pics/icons/baseline_send_white_48dp.png" class="icons">
<div>开始游戏!</div>
</div>
<div id="helpButton" class="buttons" onclick="showHelp()">
<img src="./pics/icons/baseline_help_white_48dp.png" class="icons">
<div>说明!</div>
</div>
<div id="importButton" class="buttons" onclick="showImport()">
<img src="./pics/icons/baseline_save_white_48dp.png" class="icons">
<div>
存档!
</div>
</div>
</div>
<div id="showLastScore" class="_win3rd">
<p class="secondaryWord colorLight">上次游戏成绩:</p>
<p class="primaryWord colorLight"></p>
</div>
<div id="showHistoryScore" class="_win3rd">
<p class="secondaryWord colorLight">历史最高成绩:</p>
<p class="primaryWord colorLight"></p>
</div>
</div>
</div>
<div id="showEvent" onclick="nextSentence()" hidden>
<p id="speaker">a</p>
<p id="speakWords">a</p>
</div>
<div id="showSaid"><div></div></div>
<div id="showNineteen" class="Nineteen">
<div id="clickFace" onclick="touched(1)"></div>
<img id="showFace" onclick="touched(0)">
<img id="showBody" onclick="touched(0)">
</div>
<div id="showNineteenBack" class="Nineteen" hidden>
<img id="showFaceBack">
<img id="showBodyBack">
</div>
</div>
</div>
<script src="scrips/coreGame.js"></script>
<script src="scrips/eventBoard.js"></script>
<script src="scrips/gameBoard.js"></script>
<script src="scrips/mainBoard.js"></script>
<script src="scrips/showNineteen.js"></script>
<script src="scrips/dictionary.js"></script>
<script>
function preloadImg(list, imgs) {
var def = $.Deferred(),
len = list.length;
$(list).each(function (i, e) {
var img = new Image();
img.src = e;
if (img.complete) {
imgs[i] = img;
len--;
if (len == 0) {
def.resolve();
}
} else {
img.onload = (function (j) {
return function () {
imgs[j] = img
len--;
if (len == 0) {
def.resolve();
}
};
})(i);
img.onerror = function () {
len--;
console.log('fail to load image');
};
}
});
return def.promise();
}
let list = ['pics/favicon.png', 'pics/favicon.ico', 'pics/icons/baseline_save_white_48dp.png', 'pics/icons/baseline_arrow_back_white_48dp.png', 'pics/icons/baseline_check_white_48dp.png', 'pics/icons/baseline_gamepad_white_48dp.png', 'pics/icons/baseline_send_white_48dp.png', 'pics/icons/baseline_help_white_48dp.png', 'pics/body/0401.webp', 'pics/body/0403.webp', 'pics/body/0102.webp', 'pics/body/0103.webp', 'pics/body/0411.webp', 'pics/body/0311.webp', 'pics/body/0211.webp', 'pics/body/0112.webp', 'pics/body/0301.webp', 'pics/body/0113.webp', 'pics/body/0213.webp', 'pics/body/0111.webp', 'pics/body/0201.webp', 'pics/body/0302.webp', 'pics/body/0402.webp', 'pics/body/0202.webp', 'pics/body/0303.webp', 'pics/body/0312.webp', 'pics/body/0412.webp', 'pics/body/0413.webp', 'pics/body/0101.webp', 'pics/body/0313.webp', 'pics/body/0203.webp', 'pics/body/0212.webp', 'pics/face/0114.webp', 'pics/face/0102.webp', 'pics/face/0103.webp', 'pics/face/1113.webp', 'pics/face/0108.webp', 'pics/face/0109.webp', 'pics/face/0110.webp', 'pics/face/0112.webp', 'pics/face/0113.webp', 'pics/face/0104.webp', 'pics/face/1110.webp', 'pics/face/0115.webp', 'pics/face/0119.webp', 'pics/face/1102.webp', 'pics/face/1105.webp', 'pics/face/1109.webp', 'pics/face/1107.webp', 'pics/face/1103.webp', 'pics/face/0117.webp', 'pics/face/1116.webp', 'pics/face/0105.webp', 'pics/face/0101.webp', 'pics/face/1101.webp', 'pics/face/1115.webp', 'pics/face/1108.webp', 'pics/face/0107.webp', 'pics/backgrounds/front.png', 'pics/backgrounds/4.jpg', 'pics/backgrounds/6.jpg', 'pics/backgrounds/5.jpg', 'pics/backgrounds/1.jpg', 'pics/backgrounds/3.jpg', 'pics/backgrounds/2.jpg', 'pics/help/help4.jpg', 'pics/help/help1.jpg', 'pics/help/help5.jpg', 'pics/help/help3.jpg', 'pics/help/help2.jpg'], imgs = [];
$.when(preloadImg(list, imgs)).done(
function () {
setTimeout(()=>{$('#preloadCover').fadeOut(300)}, 4000);
}
);
// mainBoardCreate(0);
eventBoardCreate(1);
console.log("控制台仅供演示使用")
</script>
</body>
</html>