Feat: add index
This commit is contained in:
parent
f4b5f3529a
commit
63d5562483
2 changed files with 45 additions and 0 deletions
BIN
copy-link.png
Normal file
BIN
copy-link.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 105 KiB |
45
index.html
Normal file
45
index.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main class="container">
|
||||
<h1>Patched digitalrock data</h1>
|
||||
<p>This tool can be used to get some more information about the digitalrock data. Just paste the digitalrock
|
||||
url:</p>
|
||||
<input type="text" id="input" placeholder="Paste the digitalrock url here!">
|
||||
<small id="invalid-helper" style="display: none;">
|
||||
The link is invalid!
|
||||
</small>
|
||||
<button id="submit" onclick="parseUrlAndRedirect()">Submit</button>
|
||||
|
||||
<h2>Where to get the link?</h2>
|
||||
<p>To get the link, go to <a href="https://digitalrock.de">digitalrock</a>, find the competition and category
|
||||
you want to view, right click it and select "copy link".</p>
|
||||
<img src="copy-link.png" alt="How to get the link">
|
||||
</main>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function parseUrlAndRedirect() {
|
||||
const input = document.getElementById("input");
|
||||
const url = input.value;
|
||||
if (!url.includes("digitalrock.de") || !url.includes("#") || !url.includes("eliste.html")) {
|
||||
document.getElementById("invalid-helper").style.display = "block";
|
||||
input.setAttribute("aria-invalid", "true")
|
||||
input.setAttribute("aria-describedby", "invalid-helper")
|
||||
return;
|
||||
}
|
||||
const urlHash = url.split("#")[1];
|
||||
const newUrl = `https://bluerock.itsblue.page/eliste/eliste.html#${urlHash}`;
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue