@roudanio/keyboard-masher

0.2.9 • Public • Published

Keyboard Masher

Usage:

import KeyboardMasher from "https://unpkg.com/@roudanio/keyboard-masher@latest/dist/keyboard-masher.js";

// fist parameter is the element selector
// second parameter is a config object
KeyboardMasher.init('#keyboard-masher-container', {
  root: 'https://unpkg.com/@roudanio/keyboard-masher@latest/dist/',
});
KeyboardMasher.on('gameOver', (...args) => {
  console.log('game over: ', args);
});

The default config object is like this:

{
  root: location.origin,
  i18n: i18nDefault, // default i18n setting is in i18n.json
}

The default i18n is put in file ./src/i18n.json. The content is like this:

{
  "name": "Keyboard Masher",
  "keysCombination": "Keys Combination",
  "selectKeysCombination": "Select the keys combination you like",
  "selectAllKeys": "All Keys",
  "selectCustomizeKeys": "Customize keys you like to smash",
  "hitKeys": "Hit the keys you want to smash:",
  "start": "Start",
  "ok": "OK",
  "reset": "Reset",
  "timerDuration": "Timer Duration",
  "chooseTimerDuration": "Choose the timer duration",
  "customizeTimerDuration": "Customize the timer duration",
  "setTimerDuration": "Set the seconds for the timer",
  "second": "second",
  "seconds": "seconds",
  "play": "Play!",
  "score": "Score",
  "back": "Back",
  "gogogo": "Go! Go! Go!",
  "typeBegin": "Type on your keyboard to begin.",
  "time": "Time: ",
  "timesUp": "Times up!",
  "restart": "Restart",
  "tweet": "Tweet",
  "facebook": "Facebook",
  "copyLink": "Copy Link",
  "stat": "Statistics",
  "shareText": "I have smashed %SCORE% keys in %DURATION% seconds! That's %CPS% keys per second! My favorite key is %FAV_KEY%. Can you smash your keyboard like this?"
}

Readme

Keywords

none

Package Sidebar

Install

npm i @roudanio/keyboard-masher

Weekly Downloads

384

Version

0.2.9

License

none

Unpacked Size

420 kB

Total Files

9

Last publish

Collaborators

  • meathill
  • ktlee