GithubHelp home page GithubHelp logo

screenkeys's Introduction

Screen Keys example image showing Shift+A key presses

ScreenKeys

This library provides a visual way to display on screen key presses for web demonstrations and recordings.

The keys disappear after half a second by defaulf but it can be costumized.

Live Demo

ScreenKeys Live Website:

ScreenKeys

And a working demo of this library:

Codepen ScreenKeys Demo

How to use

Installation is very simple, just link to the "keys.js" file from this repo.

like so:

<script src="keys.js"></script>

You can also link it directly to GitHub like so:

<script src="https://adir-sl.github.io/ScreenKeys/keys.js"></script>

Then you can call this function:

initKeys();

This function can be customized with the parameters mentioned below.

But it also has some sensible defaults so you don't have to, as mentioned in the "Default parameters" section.

Customizations

This function includes a few built-in variables to customize your experience:

initKeys(size, posx, posy, delay, bg, txt);
  1. size referes to the font-size in px (e.g 10, 16, 24);
  2. posx is the position on the x axis, can be 'left', 'right' or 'center';
  3. posy is the position on the y axis, can be 'top', 'bottom' or 'center';
  4. delay refers to the time (in milliseconds) it takes for the toast to disappear (e.g "500", "1000", "1500");
  5. bg is the color of the background of the keys (CSS background-color);
  6. txt is the color of the keys' text (CSS color);

Notice that all parameters should be in quotes (either "xxx" or 'xxx') except for font-size, the first parameter.

Default parameters

initKeys(16, 'center', 'bottom', '500', '#cbd5e1', '#334155');

This, and also leaving the parameters blank, will result in:

  1. font-size: 16px
  2. position on x: center
  3. position on y: left
  4. 500ms (half a second) delay before it disappears
  5. background-color: #cbd5e1
  6. color: #334155 (text color)

screenkeys's People

Contributors

adir-sl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.