diff --git a/assets/css/style.css b/assets/css/style.css index 72c1dc9..2ad95c5 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -247,7 +247,7 @@ body { } .driver { - display: flex; + /* display: flex; */ align-items: flex-start; opacity: 0; position: relative; @@ -257,15 +257,17 @@ body { } .driver__image { - width: 150px; - height: 100px; - border-radius: 50%; - background-size: 85px; + /* width: 400px; */ + height: 200px; + /* border-radius: 50%; */ + background-size: 40%; background-repeat: no-repeat; background-position: center; border: 3px solid white; /* box-shadow: 0px 5px 12px rgba(0, 0, 0, 0.12); */ - margin-right: 1.5rem; + /* margin-right: 1.5rem; + */ + margin: auto; } .driver__content { @@ -276,6 +278,7 @@ body { font-weight: 700; font-size: 1.6rem; margin: 0.5rem 0; + text-align: center; } .driver__table { @@ -336,4 +339,19 @@ body { .a-no-link{ text-decoration: none; color: initial; +} + +.driver__table > tbody> tr > td:has(small){ + text-align: right; +} +.driver__table > tbody> tr > td:has(small)::after{ + content: ":"; +} + +.center{ + text-align: center; +} + +.bold{ + font-weight: bold; } \ No newline at end of file diff --git a/assets/js/leaderboard.js b/assets/js/leaderboard.js index 76af733..ea5736a 100644 --- a/assets/js/leaderboard.js +++ b/assets/js/leaderboard.js @@ -67,7 +67,7 @@ tableRow.forEach(tableRow => { - + @@ -82,9 +82,13 @@ tableRow.forEach(tableRow => { + - - + + + + + @@ -104,4 +108,27 @@ closeOverlayBtn.addEventListener("click", function () { overlay.addEventListener("click", function () { sidebarClose(); -}); \ No newline at end of file +}); + + + +function timeSince(timestring) { + var timeStamp = new Date(timestring); + var now = new Date(), + secondsPast = (now.getTime() - timeStamp) / 1000; + if (secondsPast < 60) { + return parseInt(secondsPast) + ' seconds ago'; + } + if (secondsPast < 3600) { + return parseInt(secondsPast / 60) + ' minutes ago'; + } + if (secondsPast <= 86400) { + return parseInt(secondsPast / 3600) + ' hours ago'; + } + if (secondsPast > 86400) { + day = timeStamp.getDate(); + month = timeStamp.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ", ""); + year = timeStamp.getFullYear() == now.getFullYear() ? "" : " " + timeStamp.getFullYear(); + return day + " " + month + year; + } +} diff --git a/assets/js/script.js b/assets/js/script.js index d34afda..de5f327 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -42,6 +42,8 @@ getText("https://docs.google.com/spreadsheets/d/e/2PACX-1vSscQfV-TdME-3KWkPSr_o3 tr.dataset.image = `/assets/img/ninja-default.png`; tr.dataset.activity = ninja.Activity; tr.dataset.score = ninja.Score; + tr.dataset.Timestamp = ninja.Timestamp; + tr.dataset.remark = ninja.Remark; // count+=1; diff --git a/index.html b/index.html index f15d88a..d866735 100644 --- a/index.html +++ b/index.html @@ -155,7 +155,7 @@
Belt ${ninjaBelt}
Score ${this.dataset.score}
Latest Update${this.dataset.remark} Last Updated On${timeSince(this.dataset.Timestamp)}
${this.dataset.remark}