File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 13
13
align-items : center;
14
14
background-color : # ffffff ;
15
15
font-family : Arial, Helvetica, sans-serif;
16
+ -webkit-touch-callout : none;
16
17
-webkit-user-select : none;
18
+ -khtml-user-select : none;
19
+ -moz-user-select : none;
20
+ -ms-user-select : none;
17
21
user-select : none;
18
22
width : 100vw ;
19
23
height : 100vh ;
221
225
let lastThumbPosition = { x : 150 , y : 50 } ;
222
226
const needleLength = 75 ; // Constant length for the needle
223
227
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 ) ;
228
238
229
239
230
240
function startDrag ( e ) {
You can’t perform that action at this time.
0 commit comments