27 lines
985 B
JavaScript
27 lines
985 B
JavaScript
$(() => {
|
|
$('#auth-visible').hide()
|
|
|
|
|
|
// Startdatum festlegen (Beispiel: 1. Januar 2025, 00:00:00 Uhr)
|
|
const startDate = new Date('2025-12-13T12:44:00').getTime();
|
|
|
|
function updateCounter() {
|
|
const now = new Date().getTime();
|
|
const diff = now - startDate;
|
|
|
|
// Berechne Tage, Stunden, Minuten
|
|
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
|
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
|
|
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
|
|
|
|
// Zeige den Counter an
|
|
$('#uptime-counter').html(`<strong>${days}</strong> Tage, <strong>${hours}</strong> Stunden, <strong>${minutes}</strong> Minuten und <strong>${seconds}</strong> Sekunden ohne Datenverlust!`);
|
|
}
|
|
|
|
// Aktualisiere den Counter sofort und dann jede Minute
|
|
updateCounter();
|
|
setInterval(updateCounter, 1000);
|
|
|
|
})
|