2.1.15 • Published 9 months ago
joystikk v2.1.15
Joystikk :joystick:
Features
- :joystick: Virtual joystick
- :hammer: Customizable
- :zap: Zero dependencies
Usage
npm i joystikk
import { Joystikk } from 'joystikk';
const onStart = () => console.log("on start");
const onMove = (angle, force) => console.log("on move", angle, force);
const onEnd = () => console.log("on end");
Joystikk({
zone: document.getElementById("zone"),
size: 300,
pos: { left: '10%', top: '70%' },
style: {
restingOpacity: 0.1
},
onStart,
onMove,
onEnd
});
Options (default values)
return {
zone: document.body,
dynamic: true,
size: 200,
pos: {
left: '50%',
top: '50%'
},
lock:{
x: false,
y: false
},
style: {
base: {
scale: 1,
backgroundColor: '#fff2',
border: '2px solid #fff8',
boxShadow: 'none'
},
stick: {
scale: 0.5,
backgroundColor: '#fff2',
border: '2px solid #fff8',
boxShadow: 'none'
},
fadeInTime: 0.2,
fadeOutTime: 0.5,
dragTime: 0.05,
restingOpacity: 0.3
},
onStart: () => { },
onMove: () => { },
onEnd: () => { }
};
License
MIT
2.1.6
9 months ago
2.1.5
9 months ago
2.1.8
9 months ago
2.1.7
9 months ago
2.1.9
9 months ago
2.1.14
9 months ago
2.1.15
9 months ago
2.1.12
9 months ago
2.1.13
9 months ago
2.1.10
9 months ago
2.1.11
9 months ago
2.1.4
10 months ago
2.1.2
10 months ago
2.1.1
10 months ago
2.1.3
10 months ago
2.1.0
10 months ago
2.0.5
10 months ago
2.0.4
10 months ago
2.0.3
10 months ago
2.0.2
10 months ago
2.0.1
10 months ago
2.0.0
10 months ago
1.0.5
10 months ago
1.0.4
10 months ago
1.0.3
10 months ago
1.0.1
10 months ago
1.0.0
10 months ago