195 lines
7.5 KiB
HTML
195 lines
7.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<title>Shikigrid: Home</title>
|
|
<meta charset="UTF-8">
|
|
|
|
|
|
<script src="/static/js/dist.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/static/css/main.css">
|
|
|
|
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
|
|
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
|
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
$.get("https://grid-api.toshiki.dev/api/v1/total", function (data) {
|
|
$.get("https://grid-api.toshiki.dev/api/v1/total/aps", function (data2) {
|
|
document.getElementById("landString").innerHTML =
|
|
`<b>${data.total}</b> total units joined oPwnGRID so far <br>from <b>${data.countries}</b> different countries <br>with <b>${data2.total}</b> total APs reported.`;
|
|
//console.log(data)
|
|
})
|
|
});
|
|
// add notices
|
|
$.get("https://grid-api.toshiki.dev/api/v1/notices", function (data) {
|
|
data = data[data.length - 1]
|
|
if (data) {
|
|
|
|
document.getElementById("noticeString").innerHTML = `<b>${data.date}</b> ${data.info} - ${data.reporter}`;
|
|
}
|
|
});
|
|
|
|
$.get("https://grid-api.toshiki.dev/api/v1/recent", function (data3) {
|
|
let regionNames = new Intl.DisplayNames(['en'], {
|
|
type: 'region'
|
|
});
|
|
let recentDiv = document.getElementById("recent");
|
|
for (let i = 0; i <= data3.length - 1; i++) {
|
|
let dateCreated = new Date(data3[i].created_at);
|
|
|
|
dateCreated.toLocaleString('default', {
|
|
timeZoneName: 'short'
|
|
});
|
|
|
|
let dateUpdated = new Date(data3[i].updated_at);
|
|
let MsCreatedAt = dateCreated.getTime()
|
|
|
|
let now = new Date()
|
|
let timeNow = now.getTime()
|
|
|
|
let tableRowData = `
|
|
<tr>
|
|
<td>
|
|
${getFaceStr(data3[i], true)}
|
|
</td>
|
|
<td>
|
|
${timeDifference(timeNow, MsCreatedAt)}
|
|
</td>
|
|
<td>
|
|
${regionNames.of(data3[i].country)}
|
|
</td>
|
|
</tr>
|
|
`;
|
|
|
|
let appendRowToTable = $("#recentPwny").append(tableRowData);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- Top navbar -->
|
|
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="#">Shikigrid</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" aria-current="page" href>Home</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/convert">Convert</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/search/">Search</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/leaderboard">Leaderboard</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/statistics">Statistics</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<form id="search-form" class="form-inline" style="margin-block-end: 0em;">
|
|
<div class="input-group">
|
|
<input type="text" id="search-input" class="form-control" placeholder="Search by fingerprint...">
|
|
<button type="button" id="search-button" class="btn btn-primary">Search</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Main content container -->
|
|
<div class="container">
|
|
<!-- First row, containing only the header -->
|
|
<div class="row">
|
|
<div class="col text-center">
|
|
<h1>oPwnGRID - Homepage</h1>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Second row, about project and quick overview -->
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<p>
|
|
Welcome to Opwngrid. A remake of the pwnagotchi API that is faster, better, cooler. Have a look around. Let us know if encounter any errors <a href="https://github.com/rai68/Shikigrid-server/issues">here</a>
|
|
</p>
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
<div class="card text-center">
|
|
<div class="card-header bg-primary text-white">
|
|
Quick Stats
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text" id="landString"></p>
|
|
</div>
|
|
<div class="card-header bg-warning text-danger">
|
|
Notice
|
|
</div>
|
|
<div class="card-body" id="noticeBox">
|
|
<p class="card-text" id="NoticeString">Up to date</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Third row, table of recent Pwnys -->
|
|
<div class="row">
|
|
<div class="col">
|
|
<h2>Recent additions to the network</h2>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Pwny's name</th>
|
|
<th scope="col">Time of creation</th>
|
|
<th scope="col">Country of origin</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="recentPwny">
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<footer>
|
|
<script>
|
|
// Get references to the input and button elements
|
|
const searchInput = document.getElementById('search-input');
|
|
const searchButton = document.getElementById('search-button');
|
|
|
|
// Add a click event listener to the button
|
|
searchButton.addEventListener('click', function () {
|
|
// Get the text from the input
|
|
const searchText = searchInput.value.trim();
|
|
|
|
// Check if the input is not empty
|
|
if (searchText) {
|
|
// Redirect to /search/ with the search query appended
|
|
window.location.href = `/search/${encodeURIComponent(searchText)}`;
|
|
}
|
|
});
|
|
</script>
|
|
</footer>
|
|
|
|
</html>
|