JSPM

iseedeadpeople

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 321
  • Score
    100M100P100Q85794F
  • License MIT

Register a hidden cheat gesture to enable/disable a custom flag in cookie

Package Exports

  • iseedeadpeople
  • iseedeadpeople/dist/index.cjs.js
  • iseedeadpeople/dist/index.esm.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iseedeadpeople) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

iseedeadpeople

Register a hidden cheat gesture to enable/disable a custom flag in cookie.

Usage

IIFE

A config string formatted ${flag}:${gesture} must be set in the URL hash.

For example,

<script src="./dist/index.iife.js#ISEEDEADPEOPLE:UUDDLRLR"></script>

In this case,

The UUDDLRLR is a gesture descriptor, U, D, L, R correspond to UP, DOWN, LEFT, RIGHT.

The myflag is a cookie name.

If a user makes the gesture, the value of the cookie named myflag will be set to "true", and if the gesture is made one more time, that cookie will be removed.

As a package

import { setup } from 'iseedeadpeople';

// Setup a pair of gesture and handler.
setup(['U', 'R', 'D', 'L'], () => {
  // This handler function will be called after a user makes the gesture.
  // You can do anything here.
  alert('You made a gesture `URDL`');
});