⚠️ EMERGENCY ALERT — EVACUATE NOW ⚠️
🚨
EMERGENCY ACTIVATED
Follow the instructions below. Stay calm.
🛡️ Immediate Steps
    📞 Emergency Contacts
    🛡️

    SafeCampus

    Disaster Preparedness System

    MON1 Jan 2025 · 00:00:00
    Standby
    ⚠️Emergency scenario active.
    Step 1 — Select Disaster Type
    🌍 Earthquake
    🔥 Fire
    🌊 Flood
    🌀 Cyclone
    Emergency Panic Mode
    PRESS FOR EMERGENCY
    Immediate Safety Actions
    🌍

    EARTHQUAKE

    Follow these steps in order. Stay calm.

    Preparedness Checklist — Score
    0% score

    Not Checked

    Complete all items to reach 100%.

    Emergency Contacts
    Safety Dashboard — Preparedness Levels
    Smart Evacuation Route Finder — BFS Pathfinding

    Blue = Your position · Green = Exits · Orange = Shortest safe route (BFS algorithm)

    You
    Exit
    Wall
    Path
    Select your position on the map, then click "Find Safest Route" to run BFS pathfinding.
    AI Disaster Safety Assistant
    Campus Emergency Map
    Block A Block B Block C Library Main Hall / Canteen 🚪 🚪 🚪 🅐 🅑 🧯 🧯 🧯 🚪
    Fire Exit
    Assembly Point
    Medical Room
    Fire Extinguisher
    Emergency Alert Broadcast System
    No alerts broadcast yet. Use presets or type a custom message.
    Disaster Simulation Training
    0/0
    Complete!
    Scenario
    Loading...
    Question 1 of 8
    Emergency Kit Checklist
    0/12
    Check off items you have in your emergency kit
    Location-Based Emergency Services
    📍 Location not detected. Click below to find nearby services.
    Disaster Severity Meter
    LowModerateHighExtreme
    LOW — Level 3

    Standard precautions advised. Monitor official channels. Ensure you know evacuation routes. Keep emergency kit accessible.

    Offline Support — Service Worker Architecture

    SafeCampus can work without internet using Service Workers, enabling emergency access even during network outages.

    ⚙️

    1. Register Service Worker

    On first load, register a service worker that intercepts all network requests and caches critical assets.

    💾

    2. Cache Emergency Assets

    Cache the full HTML, CSS, JavaScript, disaster data JSON, and campus map SVG during installation phase.

    🔌

    3. Serve from Cache When Offline

    When network fails, service worker serves cached resources instantly — all emergency features remain functional.

    🔄

    4. Background Sync on Reconnect

    When connectivity restores, sync preparedness scores and alert logs with the central server automatically.

    // sw.js — Service Worker Registration const CACHE_NAME = 'safecampus-v1'; const ASSETS = ['/', '/index.html', '/style.css', '/app.js', '/data/disasters.json']; self.addEventListener('install', e => { e.waitUntil(caches.open(CACHE_NAME).then(c => c.addAll(ASSETS))); }); self.addEventListener('fetch', e => { e.respondWith( caches.match(e.request).then(res => res || fetch(e.request)) ); });
    SafeCampus Preparedness Certificate
    Complete at least 80% preparedness score to unlock certificate.
    CERTIFICATE OF PREPAREDNESS
    SafeCampus Disaster Preparedness Program
    This certifies that
    Your Name
    Score: 0%
    Has successfully completed the SafeCampus Disaster Preparedness Training and demonstrated knowledge of emergency response protocols, evacuation procedures, and safety guidelines.
    Issued: —
    ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡

    Complete 80%+ preparedness checklist and enter your name to unlock.

    🚨 Emergency WhatsApp Alert

    Send an instant SOS message to campus emergency coordinator

    📱 Send SOS via WhatsApp
    📱
    📲 Scan & Share
    Scan this QR code to open WhatsApp & spread SafeCampus to your friends!
    Live JSON Preparedness Data Output
    // Select a disaster to generate JSON output...