feat : 공지 화면 미리보기용 ?at=HHMM (그 시각인 것처럼 표시)
SpecialSource Frontend (React) CD / deploy (push) Successful in 13s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
headporterandClaude Opus 5.5 committed 2026-11-30 14:17:51 +09:00
1 parent 0b9dcafa19
commit 9f06df84bb
1 file changed
+4 -1
+4 -1
View File
@@ -116,8 +116,11 @@ const NOTICE_HTML = `<!doctype html>
var H = 3600e3;
function pad(n) { return String(n).padStart(2, "0"); }
function fmt(ms) { return pad(Math.floor(ms / H)) + ":" + pad(Math.floor(ms / 6e4) % 60) + ":" + pad(Math.floor(ms / 1e3) % 60); }
// 미리보기용: 주소 끝에 ?at=0312 를 붙이면 03:12인 것처럼 보여 줌 (역슬래시는 템플릿 문자열에서 사라지므로 [0-9] 사용)
var shift = 0, m = /[?&]at=([0-9]{2})([0-9]{2})/.exec(location.search);
if (m) shift = (m[1] * H + m[2] * 6e4) - ((Date.now() + 9 * H) % (24 * H));
function tick() {
var kst = Date.now() + 9 * H, day = Math.floor(kst / (24 * H)) * 24 * H, wake = day + 7 * H;
var kst = Date.now() + 9 * H + shift, day = Math.floor(kst / (24 * H)) * 24 * H, wake = day + 7 * H;
var sleeping = kst < wake;
document.getElementById("now").textContent = fmt(kst - day);
document.getElementById("night").hidden = !sleeping;