1
I need to redirect to a "rest screen", if the user does not interact via click/touch, drag and mouse movement.
Whatever you can do
<script type="text/javascript">
var meuTempo;
meuTempo = setTimeout(openUrl, 5000); // redirecionamento
function resetTimer(){
clearTimeout(meuTempo); // dá um clear no tempo para dar reload
}
function openUrl(){
window.location = "https://www.google.com/"; // reload
}
jQuery(document).bind("click mousemove touchstart", resetTimer); // reset de timer por interação
</script>
The problem
It is necessary that whenever the user does not interact, the counter is set again.
That is, if the user interacts he stays on the page, if not, he is redirected after X seconds to another screen.