-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprevious-team.html
131 lines (123 loc) · 7.9 KB
/
previous-team.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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="./main.css" rel="stylesheet" >
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<title>Team 2021 | ANCC IITD</title>
<!-- Codeforces CSS-->
<style type="text/css">.recent-actions{margin:1em;font-size:.9em}.rated-user{font-family:helvetica neue,Helvetica,Arial,sans-serif;text-decoration:none!important;font-weight:700;display:inline-block}.user-black{color:#000!important;font-weight:400!important}.user-legendary{color:red!important}.user-legendary::first-letter{color:#000!important}.legendary-user-first-letter{color:#000!important}.user-red{color:red!important}.user-fire{color:red!important}.user-yellow{color:#bb0!important}.user-violet{color:#a0a!important}.user-orange{color:#ff8c00!important}.user-blue{color:blue!important}.user-cyan{color:#03a89e!important}.user-green{color:green!important}.user-gray{color:gray!important}.user-admin{color:#000!important}</style>
</head>
<body style="background-color: black">
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand h1 my-0" href="index.html">ANCC</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-sm-0">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="socp.html">SoCP 2021</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="previous-team.html">Team 2023</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contests.html">Contests</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="px-3 pt-5 pb-4 mb-3 text-center text-white bg-dark" style="background-color: #747474; border-radius: 0 0 60% 60%/0 0 30% 30%; z-index: 9999; opacity: 1.0;">
<h1 class="display-2">Team of 2023</h1>
<hr class="my-3 mx-5">
</div>
<main class="container my-4">
<div id="stars" style="z-index: -1;"></div>
<div id="team" class="row row-cols-md-4 g-4 text-white"></div>
</main>
<div class="py-4"><div>
<footer class="page-footer fixed-bottom font-small text-white py-3 bg-dark">
<div class="container-fluid text-center">
Copyright © 2022 ANCC IIT Delhi
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
<script type="text/javascript">
function generateCard(name, position, codeforces, github, linkedin) {
let card = "<div class='col text-white'><div class='card text-center' style='background-color: #22262A'><div class='card-header py-1' style='background-color: #181A1D'><h5 class='card-title'>"+name+"</h5><h6 class='card-subtitle mb-1 text-muted'>"+position+"</h6></div><div class='card-body py-2'>"
if (linkedin !="") card+= "<a target='_blank' href="+linkedin+" class='card-link'><svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='currentColor' class='bi bi-linkedin bg-white rounded-1' viewBox='0 0 16 16'><path d='M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z'/></svg></a>";
if (github !="") card+="<a target='_blank' href='https://github.com/"+github+"' class='card-link text-white'><svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='currentColor' class='bi bi-github' viewBox='0 0 16 16'><path d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z'/></svg></a>";
if (codeforces !="") card+="<a target='_blank' href='https://codeforces.com/profile/"+codeforces+"' class='card-link rated-user user-black'>"+codeforces+"</a>";
card+="</div></div></div>";
return card;
}
function updateColors() {
var users = document.getElementsByClassName('rated-user');
var query="";
for (var i=0; i<users.length; i++) {
query+=users[i].innerText+";";
}
let API = new XMLHttpRequest();
API.open("GET", "https://codeforces.com/api/user.info?handles="+query, true);
API.onload = () => {
let cf = JSON.parse(API.responseText);
for (var i=0; i<users.length; i++) {
color="black";
switch(cf.result[i].rank) {
case "newbie" : color = "gray"; break ;
case "pupil" : color = "green" ; break ;
case "specialist" : color = "cyan" ; break ;
case "expert" : color = "blue" ; break ;
case "candidate master" : color = "violet" ; break ;
case "master" : color = "orange"; break ;
case "international master" : color = "orange"; break ;
case "grandmaster" : color = "red"; break;
case "international grandmaster" : color = "fire"; break;
case "legendary grandmaster" : color = "legendary"; break;
}
users[i].className="card-link rated-user user-"+color;
}
}
API.send(null);
}
function getTeam() {
let Sheet = new XMLHttpRequest();
Sheet.open("GET","https://docs.google.com/spreadsheets/d/16Gp1oacm_Nwp8ZH8F8RqVIE5MMwMjYp7Z7IIYruwI78/export?format=tsv&gid=484472445#gid=484472445",true);
Sheet.onload = () => {
let values=Sheet.responseText;
let index=[];
let firstRow=true;
let rows=values.split('\r');
teamstr="";
rows.forEach(r=> {
cols=r.split('\t');
if(firstRow){
cols.forEach(col=>index.push(col));
}
else {
let detailsMap={};
for(let i=0;i<cols.length;i++){
detailsMap[index[i]]=cols[i];
}
teamstr+=generateCard(detailsMap["Name"],detailsMap["Position"],detailsMap["Handle"],detailsMap["Github Username"],detailsMap["LinkedIn Profile"]);
}
firstRow=false;
})
document.getElementById('team').innerHTML=teamstr;
updateColors();
}
Sheet.send(null);
}
getTeam();
</script>
</body>
</html>