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>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
(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");
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user