0.4.1 • Published 1 year ago

cursor-position-detector v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

cursor-position-detector

npm version build codecov License

Overview

Detect cursor position and switch cursor style.

Installation

You can install this library using npm:

npm install cursor-position-detector

Usage

import { CursorPositionDetector, Direction } from "cursor-position-detector";

const targetElement = document.querySelector("body") as Element;

new CursorPositionDetector({
  element: targetElement,
  threshold: 0.3,
  disabledDirections: ["bottom"],
  onClick: (direction: Direction) => console.log(`Clicked ${direction}`),
  onEnter: (direction: Direction) => console.log(`Entered ${direction} zone`),
  onLeave: (direction: Direction) => console.log(`Left ${direction} zone`),
});

License

This project is licensed under the MIT License - see the LICENSE file for details.

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago