feature: change secret date
Build and Push Docker Image / build-and-push (release) Successful in 1m6s

This commit is contained in:
Beesquit committed 2026-12-02 19:13:14 +03:00
1 parent 3fb6736f56
commit 8515eaf353
1 file changed
+23 -13
+23 -13
View File
@@ -7,9 +7,9 @@ const NEW_YEAR_DAY = 1;
// One-time deadline: 22.01.2027. It is not recurring, so once it passes the
// countdown is hidden for good.
const ONE_TIME_TARGET_YEAR = 2027;
const ONE_TIME_TARGET_MONTH = 0;
const ONE_TIME_TARGET_DAY = 22;
const ONE_TIME_TARGET_YEAR = 2026;
const ONE_TIME_TARGET_MONTH = 11;
const ONE_TIME_TARGET_DAY = 30;
const MS_PER_DAY = 86400000;
@@ -24,11 +24,15 @@ function pad2(n) {
}
function formatClock(d) {
return pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + ":" + pad2(d.getSeconds());
return (
pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + ":" + pad2(d.getSeconds())
);
}
function formatDate(d) {
return pad2(d.getDate()) + "." + pad2(d.getMonth() + 1) + "." + d.getFullYear();
return (
pad2(d.getDate()) + "." + pad2(d.getMonth() + 1) + "." + d.getFullYear()
);
}
function diffText(targetMs, nowMs) {
@@ -70,7 +74,9 @@ function distributeBlocks(container, blocks) {
}
if (blocksPerRow > blocks.length) {
blocks.forEach(function (b) { container.appendChild(b); });
blocks.forEach(function (b) {
container.appendChild(b);
});
return;
}
@@ -249,7 +255,7 @@ function updateCountdowns() {
const newYearTarget = new Date(
now.getFullYear() + 1,
NEW_YEAR_MONTH,
NEW_YEAR_DAY
NEW_YEAR_DAY,
);
const newYearDays = Math.max(0, daysUntil(newYearTarget, now));
setCountdownText(countdownRefs.newYear, newYearTarget, newYearDays);
@@ -257,7 +263,7 @@ function updateCountdowns() {
const oneTimeTarget = new Date(
ONE_TIME_TARGET_YEAR,
ONE_TIME_TARGET_MONTH,
ONE_TIME_TARGET_DAY
ONE_TIME_TARGET_DAY,
);
const oneTimeDays = daysUntil(oneTimeTarget, now);
@@ -285,7 +291,10 @@ function updateDiffs() {
for (let hour = FIRST_HOUR; hour <= LAST_HOUR; hour++) {
const target = new Date();
target.setHours(hour - TRAVEL_TIME_HOURS, 0, 0, 0);
diffNodes[hour - FIRST_HOUR].textContent = diffText(target.getTime(), now.getTime());
diffNodes[hour - FIRST_HOUR].textContent = diffText(
target.getTime(),
now.getTime(),
);
}
updateCountdowns();
scheduleNextDiffTick();
@@ -318,7 +327,8 @@ function init() {
buildCountdowns();
const now = new Date();
lastDayKey = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
lastDayKey =
now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
dateEl.textContent = formatDate(now);
updateClock();
@@ -336,13 +346,13 @@ function onResize() {
const timeDifferencesElement = document.getElementById("timeDifferences");
const allBlocks = [].slice.call(
timeDifferencesElement.querySelectorAll(".time-block:not(.label-block)")
timeDifferencesElement.querySelectorAll(".time-block:not(.label-block)"),
);
const targetBlocks = [].slice.call(
targetTimesElement.querySelectorAll(".time-block:not(.label-block)")
targetTimesElement.querySelectorAll(".time-block:not(.label-block)"),
);
const leaveBlocks = [].slice.call(
leaveTimesElement.querySelectorAll(".time-block:not(.label-block)")
leaveTimesElement.querySelectorAll(".time-block:not(.label-block)"),
);
distributeBlocks(targetTimesElement, targetBlocks);