Skip to content

Commit

Permalink
Merge branch 'main' of github.com:zweidenker/polly
Browse files Browse the repository at this point in the history
  • Loading branch information
christian2denker committed Oct 8, 2024
2 parents 160e3f5 + 2babb66 commit 1ce42c1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
align-items: center;
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100vw;
height: 100vh;
Expand Down Expand Up @@ -221,10 +225,16 @@
let lastThumbPosition = { x: 150, y: 50 };
const needleLength = 75; // Constant length for the needle
let entity = null; // apptive entitiy
// Pointer event listeners
thumb.addEventListener('pointerdown', startDrag);
document.addEventListener('pointermove', onDrag);
document.addEventListener('pointerup', endDrag);

// Desktop Event
thumb.addEventListener('mousedown', startDrag);
document.addEventListener('mousemove', onDrag);
document.addEventListener('mouseup', endDrag);

// Mobile event listeners
thumb.addEventListener('touchstart', startDrag);
document.addEventListener('touchmove', onDrag);
document.addEventListener('touchend', endDrag);


function startDrag(e) {
Expand Down

0 comments on commit 1ce42c1

Please sign in to comment.