Created
October 10, 2019 11:35
-
-
Save blewert/962a182d65b68cce4a37b8bb4ecafce5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timeout = 30 * 1000; | |
var lastKeyPress = +(new Date()); | |
setInterval(update, 100); | |
function update() | |
{ | |
var diff = +(new Date()) - lastKeyPress; | |
if(diff > timeout) | |
window.location.href = "../.."; | |
} | |
window.addEventListener("keyup", function() | |
{ | |
lastKeyPress = +(new Date()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment