😏
This commit is contained in:
parent
bef60f775b
commit
d71cc2cbe9
4 changed files with 48 additions and 1 deletions
|
@ -303,4 +303,15 @@ footer {
|
|||
white-space: pre;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#inconspicuous-timer-a > i {
|
||||
color: $body-font-color;
|
||||
text-decoration: none;
|
||||
font-style: normal !important;
|
||||
|
||||
}
|
||||
|
||||
#inconspicuous-timer-a > i:hover {
|
||||
text-decoration: underline $background-color;
|
||||
}
|
||||
|
|
|
@ -45,3 +45,6 @@ This website is [open source](https://code.lila.network/lauralani/personal-websi
|
|||
This page makes due without any cookies, javascript frameworks and databases in the effort to make the web quick and usable again :)
|
||||
|
||||
This page was last updated at {{< last-updated >}}
|
||||
|
||||
|
||||
{{< footer-timer >}}
|
||||
|
|
33
layouts/shortcodes/footer-timer.html
Normal file
33
layouts/shortcodes/footer-timer.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
^-^ <a id="inconspicuous-timer-a" href="/images/curious_cat.jpg" ><i id="inconspicuous-timer"></i></a>
|
||||
|
||||
<script>
|
||||
// Set the date we're counting up from
|
||||
const countUpDate = new Date("Dec 28, 2023 12:34:56").getTime();
|
||||
const timerElement = document.getElementById("inconspicuous-timer")
|
||||
|
||||
function updateHtml() {
|
||||
// Get today's date and time
|
||||
var now = new Date().getTime();
|
||||
|
||||
// Find the distance between now and the count up date
|
||||
var distance = now - countUpDate;
|
||||
|
||||
// Time calculations for days, hours, minutes and seconds
|
||||
var years = Math.floor(distance / (1000 * 60 * 60 * 24 * 365));
|
||||
var days = Math.floor(distance % (1000 * 60 * 60 * 24 * 365) / (1000 * 60 * 60 * 24));
|
||||
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
||||
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
||||
|
||||
var text = ""
|
||||
if (years != 0) {
|
||||
text = years + "y " + days + "d " + hours + "h " + minutes + "m " + seconds + "s"
|
||||
} else {
|
||||
text = days + "d " + hours + "h " + minutes + "m " + seconds + "s"
|
||||
}
|
||||
timerElement.innerHTML = text;
|
||||
}
|
||||
updateHtml()
|
||||
|
||||
var x = setInterval(updateHtml, 1000);
|
||||
</script>
|
BIN
static/images/curious_cat.jpg
Normal file
BIN
static/images/curious_cat.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 124 KiB |
Loading…
Reference in a new issue