VovanR / dozed-off

Break for 15 minutes sleep
https://vovanr.github.io/dozed-off
MIT License
1 stars 0 forks source link

Concept #10

Open VovanR opened 6 years ago

VovanR commented 6 years ago

dozzed-off-concept

VovanR commented 6 years ago

Timer create delete - delete timer and all child timers

start pause stop

timer end - play sound; start child timer

VovanR commented 6 years ago

draft

// @flow

const TIMER_STATUS: {
    [string]: string
} = {
    PLAYING: 'playing',
    PAUSED: 'paused',
    STOPPED: 'stopped',
    ENDED: 'ended',
}

type TimerStatus = $Keys<typeof TIMER_STATUS>;

const timer: {
    id: number, // uniq id
    parentId: number | null, // parent id
    startDate: Date | null, // click date
    duration: number, // ms
    progress: number, // ms calculated `nowDate - startDate`
    status: TimerStatus,
} = {
    id: 1,
    parentId: null,
    startDate: new Date('Fri Nov 03 2017 21:03:31 GMT+0300 (MSK)'),
    duration: 3600,
    progress: 0,
    status: TIMER_STATUS.STOPPED,
}
VovanR commented 6 years ago

Calculate progress in rAF

VovanR commented 6 years ago

Save store in LocalStorage? Resume timers on browser reopened Detect paralell browser tabs Use notifications?

VovanR commented 6 years ago

Build with react-create-app

VovanR commented 6 years ago

TDD