aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/index.js b/index.js
index 06d1f61..bec056d 100644
--- a/index.js
+++ b/index.js
@@ -61,6 +61,52 @@
ic.addEventListener('click', () => openWindow(ic.dataset.open));
});
+ // Keep Android Open — system notice. Sept 1, 2026 UTC is the target.
+ const KOA_TARGET = Date.UTC(2026, 8, 1, 0, 0, 0);
+ const KOA_KEY = 'tyler.koa.dismissed';
+ function koaTick() {
+ const ms = KOA_TARGET - Date.now();
+ const tray = document.getElementById('koa-tray-count');
+ if (ms <= 0) {
+ if (tray) tray.textContent = 'now';
+ ['d','h','m','s'].forEach(k => {
+ const el = document.getElementById('koa-cd-' + k);
+ if (el) el.textContent = '0';
+ });
+ return;
+ }
+ const d = Math.floor(ms / 86400000);
+ const h = Math.floor((ms % 86400000) / 3600000);
+ const m = Math.floor((ms % 3600000) / 60000);
+ const s = Math.floor((ms % 60000) / 1000);
+ if (tray) tray.textContent = d + 'd';
+ const dEl = document.getElementById('koa-cd-d'); if (dEl) dEl.textContent = d;
+ const hEl = document.getElementById('koa-cd-h'); if (hEl) hEl.textContent = String(h).padStart(2,'0');
+ const mEl = document.getElementById('koa-cd-m'); if (mEl) mEl.textContent = String(m).padStart(2,'0');
+ const sEl = document.getElementById('koa-cd-s'); if (sEl) sEl.textContent = String(s).padStart(2,'0');
+ }
+ koaTick(); setInterval(koaTick, 1000);
+
+ const koaTray = document.getElementById('koa-tray');
+ if (koaTray) koaTray.addEventListener('click', () => openWindow('koa'));
+
+ const koaDismiss = document.getElementById('koa-dismiss');
+ if (koaDismiss) koaDismiss.addEventListener('click', () => {
+ localStorage.setItem(KOA_KEY, '1');
+ document.getElementById('w-koa').style.display = 'none';
+ });
+
+ const koaWin = document.getElementById('w-koa');
+ if (koaWin) {
+ const z = window.__uiScale || 1;
+ const vw = window.innerWidth / z;
+ koaWin.style.left = Math.max(20, (vw - 380) / 2) + 'px';
+ }
+
+ if (!localStorage.getItem(KOA_KEY)) {
+ setTimeout(() => openWindow('koa'), 900);
+ }
+
const dropALine = document.getElementById('neighbors-contact-link');
if (dropALine) dropALine.addEventListener('click', e => { e.preventDefault(); openWindow('guestbook'); });