forked from pranavgade20/foss-leaderboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (67 loc) · 1.7 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FOSS | Leaderboard</title>
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
<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="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap">
<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #3c3c3c;
color: #fff;
text-align: center;
padding: 50px;
}
h1 {
font-size: 36px;
margin-bottom: 50px;
}
table {
width: 100%;
margin: 0 auto;
border-collapse: collapse;
}
th, td {
padding: 10px;
border-bottom: 1px solid #333;
text-align: center;
}
th {
background-color: #333;
}
tr:nth-child(odd) {
background-color: #444;
}
@media only screen and (max-width: 600px) {
table {
width: 90%;
}
h1 {
font-size: 28px;
}
}
</style>
</head>
<body>
<h1>FOSS | Leaderboard</h1>
<table x-data="{ leaderboard: {} }"
x-init="async function() { const resp = await fetch('/leaderboard'); leaderboard = await resp.json(); }">
<tr>
<th>Rank</th>
<th>Username</th>
<th>Score</th>
</tr>
<template x-for="(user, index) in Object.keys(leaderboard)">
<tr>
<td x-text="index+1"></td>
<td x-text="user"></td>
<td x-text="leaderboard[user]"></td>
</tr>
</template>
</table>
</body>
</html>