add tap zones for mobile viewing

This commit is contained in:
xenofem 2024-01-23 15:32:55 -05:00
parent e3eeded952
commit fb7d275ebb
3 changed files with 39 additions and 3 deletions

View file

@ -4,3 +4,26 @@ html, body {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
#button-next, #button-prev {
position: fixed;
bottom: 0px;
width: 30vw;
height: 100vh;
}
#button-next {
left: 0px;
}
#button-prev {
right: 0px;
}
#button-back {
position: fixed;
top: 0px;
left: 30vw;
width: 40vw;
height: 20vh;
}

View file

@ -78,6 +78,12 @@ document.addEventListener('DOMContentLoaded', () => {
} }
} }
function exitToWork() {
changeDuration(duration, true);
localStorage.setItem(`${WORK_ID}-currentPage`, 0);
window.location.href = "../";
}
changePage(currentPage); changePage(currentPage);
changeDuration(duration, paused); changeDuration(duration, paused);
@ -111,10 +117,12 @@ document.addEventListener('DOMContentLoaded', () => {
} }
break; break;
case 13: //enter case 13: //enter
changeDuration(duration, true); exitToWork();
localStorage.setItem(`${WORK_ID}-currentPage`, 0);
window.location.href = "../";
break; break;
} }
}; };
document.getElementById("button-next").onclick = () => { changePage(currentPage + 1); };
document.getElementById("button-prev").onclick = () => { changePage(currentPage - 1); };
document.getElementById("button-back").onclick = exitToWork;
}); });

View file

@ -16,5 +16,10 @@
<div id="progress"></div> <div id="progress"></div>
<div id="page-num"></div> <div id="page-num"></div>
<div id="duration"></div> <div id="duration"></div>
<div id="controls">
<div id="button-next"></div>
<div id="button-prev"></div>
<div id="button-back"></div>
</div>
<div id="image-container"></div> <div id="image-container"></div>
{% endblock %} {% endblock %}