2.1.15 • Published 8 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
8 months ago
2.1.5
8 months ago
2.1.8
8 months ago
2.1.7
8 months ago
2.1.9
8 months ago
2.1.14
8 months ago
2.1.15
8 months ago
2.1.12
8 months ago
2.1.13
8 months ago
2.1.10
8 months ago
2.1.11
8 months ago
2.1.4
9 months ago
2.1.2
9 months ago
2.1.1
9 months ago
2.1.3
9 months ago
2.1.0
9 months ago
2.0.5
9 months ago
2.0.4
9 months ago
2.0.3
9 months ago
2.0.2
9 months ago
2.0.1
9 months ago
2.0.0
9 months ago
1.0.5
9 months ago
1.0.4
9 months ago
1.0.3
9 months ago
1.0.1
9 months ago
1.0.0
9 months ago