joystick-ui
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 • Public • Published

Joystick UI

Joystick UI component and controls for mobile browsers. Demo available:

https://joystick-demo.vercel.app/

Joystick demo

Usage

import { createJoystick } from "joystick-ui";
import "joystick-ui/dist/main.css";

const { joystick, joystickControl } = createJoystick();

Customization

Prop Type Description
joystickClass string Customize joystick styles. Default min-width: 180px and width: 20vw.
thumbClass string Customize moving thumb styles. Default width: 36px and height: 36px.
enableTransition boolean TODO. Transition is enabled by default.

WebGL

const animate = () => {
  console.log(joystickControl.direction.normalize());
  requestAnimationFrame(animate);
};

animate();

Browser

joystick is a DOM element which can be rendered by any library or framework.

document.body.append(joystick);

React

return <div ref={(element) => element.append(joystick)} />;

Solid

return joystick;

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.70latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.70
1.2.60
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.10
1.1.00
1.0.160
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i joystick-ui

Weekly Downloads

0

Version

1.2.7

License

ISC

Unpacked Size

9.22 kB

Total Files

10

Last publish

Collaborators

  • thorn_pear