Violets-Purgatory/static/ambience/ambient.js

32 lines
654 B
JavaScript
Raw Normal View History

2024-07-26 02:53:19 -05:00
function loop() {
var date = new Date()
var hour = date.getHours();
hour = (hour < 10 ? "0" : "") + hour;
var min = date.getMinutes();
min = (min < 10 ? "0" : "") + min;
var sec = date.getSeconds();
sec = (sec < 10 ? "0" : "") + sec;
$("#time").text(hour + ":" + min)
setTimeout(() => {
loop()
}, 1000)
}
2024-07-26 03:16:39 -05:00
document.addEventListener("DOMContentLoaded", function() {
2024-07-26 02:53:19 -05:00
loop()
2024-07-26 03:16:39 -05:00
})
2024-07-26 03:00:56 -05:00
$(document).on('keypress',function(e) {
if(e.which == 102) {
if ($.fullscreen.isFullScreen()) {
$.fullscreen.exit()
} else {
$("body").fullscreen()
}
}
});