diff options
author | Joris | 2020-02-16 22:45:07 +0100 |
---|---|---|
committer | Joris | 2020-02-17 09:15:11 +0100 |
commit | 25afb0bde9b8a2c064135a534231c232a461b341 (patch) | |
tree | 5ab25640024238a2f6f2d176e5870178f18b5345 /public | |
parent | 0366f8cd49d2db40ea5efc639f6a475ecd97675e (diff) |
Set up a first version of tabata timer
Diffstat (limited to 'public')
-rw-r--r-- | public/icon.png | bin | 0 -> 886 bytes | |||
-rw-r--r-- | public/index.html | 101 | ||||
-rw-r--r-- | public/main.css | 175 | ||||
-rw-r--r-- | public/sounds/c3.mp3 | bin | 0 -> 47469 bytes | |||
-rw-r--r-- | public/sounds/c4.mp3 | bin | 0 -> 57357 bytes | |||
-rw-r--r-- | public/sounds/c5.mp3 | bin | 0 -> 65742 bytes |
6 files changed, 276 insertions, 0 deletions
diff --git a/public/icon.png b/public/icon.png Binary files differnew file mode 100644 index 0000000..a489112 --- /dev/null +++ b/public/icon.png diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..5668682 --- /dev/null +++ b/public/index.html @@ -0,0 +1,101 @@ +<!DOCTYPE html> +<html lang="fr"> + + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Tabata timer</title> + <link rel="stylesheet" href="main.css" /> + <link rel="icon" href="/icon.png"> + </head> + + <body> + + <header class="g-Layout__Header">Tabata timer</header> + + <main id="g-Layout__Main"> + + <form id="g-Form"> + + <label class="g-Form__Label"> + prepare + <input id="g-Form__Prepare" class="g-Form__Input" type="number" min="0" /> + </label> + + <label class="g-Form__Label"> + tabatas + <input id="g-Form__Tabatas" class="g-Form__Input" type="number" min="1" /> + </label> + + <label class="g-Form__Label"> + cycles + <input id="g-Form__Cycles" class="g-Form__Input" type="number" min="1" /> + </label> + + <label class="g-Form__Label"> + work + <input id="g-Form__Work" class="g-Form__Input" type="number" min="5" /> + </label> + + <label class="g-Form__Label"> + rest + <input id="g-Form__Rest" class="g-Form__Input" type="number" min="5" /> + </label> + + <div class="g-Form__Duration"> + duration + <div id="g-Form__DurationValue">8</div> + </div> + + <button class="g-Form__Start"> + start + </button> + + </form> + + <section id="g-Timer"> + + <button id="g-Timer__Dial"> + + <svg class="g-Timer__Arc" viewbox="-100 -100 200 200"> + <path class="g-Timer__ArcTotal" d="M -1.745121688784978e-14 -95 A 95 95 0 1 0 5.8170722959499274e-15 -95"></path> + <path id="g-Timer__ArcProgress"></path> + </svg> + + <div id="g-Timer__Step"></div> + + <div id="g-Timer__Duration"></div> + + </button> + + <div class="g-Timer__TabataAndCycle"> + + <div class="g-Timer__Tabata"> + <div>Tabata</div> + <span id="g-Timer__TabataCurrent"></span> + / + <span id="g-Timer__TabataTotal"></span> + </div> + + <div class="g-Timer__Cycle"> + <div>Cycle</div> + <span id="g-Timer__CycleCurrent"></span> + / + <span id="g-Timer__CycleTotal"></span> + </div> + + </div> + + <button id="g-Timer__Stop"> + stop + </button> + + </section> + + </main> + + <script src="main.js"></script> + + </body> + +</html> diff --git a/public/main.css b/public/main.css new file mode 100644 index 0000000..9421a3c --- /dev/null +++ b/public/main.css @@ -0,0 +1,175 @@ +/* Box sizing */ + +html { + box-sizing: border-box; +} +*, *:before, *:after { + box-sizing: inherit; +} + +/* Constants */ + +:root { + --color-header: #333333; + --color-action: #993333; + --color-action-darker: #773333; + --color-timer-arc-total: #EEEEEE; + --color-timer-arc-progress: #71b571; + --color-timer-hover: #DDEEDD; + + --dial-width: 20rem; + + --base-font-size: 18px; +} + +@media all and (max-width: 800px) { + :root { + --base-font-size: 14px; + } +} + +/* Layout */ + +html { + font-size: var(--base-font-size); +} + +body { + margin: 0; +} + +.g-Layout__Header { + background-color: var(--color-header); + color: white; + padding: 1rem 2rem; + font-size: 2rem; +} + +#g-Layout__Main { + transition: all 0.2s ease-in-out; +} + +.g-Layout__HideMain { + opacity: 0; + padding-left: 2rem; +} + +/* Config */ + +#g-Form { + display: flex; + flex-direction: column; + align-items: center; + margin-top: 5rem; +} + +.g-Form__Label { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 1rem; + text-align: center; + font-size: 1.3rem; +} + +.g-Form__Input { + display: block; + text-align: center; + margin-top: 0.5rem; + font-size: 1.3rem; + width: 10rem; +} + +.g-Form__Duration { + text-align: center; + font-size: 1.5rem; + margin-top: 1rem; +} + +.g-Form__Start { + font-size: 1.5rem; + background-color: var(--color-action); + border: 3px solid var(--color-action-darker); + color: white; + padding: 0.5rem 0.8rem; + width: 10rem; + margin-top: 2rem; + cursor: pointer; +} + +/* Timer */ + +#g-Timer { + display: flex; + flex-direction: column; + align-items: center; + display: none; +} + +#g-Timer__Dial { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: var(--dial-width); + height: var(--dial-width); + cursor: pointer; + background-color: white; + font-size: 3rem; + margin: 5rem 0; + position: relative; + border: none; +} + +.g-Timer__Arc { + width: inherit; + height: inherit; + position: absolute; + top: 0; + left: 0; +} + +.g-Timer__ArcTotal { + stroke: var(--color-timer-arc-total); + fill: none; + stroke-width: 10; +} + +#g-Timer__ArcProgress { + stroke: var(--color-timer-arc-progress); + fill: none; + stroke-width: 10; +} + +#g-Timer__Step { + margin-bottom: 0.5rem; +} + +#g-Timer__Duration:hover { + background-color: var(--color-timer-hover); + color: initial; +} + +.g-Timer__TabataAndCycle { + display: flex; + justify-content: space-around; + font-size: 1.5rem; + width: var(--dial-width); +} + +.g-Timer__Tabata, +.g-Timer__Cycle { + text-align: center; + margin-bottom: 1rem; +} + +#g-Timer__Stop { + font-size: 1.5rem; + background-color: var(--color-action); + border: 3px solid var(--color-action-darker); + color: white; + padding: 0.5rem 0.8rem; + width: 10rem; + margin-top: 2rem; + cursor: pointer; +} diff --git a/public/sounds/c3.mp3 b/public/sounds/c3.mp3 Binary files differnew file mode 100644 index 0000000..13e661a --- /dev/null +++ b/public/sounds/c3.mp3 diff --git a/public/sounds/c4.mp3 b/public/sounds/c4.mp3 Binary files differnew file mode 100644 index 0000000..0266119 --- /dev/null +++ b/public/sounds/c4.mp3 diff --git a/public/sounds/c5.mp3 b/public/sounds/c5.mp3 Binary files differnew file mode 100644 index 0000000..8ff926e --- /dev/null +++ b/public/sounds/c5.mp3 |