Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pecuchet/arcade-score-initials
Arcade game leader board initials
https://github.com/pecuchet/arcade-score-initials
arcade game-development leaderboard
Last synced: about 2 months ago
JSON representation
Arcade game leader board initials
- Host: GitHub
- URL: https://github.com/pecuchet/arcade-score-initials
- Owner: pecuchet
- Created: 2018-04-02T10:24:51.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-15T10:24:22.000Z (over 6 years ago)
- Last Synced: 2024-11-14T01:38:31.258Z (about 2 months ago)
- Topics: arcade, game-development, leaderboard
- Language: JavaScript
- Homepage: https://dotburo.org/blog/2018/04/javascript-arcade-score-initials/
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Arcade score initials
A simplistic js ES6 implementation of old school arcade game leader board inputs.
The module was originally developed for big Android screens where the native
keyboard could not be used. This was an easy solution to let the player enter
her initials easily in the leaderboard,
without having to develop or require a full-blown on-screen keyboard in javascript.
**Currently only for touch devices.** The input can be changed with a single tap,
a long tap to cycle through the alphabet or by holding and moving up or down.## [Demo](https://pecuchet.github.io/arcade-score-initials/)
![screenshot](https://raw.githubusercontent.com/pecuchet/arcade-score-initials/gh-pages/screenshot.jpg)## Usage
There is a small factory class to create the desired number of inputs at once:
```
(new ArcadeInitials())
.create(3, containerElement)
.setActive(0)
.bindSubmit(button, () => console.log(this.getInput()));
```Alternatively input can be created one by one:
```
new InitialInput({
parent: containerElement,
active: true,
onActiveChange: () => console.log(this.getValue())
})
```