New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

jjoystick

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jjoystick

A Custom Html Component for horizontal Joystick built on top of input-range


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created

Dead simple horizontal Joystick built as web components on top of input[type=range].

Installation

npm install jjoystick
yarn add jjoystick

Events

  • dir - when directions changed even without ending the touch / click
  • end - when interaction ended
  • zero - when handle went to the initial position

Usage

<script src="node_modules/jjoystick/index.js"></script>

<j-joystick></j-joystick>

<script>
const joystick = document.querySelector('j-joystick');
joystick.addEventListener('dir', ({detail}) => console.log(detail) /* right, left */);
joystick.addEventListener('end', () => console.log('end'));
joystick.addEventListener('zero', () => console.log('zero'));
</script>

Demo

https://codesandbox.io/s/jjoystick-demo-71trm

FAQs

Package last updated on 29 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts