forked from opencodeiiita/Leaderboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (70 loc) · 3.8 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
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/" crossorigin="anonymous"></script>
<title>Opencode'22 Leaderboard</title>
<link rel="stylesheet" href="styles.css">
</head>
<body class="backgroundcolor">
<!-- Adding both the images -->
<img align="left" src="https://s3-alpha-sig.figma.com/img/15df/1a48/0c9c722d2bc9918e40daf6eca7286224?Expires=1673222400&Signature=MStGJ60pVDTTzRwYcPAICh5DKYSygkMKJzutb9oiy1sQOcwKve5vX5nqIE1hqJlhoZZ~~04cLkp4M2xePhG6EK~VCWKA7UuEvZSxMnGu8oiI05yNpBcgW2sjOYht8D1MGlcVRN~lxkvQnGvOVsONVI7EJeOA3bWGYUJuMfzgEt8b9GeVa7e6t6MtYLBxXQSARILJ8DlTJj5EnI5aH8N0ZTuCnjzaqqNZD7aQKV1EbAjdbGnTXfshoG5pQq1~cN1iarMYjX~du7v4FK9givB1Rfl1dNCDoI4QXyjZbwBJZhyS5ggGgwuIDhixTvBcqRskMfhH9dRcHZ~AUwpQzSB~zw__&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4" alt="Nature" class="responsiveimage">
<img align="right" src="https://s3-alpha-sig.figma.com/img/f56a/92ea/e74f1c6a357f88f9f1b839833174dc35?Expires=1673222400&Signature=HC~SJkAIad1zToUooRqVSQZ50Q2-K2RafQhVKp70QeVV8T-j6BGAX3j78bt2Qce3oNQOT9R~x5aj~Ch05ygPqtfspWdg5EKoK7M5GA8FJWPzuvvaKmBx0OXCMyW3OL-xJGs~wH2gkGqt5YuHXrdxPVSvWJ7zk9VvWe~lDSK6qdKF0R42ny1LBEi~n4IuLeDRRGTqZN8J9sleuhSQV7s8vkcOPyH5VIm1jsZbMxQWvovx6-uGqs9Ilp~uxGiE4LYn-FuNSF5Q4Xh3RugDfv0e3spEF2vydN0NEOFySfwhHmfGfJAUYUEVDGrZp1KKpGLFBzosriNph7uscDuCRASXRA__&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4" alt="Nature" class="responsiveimage">
<!-- Adding title -->
<p class="heading1" style="font-size:3vw;"> OPENCODE'22</p>
<p class="heading2" style="font-size:4.5vw;"> Leaderboard</p>
<p class="headingsub" style="font-size:1.5vw;"> Organised by Geekhaven</p>
<!-- Adding bubbles in background -->
<div class="ellipse1"></div>
<div class="ellipse2"></div>
<div class="ellipse3"></div>
<div class="ellipse4"></div>
<div class="ellipse5"></div>
<div class="ellipse6"></div>
<div class="ellipse7"></div>
<table id="pointsTable">
<thead>
<tr>
<th>Rank</th>
<th>Username</th>
<th>Name</th>
<th>College</th>
<th>Points</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script>
async function getData(){
let res = await fetch('https://opencode-leaderboard-homewardgamer.koyeb.app/get-all-data/?page=1');
let data = await res.json();
return data.data;
}
getData()
.then(data => {
addToTable(data.data)
})
function addToTable(data) {
var rank=0;
var lastPoints = -1;
data.forEach(contributor => {
name=contributor.username;
points= contributor.totalPoints;
fullname= contributor.name;
college= contributor.college;
if(points!=lastPoints){
rank++;
lastPoints= points;
}
var markup = "<tr><td>"+ rank + "</td><td> " + " " + name + "</td><td> " + " " + fullname + "</td><td> " + " " + college + "</td><td> " + " " + points + "</td></tr>";
$("table tbody").append(markup);
});
}
</script>
</body>
</html>