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
}
19
23
218
222
let lastThumbPosition = { x : 150 , y : 50 } ;
219
223
const needleLength = 75 ; // Constant length for the needle
220
224
let entity = null ; // apptive entitiy
221
- // Pointer event listeners
222
- thumb . addEventListener ( 'pointerdown' , startDrag ) ;
223
- document . addEventListener ( 'pointermove' , onDrag ) ;
224
- document . addEventListener ( 'pointerup' , endDrag ) ;
225
+
226
+ // Desktop Event
227
+ thumb . addEventListener ( 'mousedown' , startDrag ) ;
228
+ document . addEventListener ( 'mousemove' , onDrag ) ;
229
+ document . addEventListener ( 'mouseup' , endDrag ) ;
230
+
231
+ // Mobile event listeners
232
+ thumb . addEventListener ( 'touchstart' , startDrag ) ;
233
+ document . addEventListener ( 'touchmove' , onDrag ) ;
234
+ document . addEventListener ( 'touchend' , endDrag ) ;
225
235
226
236
function startDrag ( e ) {
227
237
e . preventDefault ( ) ;
You can’t perform that action at this time.
0 commit comments