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,27 @@
|
||||
(function () {
|
||||
function initSortable() {
|
||||
var list = document.getElementById("habit-list");
|
||||
if (!list || typeof Sortable === "undefined") return;
|
||||
|
||||
Sortable.create(list, {
|
||||
handle: ".drag-handle",
|
||||
animation: 150,
|
||||
forceFallback: true, // iOS Safari는 네이티브 HTML5 D&D 터치 지원이 불안정해서 자체 포인터 시뮬레이션을 강제한다
|
||||
fallbackTolerance: 3,
|
||||
onEnd: function () {
|
||||
var ids = Array.from(list.children)
|
||||
.map(function (el) { return el.getAttribute("data-habit-id"); })
|
||||
.filter(Boolean)
|
||||
.map(Number);
|
||||
|
||||
fetch("/api/habits/reorder", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ habit_ids: ids }),
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", initSortable);
|
||||
})();
|
||||
Reference in New Issue
Block a user