click-password

2.0.0 • Public • Published

English | 简体中文


npm version

what for

Set up a quadrant in viewport, name of each range is as follows:

        │
    A   │   B
──────────────────
    C   │   D
        │

after that, clicks in each range can generate a sequence, use this sequence as a password. If this sequence match the pre-set sequence, pre-set function will be executed.

usage

Download or install via npm (npm install click-password)

import ClickPassword from 'click-password';

// init click-password with pre-set sequence(like 'ABADA' or other sequence composed of A, B, C, D) and callback function
new ClickPassword('ABADA', ()=>{
  //Callback, Do Something
}, true/*whether print debug logs*/);

Or import via script element:

<script src="https://unpkg.com/click-password@latest/dist/click-password.min.js"></script>
<script>
  // init click-password with pre-set sequence(like 'ABADA' or other sequence composed of A, B, C, D) and callback function
  new ClickPassword('ABADA', ()=>{
    //Callback, Do Something
  });
</script>

tips

● Browser console will print "click-password info: config OK!" after click-password's initialization.

● Callback will be executed as long as pre-set sequence is clicked, match the pre-set sequence from the first click is not necessary.

● Callback will be executed only once, only if the web page is reloaded.

● The declaration file for use with TypeScript is located at "dist/click-password.d.ts".

example

Click 'ACABD' to trigger the show of vConsole(developer tool for mobile web page) in production environment.

example gif image

Package Sidebar

Install

npm i click-password

Weekly Downloads

26

Version

2.0.0

License

ISC

Unpacked Size

12 kB

Total Files

7

Last publish

Collaborators

  • yuancongzhou