diff --git a/complete.html b/complete.html new file mode 100644 index 0000000..9cf7784 --- /dev/null +++ b/complete.html @@ -0,0 +1,15 @@ + + +
+ +Return to start.
+ + + + + diff --git a/js/complete.js b/js/complete.js new file mode 100644 index 0000000..9081d4e --- /dev/null +++ b/js/complete.js @@ -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${file}
in ${repo}
!`);
diff --git a/js/main.js b/js/main.js
index 6532b26..434d673 100644
--- a/js/main.js
+++ b/js/main.js
@@ -310,6 +310,8 @@ function completeChunk() {
});
} else {
// TODO: show completion screen
+ let hash = window.location.hash;
+ window.location.href = `/complete.html${hash}`;
}
})
.catch((e) => {