-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
59 lines (58 loc) · 2.2 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="LF Decentralized Trust TAC Eligibility Check">
<title>LF Decentralized Trust TAC Eligibility Check</title>
<link rel="stylesheet" href="/pure-min.css">
<link rel="stylesheet" href="/grids-responsive-min.css">
<link rel="stylesheet" href="/font-awesome.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="splash-container">
<div class="splash">
<h1 style="text-align: center;">
<img src="lfdt-logo.png" width="100" height"100" alt="">
</h1>
<p class="splash-subhead">
Check your GitHub ID to confirm<br>your eligibility:
</p>
<form id="frm">
<input id="githubID" type="text" name="githubID" onkeypress="handle(event)">
<input type="button" onclick="check()" value="Check">
</form>
<p class="splash-subhead" id="results"></p>
Hashes updated
Thu Oct 17 19:57:51 UTC 2024
</div>
</div>
</body>
<script src="md5.js"></script>
<script src="hashes.js"></script>
<script>
function check() {
let githubID = document.getElementById("githubID").value.trim().toLowerCase();
console.log(githubID);
let hash = md5(githubID);
console.log(hash);
let [eligibleToVote, eligibleToRun] = Hashes.check(hash);
if (eligibleToVote && eligibleToRun) {
document.getElementById("results").innerHTML = "You are eligible to vote.<br>You are eligible to run."
} else if (eligibleToVote) {
document.getElementById("results").innerHTML = "You are eligible to vote."
} else if (eligibleToRun) {
document.getElementById("results").innerHTML = "You are eligible to run."
} else {
document.getElementById("results").innerHTML = 'You are not eligible to vote nor run.<br>If you think this is an error, please email <a href="mailto:[email protected]?subject=TAC Eligibility&body=My name:%0D%0AMy GitHub ID%0D%0AI believe I should be eligible to vote because...%0D%0AI believe I should eligible to run because...">the election staff.</a>'
}
}
function handle(e) {
if(e.keyCode === 13) {
e.preventDefault();
check();
}
}
</script>
</html>