Skip to content

Commit 1ce42c1

Browse files
Merge branch 'main' of github.com:zweidenker/polly
2 parents 160e3f5 + 2babb66 commit 1ce42c1

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

index.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
align-items: center;
1414
background-color: #ffffff;
1515
font-family: Arial, Helvetica, sans-serif;
16+
-webkit-touch-callout: none;
1617
-webkit-user-select: none;
18+
-khtml-user-select: none;
19+
-moz-user-select: none;
20+
-ms-user-select: none;
1721
user-select: none;
1822
width: 100vw;
1923
height: 100vh;
@@ -221,10 +225,16 @@
221225
let lastThumbPosition = { x: 150, y: 50 };
222226
const needleLength = 75; // Constant length for the needle
223227
let entity = null; // apptive entitiy
224-
// Pointer event listeners
225-
thumb.addEventListener('pointerdown', startDrag);
226-
document.addEventListener('pointermove', onDrag);
227-
document.addEventListener('pointerup', endDrag);
228+
229+
// Desktop Event
230+
thumb.addEventListener('mousedown', startDrag);
231+
document.addEventListener('mousemove', onDrag);
232+
document.addEventListener('mouseup', endDrag);
233+
234+
// Mobile event listeners
235+
thumb.addEventListener('touchstart', startDrag);
236+
document.addEventListener('touchmove', onDrag);
237+
document.addEventListener('touchend', endDrag);
228238

229239

230240
function startDrag(e) {

0 commit comments

Comments
 (0)