Grasscutter/data/gacha/records.html

176 lines
6.7 KiB
HTML
Raw Normal View History

2022-05-02 11:12:53 +00:00
<!doctype html>
<html>
<head>
2022-05-02 11:12:53 +00:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
<style>
body {
background-color: #f0f0f0;
}
2022-05-02 11:12:53 +00:00
p {
font-weight:300;
}
a,a:hover {
text-decoration:none !important;
color:#626976;
}
.content {
padding:3rem 0;
}
.container {
color:#626976;
position: relative;
}
h2 {
font-size:20px;
}
.custom-table {
min-width:900px;
}
.custom-table thead tr,.custom-table thead th {
padding-bottom:30px;
color:#000;
}
.custom-table tbody th,.custom-table tbody td {
color:#777;
font-weight:400;
padding-bottom:20px;
padding-top:20px;
font-weight:300;
border:none;
}
2022-05-02 11:51:09 +00:00
.yellow {
color: rgb(255, 162, 0);
2022-05-02 11:51:09 +00:00
}
.blue {
color: rgb(75, 107, 251);
}
.purple {
color: rgb(242, 40, 242);
}
2022-05-02 11:12:53 +00:00
</style>
<title>Gacha Records</title>
<!-- This file could be generated automatically using `java -jar grasscutter.jar -gachamap` -->
<!-- You can also modify the file manually to customize it -->
<!-- Otherwise you may onle see number IDs in the gacha record -->
<script type="text/javascript" src="/gacha/mappings"></script>
<script>
records = {{REPLACE_RECORDS}};
maxPage = {{REPLACE_MAXPAGE}};
mappings['default'] = mappings['en-us']; // make en-us as default/fallback option
</script>
</head>
2022-05-02 11:12:53 +00:00
<body>
<div class="content">
2022-05-02 11:12:53 +00:00
<div class="container">
<h2 class="mb-5">Gacha Records</h2>
<table id="container" class="table table-striped custom-table">
<thead>
<tr>
2022-05-02 11:12:53 +00:00
<th scope="col">Date</th>
<th scope="col">Item</th>
</tr>
2022-05-02 11:12:53 +00:00
</thead>
<tbody>
</tbody>
</table>
2022-05-02 11:12:53 +00:00
<div class="navbar">
<a href="" id="prev">&lt;&lt;&lt;</a>
2022-05-02 11:12:53 +00:00
<span id="curpage">1</span>
<a href="" id="next">&gt;&gt;&gt;</a>
2022-05-02 11:12:53 +00:00
</div>
</div>
</div>
2022-05-02 11:12:53 +00:00
<footer>
<div class="copyright">
<div class="container">
<div class="row">
<div class="col-md-6">
<span>
2022-05-05 07:16:39 +00:00
Template by BecodReyes. All rights reserved.
2022-05-02 11:12:53 +00:00
</span>
</div>
<div class="col-md-6">
<ul style="float:right">
<li class="list-inline-item">
<a href="https://github.com/Grasscutters/Grasscutter">Github</a>
</li>
<li class="list-inline-item">·</li>
<li class="list-inline-item">
<a href="https://github.com/Grasscutters/Grasscutter/blob/stable/LICENSE">License</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</footer>
<script>
var lang = "{{LANGUAGE}}".toLowerCase();
function itemMapper(itemID) {
if (mappings[lang] != null && mappings[lang][itemID] != null) {
var entry = mappings[lang][itemID];
if (entry){
return "<span class='" + entry[1] + "'>" + entry[0] + "</span>";
}
} else {
if (mappings['default'][itemID] != null) {
var entry = mappings['default'][itemID];
if (entry){
return "<span class='" + entry[1] + "'>" + entry[0] + "</span>";
}
}
}
return "<span class='blue'>" + itemID + "</span>";
}
(function (){
var container = document.getElementById("container");
records.forEach(element => {
var e = document.createElement("tr");
e.innerHTML= "<td>" + (new Date(element.time).toLocaleString(lang)) + "</td><td>" + itemMapper(element.item) + "</td>";
container.appendChild(e);
});
// setup pagenation buttons
var page = parseInt(new window.URLSearchParams(window.location.search).get("p"));
if (!page) {
page = 0;
}
document.getElementById("curpage").innerText = page + 1;
var href = new URL(window.location);
href.searchParams.set("p", page - 1);
document.getElementById("prev").href = href.toString();
href.searchParams.set("p", page + 1);
document.getElementById("next").href = href.toString();
if (page <= 0) {
document.getElementById("prev").style.display = "none";
}
if (page >= maxPage - 1) {
document.getElementById("next").style.display = "none";
}
// setup gacha type info
var gachaType = new window.URLSearchParams(window.location.search).get("gachaType");
if (mappings[lang] != null && mappings[lang][gachaType] != null) {
var gachaString = mappings[lang][gachaType];
} else {
var gachaString = mappings['default'][gachaType];
if (gachaString == null) {
gachaString = gachaType;
}
}
document.getElementById("gacha-type").innerText = gachaString;
})();
</script>
</body>
2022-05-02 11:12:53 +00:00
</html>