npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dbosst/gameclock

v1.1.2

Published

a digital timer for games, such as go and chess

Downloads

15

Readme

gameclock

A preact module for a game clock, supporting an arbitrary number of players.

Demo

View the live demo by clicking here.

Note: the interface options for the clock are only part of the demo, not the module itself. Also, the images inside each player's clock are part of the demo css, not a module option.

You can also just use the demo for your personal needs (if you aren't attaching the module to a program), and save your own timing presets to a text file by copy/pasting the state with the demo's import/export feature.

Features

Support for various timing modes:

  • Go's byo-yomi / (Canadian) overtime
  • Chess' Delay (Bronstein) Timing
  • Chess' Increment (Fischer) Timing (before & after)
  • Hourglass
  • Word game timing (negative time counting)
  • Absolute (egg-timer)

Customizable display:

  • Display elapsed or remaining time/periods/phase/moves
  • Customizable display text & information (player name, time expired text, periods, etc.)
  • Fractional seconds customization (0-4 decimal places, update interval)

Adjustable clock:

  • Pause the clock first, and then adjust the current player clock.
  • Also, change the active player by pausing and making a move.

Callback events, including:

  • On last 10 seconds (of current period/phase)
  • Time Expired
  • Made move
  • Pause, Resume, Reset, Init

CSS classes:

  • Style the game clock or each individual player clock
  • Style each player clock according to the clock state: expired, running, paused, init.

Documentation

Please read the docs by clicking here.

Build the demo

Pre-requisites: You need Node.js, npm, and preact installed to build the demo.

Then download this demo with git and use npm to install the dependencies:

$ git clone https://github.com/dbosst/gameclock
$ cd gameclock
$ npm install

Then to create the bundle, you can either build the development demo once:

$ npm run build-demo

Or use the watch-demo script for development:

$ npm run watch-demo

To view the built demo, open the local gameclock/demo/index.html file in your web browser. If you have a javascript blocking plug-in, such as No-Script, make sure to allow for it.