add touch events

This commit is contained in:
vance 2024-05-02 21:23:09 -07:00
parent 74573d8f7c
commit 1124bd9fb2

View File

@ -139,7 +139,7 @@
['mousemove', 'touchstart', 'touchmove'].forEach(type => {
window.addEventListener(type, event => {
document.getElementById('cursor').style.top = (event.clientY || event.touches[0].clientY) + 'px';
document.getElementById('cursor').style.left = (event.clientY || event.touches[0].clientY) + 'px';
document.getElementById('cursor').style.left = (event.clientX || event.touches[0].clientX) + 'px';
});
});