mirror of https://github.com/shadowfacts/type.git
Add basic completion page
This commit is contained in:
parent
b6549dcbb9
commit
02e0ff39d9
|
@ -0,0 +1,15 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Type</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<p id="congrats"></p>
|
||||||
|
<p>Return to <a href="/">start</a>.</p>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||||
|
<script src="js/complete.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,7 @@
|
||||||
|
let hash = window.location.hash.substring(1);
|
||||||
|
|
||||||
|
let hashBits = hash.split("/");
|
||||||
|
let repo = hashBits.slice(0, 2).join("/");
|
||||||
|
let file = hashBits[hashBits.length - 1];
|
||||||
|
|
||||||
|
$("#congrats").html(`Congratulations, you've completed <code>${file}</code> in <code>${repo}</code>!`);
|
|
@ -310,6 +310,8 @@ function completeChunk() {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// TODO: show completion screen
|
// TODO: show completion screen
|
||||||
|
let hash = window.location.hash;
|
||||||
|
window.location.href = `/complete.html${hash}`;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
Loading…
Reference in New Issue