im trying to do an easter egg in my website, and i want to detect if the user has typed some words in sequence and in 30sec. The words wont be typed in any textarea or input, it will be just like you land on the page and start typing the words ''hello im Darius'', or you are on the page looking around and you can start typing and the timer starts. I guess it will be something like $(document).keyup(){... but i have no ideia how to track all the words in sequence and in the given time. JQuery or vanilla but i prefer jquery if possible. thanks guys.
EDIT:
this is what i have so far:
$(document).keypress(function(event){
if (hotwords && timer){
hotwords += String.fromCharCode(event.which);
}else{
var hotwords = String.fromCharCode(event.which);
var timer = 1;
alert(hotwords);
setTimeout(function(){
timer = 0;
hotwords = '';
},30000);
}
});