solutions/CCTF_Solutions_main/frontend/leaderboard.html

72 lines
2.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<title>Flag Submission Page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
2022-12-07 05:03:10 +00:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/web3/1.6.1/web3.min.js"
integrity="sha512-5erpERW8MxcHDF7Xea9eBQPiRtxbse70pFcaHJuOhdEBQeAxGQjUwgJbuBDWve+xP/u5IoJbKjyJk50qCnMD7A=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type = "text/javascript" src="./src/logic.js"></script>
</head>
<body style="height:1500px">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Flag Submission Page</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="leaderboard.html">Leaderboard</a></li>
<li><a href="sendflag.html">Send Flag</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><button class="btn btn-default navbar-btn" id="metamask-login" type="button" style="margin-right:20px"><span class="glyphicon glyphicon-log-in"></span> Connect Wallet</button></li>
<!--<button class="btn btn-danger navbar-btn">Button</button>-->
</ul>
</div>
</nav>
<div class="container" style="margin-top:50px">
<h1>Players and leaderboard</h1>
<table class="table table-striped" style="width: 75%" align="center">
<thead>
<tr>
<th>Player</th>
<th>Status</th>
<th>Points</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script type='module'>
2022-12-07 05:03:10 +00:00
let loginbutton = document.getElementById('metamask-login');
window.addEventListener("load", function () {
let accounts;
ethereum.request({method: 'eth_requestAccounts'}).then(accounts => {
if (accounts.length > 0) {
loginbutton.textContent = accounts[0];
loginbutton.disabled = true;
}
});
});
loginbutton.addEventListener('click', event => {
2022-12-07 05:03:10 +00:00
let account;
ethereum.request({method: 'eth_requestAccounts'}).then(accounts =>{
account = accounts[0];
loginbutton.textContent = account;
loginbutton.disabled = true;
})
})
</script>
</body>
</html>