forked from TeamShellSMM/TeamShellSMM.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
289 lines (254 loc) · 10.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>#TeamShell</title>
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png">
<link rel="manifest" href="/assets/site.webmanifest">
<link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#01a19f">
<link rel="shortcut icon" href="/assets/favicon.ico">
<meta name="msapplication-TileColor" content="#01a19f">
<meta name="msapplication-config" content="/assets/browserconfig.xml">
<meta name="theme-color" content="#01a19f">
<link href="https://fonts.googleapis.com/css?family=Bangers&display=swap" rel="stylesheet">
<link href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.min.js" rel="stylesheet">
<link href="assets/teamshell.css?v=1.0.5" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.2/bootstrap3-typeahead.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/notify/0.4.2/notify.min.js"></script>
<script src="assets/script.js?v=0.0.1"></script>
<script>
var data,level_headers,tag_labels,spig_fav,clearers,clears,raw_data;
var tags_list;
var headers={
played:{"Code":0,"Player":1,"Completed":2,"Shelder":3,"Liked":4,"DifficultyVote":5,"Timestamp":6},
levels:{"No":0,"Code":1,"Creator":2,"LevelName":3,"Difficulty":4,"LevelStatus":5,"NewCode":6,"ClearVideo":7,"Timestamp":8,"Tags":9} //the no. is added in the code itslef.
}
function refresh(){
var dashboardData={
"numApproved":0,
"numPending":0,
"numMembers":0,
"numUnofficialMembers":0,
"numClears":0,
"numVotes":0,
"numLikes":0,
"numConsistency":0
}
var all_difficulty=["0.1"]
var difficulty_no={
"0.1":0
}
for(var i=0.5 ;i<=12;i+=0.5){
all_difficulty.push(i.toString())
difficulty_no[i.toString()]=0
}
data=JSON.parse(raw_data)
var level_headers=data.levels.shift()
var played_headers=data.played.shift()
clearers=[]
clears={}
tag_labels=data.tags
tags_list=[];
for(var i=0;i<data.played.length;i++){
if(clearers.indexOf(data.played[i][1])==-1){ //getting all the people who have submitted clears
clearers.push(data.played[i][1])
}
if(!clears[data.played[i][0]]) clears[data.played[i][0]]={}
clears[data.played[i][0]][data.played[i][1]]={ //compiling the clears in a [level-code][player] format
cleared:data.played[i][2],
vote:data.played[i][5],
liked:data.played[i][4]=="1"
}
}
var filtered_levels=[];
for(var i=0;i<data.levels.length;i++){ //main loop that processes all the stats for the levels
data.levels[i].unshift(i+1) //adds the id.
//data definition
var current_level=data.levels[i][1];
var current_creator=data.levels[i][2];
if(clears[current_level]){
for(var player in clears[current_level]){
if(clears[current_level][player].cleared=="1" && player!=current_creator){
dashboardData.numClears++
}
if(clears[current_level][player].vote){
dashboardData.numVotes++
}
if(clears[current_level][player].liked){
dashboardData.numLikes++
}
}
}
var include=true;
//get all the tags used from the data set
var curr_tags=data.levels[i][9].split(",")
for(var k=0;k<curr_tags.length;k++){
if(data.seperate.indexOf(curr_tags[k])!=-1){
include=false
}
}
if(data.levels[i][5]=="0"){
dashboardData.numPending++
}
if(include && data.levels[i][5]=="1"){
difficulty_no[data.levels[i][4]]++
dashboardData.numApproved++;
}
if(!include && data.levels[i][5]=="1"){
dashboardData.numConsistency++;
}
if(include && data.levels[i][5]=="1"){
filtered_levels.push(data.levels[i])
}
}
console.log(filtered_levels)
for(var i=0;i<data.members.length;i++){
if(data.members[i][2]=="1"){
dashboardData.numMembers++
} else {
dashboardData.numUnofficialMembers++
}
}
for(var i in dashboardData){
console.log(dashboardData[i])
$("#"+i).html(dashboardData[i])
}
console.log(all_difficulty)
console.log(difficulty_no)
var difficulty_no_data=[]
var backgroundColor=[]
for(var i=0;i<all_difficulty.length;i++){
difficulty_no_data.push(difficulty_no[all_difficulty[i]])
backgroundColor.push('rgba(248,133 , 1, 1)')
}
var ctx = document.getElementById('difficulty_chart');
var myChart = new Chart(ctx, {
type: 'horizontalBar',
responsive:true,
maintainAspectRatio: false,
data: {
labels: all_difficulty,
datasets: [{
//barThickness:20,
label: '# of levels with stated difficulty',
data: difficulty_no_data,
backgroundColor:backgroundColor,
/* backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
], */
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
//end main level loops
}
$(function(){
function getData(){
loadTeamshellApi(function(_rawData,dataNoChange){
if(dataNoChange){
$.notify("No new data was loaded",{
className:"success",
position:"top right",
});
}
raw_data=_rawData
refresh()
})
}
getData()
})
</script>
</head>
<body class="dark">
<div class="container">
<div class="row header-row">
<div class="col-12">
<h1><img src="assets/buzzySpin.gif"/> <span class="green">#Team</span><span class="orange">Shell</span> Levels</h1>
<ul id="nav"><li class="active"><a href="levels">Levels</a></li><li><a href="makers">Makers</a></li><li><a href="members">Members</a></li></ul>
<h4>Join the discord for more information: <a href="https://discord.gg/7tQJewa">https://discord.gg/7tQJewa</a></h4>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="darkmode">
<label class="form-check-label" for="darkmode">Dark Mode <i class="fa fa-moon-o" aria-hidden="true"></i></label>
</div>
</div>
<div class="col-6" style="display:none;">
<div class="row comp-winners" >
<div class="col-md-2" style="text-align: center;">
<i class="fa fa-trophy"></i>
</div>
<div class="col-md-10">
<div class="">
<h4>Winners - Shell and Tell 1 (SMB1-like)</h4>
<h6><div class="medal" style="margin-right:10px;"><div class="coin coin-gold"></div></div>Gimme Shellter by Hauspanther (3PG-DT0-NRF)</h6>
<h6><div class="medal" style="margin-right:10px;"><div class="coin coin-silver"></div></div>Rocky Mountains: #TeamShell by cheese_chicken3 (C16-BT1-NVG)</h6>
<h6><div class="medal" style="margin-right:10px;"><div class="coin coin-bronze"></div></div>#TeamShell: Buckets O. Fun v2 by Dekaizo (3PQ-0PV-LXF)</h6>
</div>
</div>
</div>
</div>
</div>
<style>
.dashboard td {font-size:1.2em;padding:0.5em;}
</style>
<div class="row">
<div class="col-md-6">
<table class="dashboard">
<tr><td>Official Levels</td><td id="numApproved">Loading</td></tr>
<tr><td>Pending Levels</td><td id="numPending">Loading</td></tr>
<tr><td>Members</td><td id="numMembers">Loading</td></tr>
<tr><td>Unoffical Members</td><td id="numUnofficialMembers">Loading</td></tr>
<tr><td>Clears</td><td id="numClears">Loading</td></tr>
<tr><td>Votes</td><td id="numVotes">Loading</td></tr>
<tr><td>Likes</td><td id="numLikes">Loading</td></tr>
<tr><td>TeamConsistency Levels</td><td id="numConsistency">Loading</td></tr>
<tr><td>Shell Jamps Done</td><td>A Lot</td></tr>
</table>
<h4>Levels by difficulty</h4>
<div class="chart-container" style="position: relative;width:100%;">
<canvas id="difficulty_chart"></canvas>
</div>
</div>
<div class="col-md-4">
<h4>We have a twitter now! <a href="https://twitter.com/TeamShellSMM">https://twitter.com/TeamShellSMM</a></h4>
<div class="embed-responsive-item">
<a class="twitter-timeline" data-theme="dark" href="https://twitter.com/TeamShellSMM?ref_src=twsrc%5Etfw">Tweets by TeamShellSMM</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
</body>
</html>