307 current 2025-02-02 19:29:41 25.05.20241217.d3c42f1 6.6.66 *

This commit is contained in:
2025-02-02 19:30:00 -05:00
parent 6cbbe35b1c
commit a2a4908210
41 changed files with 1509 additions and 284 deletions

View File

@@ -0,0 +1,78 @@
/**
* String to be used for each month of the year.
*/
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
]
/**
* Current date and time.
*/
var date;
/**
* Adds a fade transition between pages.
*/
function fade() {
if (!window.AnimationEvent) return
var fader = document.getElementById('fader')
fader.classList.add('fade-out')
}
/**
* Gets the current date and time.
*/
function getDate() {
// Get the date
var dateNow = new Date()
// Date components
var month = months[dateNow.getMonth()]
var day = dateNow.getDate()
var year = dateNow.getFullYear()
// Time components
var hours = ('0' + dateNow.getHours()).slice(-2);
var minutes = ('0' + dateNow.getMinutes()).slice(-2);
var seconds = ('0' + dateNow.getSeconds()).slice(-2);
// Inserting result
date = `${month} ${day}, ${year} | ${hours}:${minutes}:${seconds}`
document.getElementById("date").innerHTML = date;
}
/**
* Once the page has loaded, get the date and update every second.
*/
document.addEventListener('DOMContentLoaded', function() {
getDate()
setInterval(getDate, 1000)
})
document.addEventListener("keydown", function(event) {
if (event.key === "Escape") {
document.activeElement.blur();
}
});
/**
* Adds a fade out animation to the page.
*/
window.addEventListener('pageshow', function(event) {
if (!event.persisted) return
var fader = document.getElementById('fader')
fader.classList.remove('fade-in')
})