-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathleaderboard.html
413 lines (357 loc) · 12.7 KB
/
leaderboard.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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<!DOCTYPE html>
<html lang="en">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-108229209-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-108229209-1');
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Leaderboard | E-Cell, IIT Mandi</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
content="E-Cell, IIT Mandi | Entrepreneurship Cell, IIT Mandi, a club dedicated for the concatenation of ideas with palpability and discernity, is a student organisation that aims to instigate the entrepreneurial spirits among students." />
<meta name="robots" content="noodp" />
<meta name="keywords" content="Ecell iit mandi, ecell, iit mandi, iit" />
<meta name="author" content="E-Cell IIT Mandi" />
<!-- Facebook and Twitter integration -->
<meta property="og:title" content="E-Cell, IIT Mandi" />
<meta property="og:image" content="images/fbinteg.png" />
<meta property="og:url" content="" />
<meta property="og:site_name" content="" />
<meta property="og:description"
content="Entrepreneurship Cell, IIT Mandi is a student organisation that aims to instigate the entrepreneurial spirits among students." />
<meta name="twitter:title" content="E-Cell, IIT Mandi" />
<meta name="twitter:image" content="images/fbinteg.png" />
<meta name="twitter:url" content="" />
<meta name="twitter:card" content="" />
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="shortcut icon" href="images/ecell.png">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<!-- Stylesheets here -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/grid.css">
<link rel="stylesheet" href="css/header.css">
<link rel="stylesheet" href="css/section-1.css">
<link rel="stylesheet" href="css/events.css">
<link rel="stylesheet" href="css/contact.css">
<link rel="stylesheet" href="css/footer.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap"
rel="stylesheet">
<script src="https://kit.fontawesome.com/33e1de8163.js" crossorigin="anonymous"></script>
<style>
/* Add custom styles here */
body {
color: white;
}
#main {
margin: auto;
max-width: 600px;
}
.btn {
padding: 0 24px;
}
.scoring-rules-container {
position: relative;
padding: 24px 0 48px 0;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 2px;
transition: 0.5s;
overflow: hidden;
background: #1d2124;
}
.scoring-rules-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
border-top: 2px solid #21ebff;
border-left: 2px solid #21ebff;
transition: 0.5s;
transition-delay: 0.1s;
}
.scoring-rules-container :hover {
background: darkblue;
box-shadow: 0 0 50px blue;
transition-delay: 0.5s;
}
.scoring-rules-container::after {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 10px;
height: 10px;
border-bottom: 2px solid #21ebff;
border-right: 2px solid #21ebff;
transition: 0.5s;
transition-delay: 0.5s;
}
.scoring-rules-container :hover::before {
width: 100%;
height: 100%;
transition-delay: 0.5s;
}
.scoring-rules-container :hover::after {
width: 100%;
height: 100%;
transition-delay: 0.5s;
}
.score-btn {
color: aqua;
cursor: pointer;
}
.score-btn:hover {
color: rgb(108, 233, 233);
}
.modal-header {
border-bottom: 1px solid #1d2124;
}
.modal-footer {
border-top: 1px solid #1d2124;
}
.modal-content {
background-color: rgb(19, 17, 17);
}
.close {
color: white;
}
.close:hover {
color: rgb(180, 178, 178);
}
</style>
</head>
<body>
<header>
<div class="con-1">
<div class="flex">
<a tabindex="0" href="/" id="logo">
<img src="images/ecell.png">
</a>
<div id="header-menu" class="flex">
<div class="header-left">
<ul>
<li tabindex="0"><a href="team.html" class="nav-link">Team</a></li>
<li tabindex="0"><a href="leaderboard.html" class="nav-link">Leaderboard</a></li>
<li tabindex="0"><a href="#contact" class="nav-link">Contact us</a>
</ul>
</div>
<div class="header-right right">
<div>
<a href="/#events" tabindex="0" class="btn">Events</a>
</div>
<div>
<a tabindex="0" class="btn-outlined">Get started</a>
</div>
</div>
</div>
</div>
</div>
</header>
<main>
<!-- Top Section 1 Welcome -->
<section id="top-1" style="padding-top: 0;">
<div class="con-1 flex-c heading">
<h1 class="heading-56">Leaderboard</h1>
<div class="scoring-rules-container">
<button type="button" tabindex="0" class="btn btn-primary" data-toggle="modal"
data-target="#exampleModalLong">
Scoring Rules
</button>
</div>
<table id="lead-table" class="table table-striped table-dark">
<thead>
<th>#</th>
<th>Roll Number</th>
<th>Name</th>
<th>Score</th>
</thead>
<tbody id="lead-table-body"></tbody>
</table>
</div>
</section>
<!-- Modal -->
<div class="modal fade" id="scoreModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Event Wise Scores</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="scores-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- TODO -->
</main>
<footer>
<div class="footer con-2 flex">
<div class="col-3 flex-c footer-logo">
<img src="images/ecell.png">
<p>[email protected]</p>
<p><b>IIT Mandi, Kamand,<br>Himachal Pradesh</b></p>
</div>
<div class="col-3 flex-c">
<div class="footer-inner-title">
Sitemap
</div>
<div class="footer-inner-content">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/team.html">Team</a></li>
<li><a href="/leaderboard.html">Leaderboard</a></li>
<li><a href="/#contact">Contact Us</a></li>
</ul>
</div>
</div>
<div class="col-3 flex-c">
<div class="footer-inner-title">
Social Media links
</div>
<div class="footer-social-media">
<ul>
<li>
<i class="fab fa-facebook-f"></i>
<p>Facebook</p>
</li>
<li class="insta-pop-out">
<i class="fab fa-instagram"></i>
<p>Instagram</p>
</li>
<li>
<i class="fab fa-linkedin-in"></i>
<p>Linkedin</p>
</li>
<li class="yt-pop-out">
<i class="fab fa-youtube"></i>
<p>YouTube</p>
</li>
</ul>
</div>
</div>
<div class="col-3 flex-c">
<div class="footer-inner-title">
News Letter
</div>
<div class="footer-inner-content">
<p>E-Cell is a holographic abbreviation adopted by the entrepreneurship club of IIT Mandi.</p>
<input type="text" name="text" placeholder="Enter your Email">
<button class="footer-button">Subscribe</button>
</div>
</div>
</div>
</footer>
<!-- Info Modal -->
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Scoring Rules</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
The marking scheme is as follows for all events:<br>
200 - 1st position<br>
180 - 2nd position<br>
150 - 3rd position<br>
120 - special mentions<br>
100 - participants<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.22.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.22.0/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.22.0/firebase-auth.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/7.22.0/firebase-analytics.js"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "AIzaSyCgYIKmo-p9UXeN4vAe7QREClF14JLLo9I",
authDomain: "e-cell-iitmandi.firebaseapp.com",
databaseURL: "https://e-cell-iitmandi.firebaseio.com",
projectId: "e-cell-iitmandi",
storageBucket: "e-cell-iitmandi.appspot.com",
messagingSenderId: "93109878103",
appId: "1:93109878103:web:34970c428650f964c2d212",
measurementId: "G-E5DJP85NF0"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
<script>
window.eventWiseDetails = {}
// Score showing madal function
showMyScores = (roll) => {
console.log(roll);
var scoresBody = document.getElementById('scores-body');
var tableBody = ''
var data = window.eventWiseDetails[roll];
for (let event in data) {
tableBody += '<tr> <td> ' + event + ' </td> <td> ' + data[event] + ' </td> </tr>'
}
scoresBody.innerHTML = `
<table class="table table-striped table-dark">
<thead>
<th>Event</th>
<th>Score</th>
</thead>
<tbody>
` + tableBody + `
</tbody>
</table>
`;
$('#scoreModal').modal();
}
// Start the javascript from here
firebase.firestore().collection('leaderboard').orderBy('total', 'desc').get().then(snap => {
let tBody = document.getElementById('lead-table-body');
tBody.innerHTML = '';
let i = 1;
snap.forEach(doc => {
let data = doc.data();
tBody.innerHTML += '<tr> <td> ' + i + ' </td> <td> ' + doc.id + ' </td> <td> ' + data.name + ' </td> <td> <a class="score-btn" onclick="showMyScores(\'' + doc.id + '\')"> ' + data.total + ' </a> </td> </tr>';
window.eventWiseDetails[doc.id] = data.eventWise;
i++;
});
});
</script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
</body>
</html>