-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from psmgeelen/feature/ui/countdown
Feature/UI/countdown
- Loading branch information
Showing
28 changed files
with
590 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
.App { | ||
} | ||
|
||
.countdown-area { | ||
width: 100%; | ||
text-align: center; | ||
font-weight: bold; | ||
font-size: 2rem; | ||
} | ||
|
||
.hold-to-pour-image { | ||
object-fit: contain; | ||
width: 25%; | ||
height: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function toTimeStr(diff) { | ||
const seconds = Math.floor(diff / 1000); | ||
const minutes = Math.floor(seconds / 60); | ||
const hours = Math.floor(minutes / 60); | ||
|
||
const secondsStr = (seconds % 60).toString().padStart(2, '0'); | ||
const minutesStr = (minutes % 60).toString().padStart(2, '0'); | ||
const hoursStr = hours.toString().padStart(2, '0'); | ||
|
||
return `${hoursStr}:${minutesStr}:${secondsStr}`; | ||
} | ||
|
||
export function timeBetweenAsString({endTime=null, startTime=null, bounded=false}) { | ||
if (null === startTime) startTime = new Date(); | ||
if (null === endTime) endTime = new Date(); | ||
|
||
let diff = endTime - startTime; // in ms | ||
if (bounded && (diff < 0)) diff = 0; | ||
|
||
if (diff < 0) return '-' + toTimeStr(-diff); | ||
return toTimeStr(diff); | ||
} |
Oops, something went wrong.