@roudanio/keyboard-masher

0.2.7 • 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?"
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.7311latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.7311
0.2.60
0.2.54
0.2.40
0.2.30
0.2.20
0.2.10
0.2.00
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i @roudanio/keyboard-masher

Weekly Downloads

146

Version

0.2.7

License

none

Unpacked Size

410 kB

Total Files

9

Last publish

Collaborators

  • ktlee
  • meathill