Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/thom4parisot/talktimer.js
- Owner: thom4parisot
- License: mit
- Created: 2012-05-24T06:49:07.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2022-09-29T15:17:10.000Z (about 2 years ago)
- Last Synced: 2024-11-02T13:26:00.203Z (11 days ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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
```