Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thom4parisot/talktimer.js

Have to keep your speaker on time? Show them a countdown! Used at @sudweb.
https://github.com/thom4parisot/talktimer.js

Last synced: 7 days ago
JSON representation

Have to keep your speaker on time? Show them a countdown! Used at @sudweb.

Awesome Lists containing this project

README

        

# talktimer.js [![Deploy static content to Pages](https://github.com/thom4parisot/talktimer.js/actions/workflows/main.yml/badge.svg)](https://github.com/thom4parisot/talktimer.js/actions/workflows/main.yml)

Managing a conference is nice. Ensuring talks finish on time is part of the deal you have
with your audience.

As I can't guaranty the quality of your speakers, `talktimer.js` is a tool that
nearly guaranties talks to finish on time.

Why? Because the speaker will have that displayed on a tablet device, with a browser
opened on a webpage.

## Principles

`talktimer.js` is a set of decoupled elements, relying on UI events.
It is then delivered as a fully working component, you can extend without touching
the code, nor extending it.

## Usage

```javascript

var talktimer = new Talktimer('#timer');

```

### setDuration(duration)

Sets a new initial value and resets the timer to this value.

### start(duration)

Starts the countdown for the sake of your speakers.

If the `duration` argument is set, also give a call to `setDuration` prior to the countdown.

### toggle()

Toggles between `start` and `pause`, according to the state of the timer.

### pause()

Pauses the countdown.

### stop()

Pauses the countdown and sets it to `00:00`.

### reset()

Resets to the initial value.

### repaint()

Redraws the timer, applying styles if relevant.

## Skeleton

### Timer
```html


00:00

```

`data-*` attributes are used to customize the timer experience:
* `data-timer-controls`: binds the timer to a controls holder with id `#`
* `data-timer-durations`: binds the timer to a durations holder with id `#`

### Controls

```html


Start
Stop
Reset

```

`data-*` attributes are used to customize the timer experience:
* `data-timer-action`: Talktimer API method used on click
* `data-timer-start`: contains the label used when the "start" action is enabled
* `data-timer-pasue`: contains the label used when the "pause" action is enabled

### Durations

```html


5 minutes
20 minutes
40 minutes

```

`data-*` attributes are used to customize the timer experience:
* `data-timer-duration`: initialize the bound talktimer instance with this duration (in seconds)

## Testing

The code tries to be heavily unit and functionnaly tested.
For the moment, due to short time contraint, only `lib/timer.js` is tested… feel free to help :-)

```bash
npm test
```