Added countdown and info cards

This commit is contained in:
root
2018-09-30 15:21:48 +02:00
parent 6d75b8526f
commit dcbc6c1dc7
3 changed files with 52 additions and 10 deletions
+13
View File
@@ -0,0 +1,13 @@
// countdown.js - Odštevalnik časa do projektnega tedna
// (c) Kristjan Komlosi 2018
window.onload = () => {
if (new Date('2018-10-15') < new Date()) {
document.getElementById('countdown').innerHTML = ''
}
var days = new Date(new Date('2018-10-15') - new Date()).getDate();
if (days === 1) {
document.getElementById('countdown').innerHTML = '<b>Jutri!</b><br>';
} else if (days > 1) {
document.getElementById('days-left').innerHTML = days.toString();
}
}