Skip to content

Commit

Permalink
feat: show XX in timer after hackathon
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiewentw committed Nov 28, 2017
1 parent e9fde41 commit 6487452
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@ const reversedCatTyping = [...catTyping].reverse().join('');
/**
* first shot
*/
updateTime(countdown());
const outcome = countdown();

/**
* execute it every second
*/
setInterval(() => {
updateTime(countdown());
}, 1000);
if (!outcome) {
updateTime(outcome);

/**
* execute it every second
*/
setInterval(() => {
updateTime(countdown());
}, 1000);
} else {
/**
* oops! hackathon is over
*/
const $timer = document.querySelector('.countdown-timer');

$timer.querySelector('.days > .value').innerText = 'XX';
$timer.querySelector('.hours > .value').innerText = 'XX';
$timer.querySelector('.minutes > .value').innerText = 'XX';
$timer.querySelector('.seconds > .value').innerText = 'XX';
}

const comingAgain = (typeObject, inputString) => {
document.body.classList.add('invert');
Expand Down

0 comments on commit 6487452

Please # to comment.