fix: fixed redirect and reload
This commit is contained in:
parent
330db0838c
commit
d882833202
26
dev/app.js
26
dev/app.js
@ -171,9 +171,9 @@ function beginRound(){
|
||||
}
|
||||
|
||||
function beginClicked(){
|
||||
let instructions = document.getElementById('messege');
|
||||
instructions.innerHTML = ""
|
||||
instructions.className = "hidden";
|
||||
let messege = document.getElementById('messege');
|
||||
messege.innerHTML = ""
|
||||
messege.className = "hidden";
|
||||
timeInterval = setInterval(countDown, 10);
|
||||
beginRound();
|
||||
}
|
||||
@ -263,6 +263,15 @@ function renderAttempts(){
|
||||
}, this);
|
||||
}
|
||||
|
||||
|
||||
function renderEndGame(){
|
||||
document.getElementById('entry_table').innerHTML = "";
|
||||
let messege = document.getElementById('messege');
|
||||
|
||||
messege.innerHTML = "<p>You have found her! It was not easy, but your diligence paid off. Continue to send an anonyms tip to the F.B.I.</p><button onclick='redirectToFoundation()'>REPORT</button>"
|
||||
messege.className = "";
|
||||
}
|
||||
|
||||
function checkStatus(){
|
||||
if(lockoutHits >= lockoutMax){
|
||||
gameLose();
|
||||
@ -282,6 +291,11 @@ function gameLose(){
|
||||
Array.prototype.forEach.call(entryElements, function(e) {
|
||||
e.className = "entry error"
|
||||
}, this);
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
window.location.reload(true)
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
function gameWin(){
|
||||
@ -292,6 +306,8 @@ function gameWin(){
|
||||
clearInterval(timeInterval);
|
||||
timerElement.innerHTML = 0;
|
||||
|
||||
renderEndGame();
|
||||
|
||||
console.log("Game Win");
|
||||
}
|
||||
|
||||
@ -304,3 +320,7 @@ function countDown(){
|
||||
gameLose();
|
||||
}
|
||||
}
|
||||
|
||||
function redirectToFoundation(){
|
||||
window.open('http://waynefdn.org/', '_blank')
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<title>Lost</title>
|
||||
|
||||
<link rel="stylesheet" href="dist/style.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
|
||||
</head>
|
||||
|
||||
@ -79,6 +79,7 @@
|
||||
</body>
|
||||
|
||||
|
||||
<script src="dist/app.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="levenshtein.js"></script>
|
||||
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user