@defaude/autohide-cursor
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

autohide-cursor

Tiny no-dependency library that will automatically hide the cursor after a given time of mouse inactivity. No build tools, no bundlers, nothing.

Direct usage

The easiest way to get this is to import the index.js module - this will load the autohideCursor function and start it with the default delay of 1 second:

<script type="module" src="https://unpkg.com/@defaude/autohide-cursor/index.js"></script>

When you want to control the delay (or when/how the function is called), import the function directly:

<script type="module">
    import {autohideCursor} from "https://unpkg.com/@defaude/autohide-cursor";
    autohideCursor(1234);
</script>

Installation as npm package

This is published as npm package, so you can just

npm install @defaude/autohide-cursor

and use it in your code

import { autohideCursor } from '@defaude/autohide-cursor';

// ... and whenever you want start hiding the cursor
autohideCursor(); // or pass the delay explicitly

Readme

Keywords

none

Package Sidebar

Install

npm i @defaude/autohide-cursor

Weekly Downloads

0

Version

1.0.2

License

WTFPL

Unpacked Size

2.99 kB

Total Files

6

Last publish

Collaborators

  • defaude