-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatus.html
191 lines (185 loc) · 9.26 KB
/
status.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>STEAM Games</title>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="common/master.css">
<link rel="stylesheet" type="text/css" href="theme.css">
<script src="fontawesome.js"></script>
<script src="js/jquery.min.js"></script>
<script src="masterFunc.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="status.css"> -->
</head>
<body onload="loading()">
<div class="container-fluid mb-5">
<header>
<div class="row justify-content-center">
<img id="banner" src="imgs/Logo.png" class="col-8 col-sm-4 col-md-4 col-lg-2 col-xl-1" alt="Logo" onclick="window.location.href='/'">
</div>
<div class="row justify-content-center">
<p class="text-center subtitle">STEAM Games Challenges - Tranh tài STEAM với MISers!</p>
</div>
</header>
<nav>
<div class="row justify-content-center mb-3">
<p class="text-center mr-3"><a href="about.html">Về dự án</a></p>
<p class="text-center"><a href="support.html">Hỗ trợ chúng tôi</a></p>
</div>
</nav>
<div class="alert"></div>
<main class="mb-2">
<div class="progress mb-4">
<div id="puzzle" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Ghép hình</div>
</div>
<div class="progress mb-4">
<div id="maze" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Mê cung lạc lối</div>
</div>
<div class="progress mb-4">
<div id="bird" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Chim tìm mồi</div>
</div>
<div class="progress mb-4">
<div id="turtle" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Rùa vẽ hình</div>
</div>
<div class="progress mb-4">
<div id="movie" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Làm phim</div>
</div>
<div class="progress mb-4">
<div id="music" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Nghệ sĩ</div>
</div>
<div class="progress mb-4">
<div id="pond-tutor" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Nhập môn đại chiến</div>
</div>
<div class="progress">
<div id="pond-duck" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Đại chiến trên hồ</div>
</div>
</main>
<footer>
<div class="row align-items-center ml-0 mr-0 mb-2">
<div class="dropdown languages" style="display: inline-block;">
<button id="changeLanguages" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Tiếng Việt</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" onclick="delCookie('lang');setCookie('lang', 'en', 365);location.reload();">English</a>
<a class="dropdown-item" onclick="delCookie('lang');setCookie('lang', 'vi', 10);location.reload();">Tiếng Việt</a>
</div>
</div>
<a href="" style="color: unset;display: inline-block;" class="ml-2"><i class="fas fa-adjust fa-lg mt-2" onclick="changeTheme();"></i></a>
</div>
<p id="clearDataPara" style="display: none;" class="mb-1">Bạn muốn bắt đầu lại?<button class="btn btn-primary" id="clearData" onclick="deleteData()">Bấm vào đây</button></p>
<p id="statusPara">Bạn muốn xem lịch sử <button class="btn btn-primary" id="clearData" onclick="window.location.href='status.html'">Bấm vào đây</button></p>
<script type="text/javascript">
if (checkTheme() == "dark") {
$(".theme button").addClass("bg-dark text-light")
$(".languages button").addClass("bg-dark text-light")
$("#clearDataPara").addClass("dark")
$("#statusPara").addClass("dark")
} else {
$(".theme button").addClass("bg-light text-dark")
$(".languages button").addClass("bg-light text-dark")
$("#clearDataPara").addClass("light")
$("#statusPara").addClass("light")
}
if (checkLanguage() == "en") {
document.getElementById('changeLanguages').innerText = 'English';
$("#clearDataPara").html("Want to start over?" + '<button class="btn btn-primary" id="clearData" onclick="deleteData()">Click here</button>');
$("#statusPara").html("Want to see status?" + '<button class="btn btn-primary" id="clearData" onclick="loadStatus()">Click here</button>');
}
clearDataButtonShow();
</script>
</footer>
</div>
<script type="text/javascript">
function loading() {
$("header").load("header.html");
$("nav").load("nav.html");
$("footer").load("footer.html");
$(".alert").load("alert.html");
clearDataButtonShow();
$(".progress-bar").width("0%");
$(".progress").height("2rem");
$(".progress").css("fontSize", "0.8rem");
if (checkLanguage() === "en") {
document.getElementById('pond-duck').innerHTML = 'Pond';
document.getElementById('pond-tutor').innerHTML = 'Pond Tutor';
document.getElementById('music').innerHTML = 'Music';
document.getElementById('movie').innerHTML = 'Movie';
document.getElementById('turtle').innerHTML = 'Turtle';
document.getElementById('bird').innerHTML = 'Bird';
document.getElementById('maze').innerHTML = 'Maze';
document.getElementById('puzzle').innerHTML = 'Puzzle';
}
if (checkTheme() == "dark") {
$("body").addClass("dark");
$(".subtitle").addClass("dark");
$(".progress").addClass("bg-dark")
showStatus("dark");
// $(".progress div").addClass("text-light")
} else {
$("body").addClass("light");
$(".subtitle").addClass("light");
$(".progress").addClass("light")
// $(".progress div").addClass("text-dark")
showStatus("light");
}
}
function calcPercent(completed) {
var percent = 10 * completed;
return percent;
}
function getData(name) {
if (name !== "puzzle") {
var exits = 0;
for (i = 1; 10 >= i; i++) {
if (localStorage.getItem(name + i) !== null) {
exits++;
};
}
return calcPercent(exits);
} else if (localStorage.getItem(name + 1) !== null) {
return 100;
} else {
return 0;
}
}
function showStatus(theme) {
exits = checkExitsData();
if (exits != 0) {
for (a = 0; a < gameNames.length; a++) {
var getWidth = getData(gameNames[a]);
if (getWidth > 60) {
$("#" + gameNames[a]).addClass("bg-success");
} else if (getWidth > 25) {
$("#" + gameNames[a]).addClass("bg-warning");
$("#" + gameNames[a]).addClass("text-dark");
} else if (getWidth > 0) {
$("#" + gameNames[a]).addClass("bg-danger");
} else {
if (theme == "dark") {
$("#" + gameNames[a]).addClass("text-light");
} else {
$("#" + gameNames[a]).addClass("text-dark");
}
$("#" + gameNames[a]).addClass("ml-3");
}
$("#" + gameNames[a]).animate({
width: getWidth + '%'
}, 750);
}
} else {
if (theme == "dark") {
$(".progress-bar").addClass("text-light");
} else {
$(".progress-bar").addClass("text-dark");
}
$(".progress-bar").addClass("ml-3");
$(".progress-bar").animate({
width: "0%"
}, 1);
}
}
</script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>