Files
habit-tracker/app/static/js/app.js
T
shinalokandClaude Sonnet 5 cee589bb3e Initial commit: habit tracker PWA with Google OAuth, push notifications
FastAPI + SQLAlchemy/Alembic + MariaDB backend with Jinja2/htmx/Alpine
server-rendered frontend. Multi-user via Google OAuth, daily habit
tracking, monthly/weekly history views, Web Push reminders via
APScheduler, and PWA support (manifest, service worker, offline caching).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 18:06:17 +09:00

36 lines
1.1 KiB
JavaScript

(function () {
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.register("/service-worker.js").catch(function (err) {
console.error("서비스워커 등록 실패", err);
});
});
}
function isIos() {
return /iphone|ipad|ipod/i.test(window.navigator.userAgent);
}
function isStandalone() {
return (
("standalone" in window.navigator && window.navigator.standalone) ||
window.matchMedia("(display-mode: standalone)").matches
);
}
document.addEventListener("DOMContentLoaded", function () {
var banner = document.getElementById("ios-install-banner");
if (!banner) return;
var dismissed = localStorage.getItem("iosInstallBannerDismissed");
if (isIos() && !isStandalone() && !dismissed) {
banner.style.display = "flex";
}
});
window.dismissIosInstallBanner = function () {
var banner = document.getElementById("ios-install-banner");
if (banner) banner.style.display = "none";
localStorage.setItem("iosInstallBannerDismissed", "1");
};
})();