-
-
-
-
🌿
-
Sanjeevani AI
-
Your voice-first medicine safety companion
-
Choose your language / अपनी भाषा चुनें / மொழியை தேர்ந்தெடுக்கவும்
-
-
-
-
-
-
🌿
-
Sanjeevani AI
-
Your voice-first medicine safety companion
-
-
-
-
-
-
-
-
-
-
My Medicines
-
+ Add Medicine
-
-
-
- 📷 Scan strip photo
-
-
-
On-device OCR — works even with shaky handwriting or worn print.
-
Reading photo...
-
-
-
-
No medicines added yet.
-
-
-
-
-
-
-
Today's Schedule
-
Icon-based, made for low-literacy users
-
-
-
-
-
-
Pharmacist / Caregiver Dashboard
-
Full interaction summary for counseling
-
-
🖨️ Print Summary
-
-
-
-
-
- 🏠 Home
- 🗓️ Schedule
- 🧑⚕️ Pharmacist
-
-
-
-
-
-
-
-
-
-
-
diff --git a/js/app.js b/js/app.js
deleted file mode 100644
index 8025bac384d79714478d65958828224c966797a0..0000000000000000000000000000000000000000
--- a/js/app.js
+++ /dev/null
@@ -1,368 +0,0 @@
-/* ---------- Global state ---------- */
-const state = {
- lang: "en",
- patient: { name: "", age: "" },
- catalog: [],
- interactionRules: [],
- cabinet: [], // array of drug ids
-};
-
-const els = {};
-
-/* ---------- Boot ---------- */
-document.addEventListener("DOMContentLoaded", async () => {
- cacheEls();
- bindStaticEvents();
- await loadData();
- renderLangGrid();
- showScreen("lang");
- if ("serviceWorker" in navigator) {
- navigator.serviceWorker.register("sw.js").catch(() => {});
- }
- maybeRunDebugPreset();
-});
-
-/* ---------- Debug/demo preset (used for QA screenshots & quick demos) ----------
- Append ?demo=home|schedule|pharmacist&lang=en|hi|ta to index.html to jump
- straight into a populated screen with sample data. Not part of normal UX. */
-function maybeRunDebugPreset() {
- const params = new URLSearchParams(window.location.search);
- const demo = params.get("demo");
- if (!demo) return;
- state.lang = params.get("lang") || "en";
- currentLang = state.lang;
- applyTranslations();
- state.patient.name = params.get("name") || "Lakshmi Ammal";
- state.patient.age = params.get("age") || "68";
- els.patientBadge.textContent = state.patient.name + ", " + state.patient.age;
- const sample = (params.get("meds") || "ramipril,spironolactone,atorvastatin,metformin").split(",");
- state.cabinet = sample;
- showScreen(demo);
-}
-
-function cacheEls() {
- document.querySelectorAll("[data-screen]").forEach(s => (els[s.dataset.screen] = s));
- els.langGrid = document.getElementById("langGrid");
- els.onboardName = document.getElementById("onboardName");
- els.onboardAge = document.getElementById("onboardAge");
- els.searchInput = document.getElementById("searchInput");
- els.searchResults = document.getElementById("searchResults");
- els.cabinetList = document.getElementById("cabinetList");
- els.cabinetEmpty = document.getElementById("cabinetEmpty");
- els.riskPanel = document.getElementById("riskPanel");
- els.scheduleBody = document.getElementById("scheduleBody");
- els.pharmacistBody = document.getElementById("pharmacistBody");
- els.scanInput = document.getElementById("scanInput");
- els.scanStatus = document.getElementById("scanStatus");
- els.navBar = document.getElementById("navBar");
- els.patientBadge = document.getElementById("patientBadge");
-}
-
-async function loadData() {
- // Data ships as plain JS globals (data/drugs.js, data/interactions.js) rather
- // than fetch()-ed JSON, so the app works when opened straight from disk
- // (file://) with no local server and no CORS/fetch restrictions. Classic
- // top-level scripts share one global lexical scope, so these identifiers
- // (declared with `const` in the data files) are reachable here directly —
- // note they are NOT properties of window.
- state.catalog = typeof DRUGS_DATA !== "undefined" ? DRUGS_DATA : [];
- state.interactionRules = typeof INTERACTIONS_DATA !== "undefined" ? INTERACTIONS_DATA : [];
-}
-
-/* ---------- Screen management ---------- */
-function showScreen(name) {
- document.querySelectorAll("[data-screen]").forEach(el => el.classList.add("hidden"));
- if (els[name]) els[name].classList.remove("hidden");
- const isAppScreen = ["home", "schedule", "pharmacist"].includes(name);
- document.getElementById("topBarWrap").classList.toggle("hidden", !isAppScreen);
- els.navBar.classList.toggle("hidden", !isAppScreen);
- document.querySelectorAll(".navBtn").forEach(b => b.classList.toggle("active", b.dataset.target === name));
- if (name === "home") renderCabinet();
- if (name === "schedule") renderSchedule();
- if (name === "pharmacist") renderPharmacist();
-}
-
-/* ---------- Language step ---------- */
-const LANGS = [
- { code: "en", label: "English" },
- { code: "hi", label: "हिन्दी (Hindi)" },
- { code: "ta", label: "தமிழ் (Tamil)" },
-];
-
-function renderLangGrid() {
- els.langGrid.innerHTML = LANGS.map(
- l => `
-
-
${f.title[state.lang] || f.title.en}
-
${t("why")}: ${f.explain[state.lang] || f.explain.en}
-
${t("advice")}: ${f.advice[state.lang] || f.advice.en}
-
${t("speakThis")}
-
`;
- }).join("");
- els.riskPanel.innerHTML = `