interpreter / index.html
dataquantals's picture
remove one Book an Interpreter - Follow Up Deployment
13c734b verified
Raw History Blame Contribute Delete
86.3 kB
</html><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>ZSL Interpreter Connect</title> <script src="https://cdn.tailwindcss.com"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); body { font-family: 'Inter', sans-serif; background-color: #f9fafb; } .primary-bg { background-color: #023047; } .primary-text { color: #023047; } .accent-bg { background-color: #fb8500; } .accent-text { color: #fb8500; } .sidebar { transition: all 0.3s ease; } .call-modal { animation: fadeIn 0.3s ease-in-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .video-placeholder { background: linear-gradient(135deg, #023047 0%, #219ebc 100%); } #jitsi-container { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); } #start-session-btn:hover, #join-doctor-btn:hover, #join-patient-btn:hover { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); } .toggle-checkbox:checked { right: 0; border-color: #fb8500; } .toggle-checkbox:checked + .toggle-label { background-color: #fb8500; } .fab { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); transition: all 0.3s ease; } .fab:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); } .call-card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); } .profile-pic-upload { opacity: 0; position: absolute; z-index: -1; } .profile-pic-label { cursor: pointer; transition: all 0.3s ease; } .profile-pic-label:hover { transform: scale(1.05); } </style> </head> <body class="min-h-screen"> <!-- Login Page (Default View) --> <div id="login-page" class="flex flex-col items-center justify-center min-h-screen p-4"> <div class="w-full max-w-md p-8 bg-white rounded-xl shadow-md"> <div class="flex flex-col items-center mb-8"> <div class="w-20 h-20 rounded-full primary-bg flex items-center justify-center mb-4"> <i class="fas fa-hands-helping text-white text-3xl"></i> </div> <h1 class="text-2xl font-bold primary-text">ZSL Interpreter Connect</h1> <p class="text-gray-500 text-sm mt-1">Empowering real-time sign language communication in healthcare</p> </div> <form id="login-form" class="space-y-4"> <div> <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label> <input type="email" id="email" required class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#023047] focus:border-[#023047] transition"> </div> <div> <label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label> <input type="password" id="password" required class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#023047] focus:border-[#023047] transition"> </div> <div class="flex items-center justify-between"> <div class="flex items-center"> <input type="checkbox" id="remember" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded"> <label for="remember" class="ml-2 block text-sm text-gray-700">Remember me</label> </div> <a href="#" class="text-sm text-[#023047] hover:underline">Forgot password?</a> </div> <button type="submit" class="w-full primary-bg text-white py-2 px-4 rounded-lg hover:bg-[#022b3d] transition font-medium flex items-center justify-center"> <i class="fas fa-sign-in-alt mr-2"></i> Login </button> </form> </div> <p class="mt-6 text-sm text-gray-500">Don't have an account? <a href="#" class="text-[#023047] hover:underline">Contact admin</a></p> </div> <!-- App Container (Hidden by Default) --> <div id="app-container" class="hidden"> <!-- Mobile Header --> <header class="md:hidden fixed top-0 left-0 right-0 primary-bg text-white p-4 flex justify-between items-center z-50 shadow-md"> <button id="mobile-menu-btn" class="text-white focus:outline-none"> <i class="fas fa-bars text-xl"></i> </button> <h1 class="text-lg font-bold">Interpreter Connect</h1> <div class="w-8 h-8 rounded-full bg-white flex items-center justify-center"> <i class="fas fa-user primary-text"></i> </div> </header> <!-- Desktop Sidebar --> <aside id="sidebar" class="hidden md:block fixed top-0 left-0 h-screen w-64 primary-bg text-white p-4 sidebar"> <div class="flex flex-col h-full"> <div class="flex items-center mb-8"> <div class="w-10 h-10 rounded-full bg-white flex items-center justify-center mr-3"> <i class="fas fa-hands-helping primary-text"></i> </div> <h1 class="text-lg font-bold">ZSL Interpreter Connect</h1> </div> <nav class="flex-1"> <ul class="space-y-2"> <li> <a href="#" data-page="dashboard" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition active-page"> <i class="fas fa-tachometer-alt mr-3"></i> Dashboard </a> </li> <li> <a href="#" data-page="calls" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-phone-alt mr-3"></i> Call History </a> </li> <li> <a href="#" data-page="profile" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-user mr-3"></i> Profile </a> </li> <li> <a href="#" data-page="settings" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-cog mr-3"></i> Settings </a> </li> <li> <a href="#" data-page="admin" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-user-shield mr-3"></i> Admin </a> </li> <li> <a href="#" data-page="booking" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-calendar-check mr-3"></i> Book an Interpreter </a> </li> </ul> </nav> <div class="mt-auto pt-4 border-t border-[#022b3d]"> <button id="logout-btn" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition w-full"> <i class="fas fa-sign-out-alt mr-3"></i> Logout </button> </div> </div> </aside> <!-- Mobile Sidebar --> <aside id="mobile-sidebar" class="fixed top-0 left-0 h-screen w-64 primary-bg text-white p-4 sidebar transform -translate-x-full z-40 transition-transform duration-300 ease-in-out"> <div class="flex flex-col h-full"> <div class="flex items-center mb-8"> <div class="w-10 h-10 rounded-full bg-white flex items-center justify-center mr-3"> <i class="fas fa-hands-helping primary-text"></i> </div> <h1 class="text-lg font-bold">ZSL Interpreter Connect</h1> </div> <nav class="flex-1"> <ul class="space-y-2"> <li> <a href="#" data-page="dashboard" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition active-page"> <i class="fas fa-tachometer-alt mr-3"></i> Dashboard </a> </li> <li> <a href="#" data-page="calls" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-phone-alt mr-3"></i> Call History </a> </li> <li> <a href="#" data-page="profile" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-user mr-3"></i> Profile </a> </li> <li> <a href="#" data-page="settings" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-cog mr-3"></i> Settings </a> </li> <li> <a href="#" data-page="admin" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition"> <i class="fas fa-user-shield mr-3"></i> Admin </a> </li> </ul> </nav> <div class="mt-auto pt-4 border-t border-[#022b3d]"> <button id="mobile-logout-btn" class="flex items-center p-3 rounded-lg hover:bg-[#022b3d] transition w-full"> <i class="fas fa-sign-out-alt mr-3"></i> Logout </button> </div> </div> </aside> <!-- Main Content --> <main id="main-content" class="md:ml-64 pt-16 md:pt-0"> <!-- Dashboard Page --> <div id="dashboard-page" class="p-4 md:p-6 active-page"> <div class="max-w-6xl mx-auto"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-bold primary-text">Video Interpreting Portal</h2> <div class="flex items-center"> <span class="mr-2 text-sm text-gray-600">Status:</span> <div class="relative inline-block w-12 mr-2 align-middle select-none"> <input type="checkbox" id="status-toggle" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="status-toggle" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> <span id="status-text" class="text-sm font-medium">Offline</span> </div> </div> <div class="mb-8 bg-gradient-to-r from-[#023047] to-[#219ebc] p-6 rounded-xl shadow-lg text-white"> <h3 class="text-2xl font-bold mb-2">Hi, <span id="interpreter-name">John Mwansa</span> 👋</h3> <p class="text-white text-opacity-90">Welcome to your interpreting session dashboard. Ready to connect with patients and healthcare providers.</p> </div> <!-- Jitsi Meet Container --> <div id="jitsi-container" class="hidden mb-6 rounded-xl overflow-hidden shadow-xl"> <iframe id="jitsi-iframe" allow="camera; microphone; fullscreen; display-capture" class="w-full h-[500px] border-0"></iframe> </div> <!-- Action Buttons --> <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6"> <button id="start-session-btn" class="bg-gradient-to-r from-[#fb8500] to-[#ffb703] text-white py-4 px-6 rounded-xl shadow-md hover:shadow-lg transition-all transform hover:-translate-y-1 flex flex-col items-center justify-center"> <i class="fas fa-video text-2xl mb-2"></i> <span class="font-bold text-lg">Start New Session</span> <span class="text-sm font-light">Create new meeting room</span> </button> <button id="join-doctor-btn" class="bg-gradient-to-r from-[#023047] to-[#219ebc] text-white py-4 px-6 rounded-xl shadow-md hover:shadow-lg transition-all transform hover:-translate-y-1 flex flex-col items-center justify-center"> <i class="fas fa-user-md text-2xl mb-2"></i> <span class="font-bold text-lg">Join Doctor</span> <span class="text-sm font-light">Connect with healthcare provider</span> </button> <button id="join-patient-btn" class="bg-gradient-to-r from-[#8ecae6] to-[#219ebc] text-white py-4 px-6 rounded-xl shadow-md hover:shadow-lg transition-all transform hover:-translate-y-1 flex flex-col items-center justify-center"> <i class="fas fa-procedures text-2xl mb-2"></i> <span class="font-bold text-lg">Join Patient</span> <span class="text-sm font-light">Connect directly with patient</span> </button> <button id="search-interpreter-btn" class="bg-gradient-to-r from-[#4CAF50] to-[#2E7D32] text-white py-4 px-6 rounded-xl shadow-md hover:shadow-lg transition-all transform hover:-translate-y-1 flex flex-col items-center justify-center"> <i class="fas fa-search-location text-2xl mb-2"></i> <span class="font-bold text-lg">Find Interpreter</span> <span class="text-sm font-light">Locate nearest available</span> </button> </div> <!-- Incoming Call Banner (Hidden by Default) --> <div id="incoming-call-banner" class="hidden mb-6 bg-gradient-to-r from-[#fb8500] to-[#ffb703] text-white p-4 rounded-xl shadow-md"> <div class="flex justify-between items-center"> <div> <h3 class="font-bold text-lg">Incoming Interpreter Call</h3> <div class="flex items-center mt-1"> <span class="bg-white text-[#fb8500] px-2 py-1 rounded text-xs font-bold mr-2">VRI</span> <span class="text-sm">From: <strong>Nurse</strong> at Kitwe Central Hospital</span> </div> </div> <div class="flex space-x-2"> <button id="accept-call-btn" class="bg-white text-[#fb8500] px-4 py-2 rounded-lg font-bold flex items-center"> <i class="fas fa-phone-alt mr-2"></i> Accept </button> <button id="decline-call-btn" class="bg-[#023047] text-white px-4 py-2 rounded-lg font-bold flex items-center"> <i class="fas fa-times mr-2"></i> Decline </button> </div> </div> </div> <!-- Stats Cards --> <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6"> <div class="bg-white p-4 rounded-xl shadow-sm"> <div class="flex items-center"> <div class="p-3 rounded-full bg-[#e1f0ff] mr-3"> <i class="fas fa-phone-alt primary-text"></i> </div> <div> <p class="text-sm text-gray-500">Today's Calls</p> <h3 class="text-xl font-bold">5</h3> </div> </div> </div> <div class="bg-white p-4 rounded-xl shadow-sm"> <div class="flex items-center"> <div class="p-3 rounded-full bg-[#fff4e5] mr-3"> <i class="fas fa-clock accent-text"></i> </div> <div> <p class="text-sm text-gray-500">Total Duration</p> <h3 class="text-xl font-bold">2h 15m</h3> </div> </div> </div> <div class="bg-white p-4 rounded-xl shadow-sm"> <div class="flex items-center"> <div class="p-3 rounded-full bg-[#e5f9f0] mr-3"> <i class="fas fa-star text-green-500"></i> </div> <div> <p class="text-sm text-gray-500">Average Rating</p> <h3 class="text-xl font-bold">4.8</h3> </div> </div> </div> </div> <!-- Call Queue --> <div class="bg-white p-4 rounded-xl shadow-sm"> <div class="flex justify-between items-center mb-4"> <h3 class="font-semibold text-lg">Recent Call Queue</h3> <button class="text-sm primary-text font-medium">View All</button> </div> <div class="space-y-3"> <div class="call-card p-3 border border-gray-100 rounded-lg hover:shadow-md transition cursor-pointer"> <div class="flex justify-between items-center"> <div> <div class="flex items-center mb-1"> <span class="bg-[#023047] text-white px-2 py-1 rounded text-xs font-bold mr-2">VRS</span> <span class="text-sm font-medium">Dr. Banda</span> </div> <div class="flex items-center text-sm text-gray-500"> <i class="fas fa-map-marker-alt mr-1 text-xs"></i> <span>Lusaka Central Clinic • 5km away</span> </div> </div> <div class="text-right"> <p class="text-sm text-gray-500">10:45 AM</p> <span class="text-xs px-2 py-1 rounded-full bg-green-100 text-green-800">Completed</span> </div> </div> </div> <div class="call-card p-3 border border-gray-100 rounded-lg hover:shadow-md transition cursor-pointer"> <div class="flex justify-between items-center"> <div> <div class="flex items-center mb-1"> <span class="bg-[#fb8500] text-white px-2 py-1 rounded text-xs font-bold mr-2">VRI</span> <span class="text-sm font-medium">Sarah K.</span> </div> <div class="flex items-center text-sm text-gray-500"> <i class="fas fa-video mr-1 text-xs"></i> <span>Remote Video Session</span> </div> </div> <div class="text-right"> <p class="text-sm text-gray-500">09:30 AM</p> <span class="text-xs px-2 py-1 rounded-full bg-yellow-100 text-yellow-800">Pending</span> </div> </div> </div> <div class="call-card p-3 border border-gray-100 rounded-lg hover:shadow-md transition cursor-pointer"> <div class="flex justify-between items-center"> <div> <div class="flex items-center mb-1"> <span class="bg-[#023047] text-white px-2 py-1 rounded text-xs font-bold mr-2">VRS</span> <span class="text-sm font-medium">Mr. Phiri</span> </div> <div class="flex items-center text-sm text-gray-500"> <i class="fas fa-map-marker-alt mr-1 text-xs"></i> <span>Ndola Teaching Hospital • 12km away</span> </div> </div> <div class="text-right"> <p class="text-sm text-gray-500">08:15 AM</p> <span class="text-xs px-2 py-1 rounded-full bg-red-100 text-red-800">Missed</span> </div> </div> </div> </div> </div> </div> </div> <!-- Call History Page --> <div id="calls-page" class="p-4 md:p-6 hidden"> <div class="max-w-6xl mx-auto"> <div class="flex justify-between items-center mb-6"> <h2 class="text-2xl font-bold primary-text">Call History</h2> <div class="flex items-center space-x-2"> <div class="relative"> <select class="appearance-none bg-white border border-gray-300 rounded-lg px-4 py-2 pr-8 text-sm focus:outline-none focus:ring-2 focus:ring-[#023047]"> <option>All Calls</option> <option>Completed</option> <option>Missed</option> </select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> <i class="fas fa-chevron-down text-xs"></i> </div> </div> <button class="bg-white border border-gray-300 rounded-lg px-3 py-2 text-sm"> <i class="fas fa-filter"></i> </button> </div> </div> <div class="bg-white rounded-xl shadow-sm overflow-hidden"> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date & Time</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Duration</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Requester</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Feedback</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200"> <tr class="hover:bg-gray-50 cursor-pointer"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Today, 10:45 AM</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">22 min</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="bg-[#023047] text-white px-2 py-1 rounded text-xs font-bold">VRS</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Dr. Banda</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="px-2 py-1 rounded-full bg-green-100 text-green-800">Completed</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <div class="flex items-center"> <i class="fas fa-star text-yellow-400 mr-1"></i> <span>5.0</span> </div> </td> </tr> <tr class="hover:bg-gray-50 cursor-pointer"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Today, 09:30 AM</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">18 min</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="bg-[#fb8500] text-white px-2 py-1 rounded text-xs font-bold">VRI</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Sarah K.</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="px-2 py-1 rounded-full bg-green-100 text-green-800">Completed</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <div class="flex items-center"> <i class="fas fa-star text-yellow-400 mr-1"></i> <span>4.5</span> </div> </td> </tr> <tr class="hover:bg-gray-50 cursor-pointer"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Today, 08:15 AM</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="bg-[#023047] text-white px-2 py-1 rounded text-xs font-bold">VRS</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Mr. Phiri</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="px-2 py-1 rounded-full bg-red-100 text-red-800">Missed</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td> </tr> <tr class="hover:bg-gray-50 cursor-pointer"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Yesterday, 3:20 PM</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15 min</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="bg-[#fb8500] text-white px-2 py-1 rounded text-xs font-bold">VRI</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Nurse Mwape</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <span class="px-2 py-1 rounded-full bg-green-100 text-green-800">Completed</span> </td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> <div class="flex items-center"> <i class="fas fa-star text-yellow-400 mr-1"></i> <span>4.0</span> </div> </td> </tr> </tbody> </table> </div> <div class="bg-gray-50 px-6 py-3 flex items-center justify-between border-t border-gray-200"> <div class="flex-1 flex justify-between sm:hidden"> <a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Previous </a> <a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Next </a> </div> <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"> <div> <p class="text-sm text-gray-700"> Showing <span class="font-medium">1</span> to <span class="font-medium">4</span> of <span class="font-medium">12</span> results </p> </div> <div> <nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination"> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Previous</span> <i class="fas fa-chevron-left h-5 w-5"></i> </a> <a href="#" aria-current="page" class="z-10 bg-[#023047] border-[#023047] text-white relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a> <a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 2 </a> <a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 3 </a> <a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"> <span class="sr-only">Next</span> <i class="fas fa-chevron-right h-5 w-5"></i> </a> </nav> </div> </div> </div> </div> </div> </div> <!-- Profile Page --> <div id="profile-page" class="p-4 md:p-6 hidden"> <div class="max-w-3xl mx-auto"> <div class="mb-6"> <h2 class="text-2xl font-bold primary-text">My Profile</h2> <p class="text-gray-600">Update your personal information and preferences</p> </div> <div class="bg-white rounded-xl shadow-sm p-6"> <form id="profile-form"> <div class="flex flex-col items-center mb-6"> <input type="file" id="profile-pic" accept="image/*" class="profile-pic-upload"> <label for="profile-pic" class="profile-pic-label"> <div class="w-24 h-24 rounded-full bg-gray-200 flex items-center justify-center overflow-hidden mb-3"> <img id="profile-pic-preview" src="https://ui-avatars.com/api/?name=John+Mwansa&background=023047&color=fff" alt="Profile" class="w-full h-full object-cover"> </div> </label> <p class="text-sm text-gray-500">Click to change photo</p> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <div> <label for="first-name" class="block text-sm font-medium text-gray-700 mb-1">First Name</label> <input type="text" id="first-name" value="John" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#023047] focus:border-[#023047] transition" readonly> </div> <div> <label for="last-name" class="block text-sm font-medium text-gray-700 mb-1">Last Name</label> <input type="text" id="last-name" value="Mwansa" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#023047] focus:border-[#023047] transition" readonly> </div> </div> <div class="mb-6"> <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label> <input type="email" id="email" value="john.mwansa@zslconnect.org" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#023047] focus:border-[#023047] transition" readonly> </div> <div class="mb-6"> <label class="block text-sm font-medium text-gray-700 mb-2">Supported Languages</label> <div class="space-y-2"> <div class="flex items-center"> <input type="checkbox" id="zsl" checked class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded"> <label for="zsl" class="ml-2 block text-sm text-gray-700">Zambian Sign Language (ZSL)</label> </div> <div class="flex items-center"> <input type="checkbox" id="english" checked class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded"> <label for="english" class="ml-2 block text-sm text-gray-700">English</label> </div> <div class="flex items-center"> <input type="checkbox" id="bemba" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded"> <label for="bemba" class="ml-2 block text-sm text-gray-700">Bemba</label> </div> <div class="flex items-center"> <input type="checkbox" id="nyanja" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded"> <label for="nyanja" class="ml-2 block text-sm text-gray-700">Nyanja</label> </div> <div class="flex items-center"> <input type="checkbox" id="lozi" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded"> <label for="lozi" class="ml-2 block text-sm text-gray-700">Lozi</label> </div> </div> </div> <div class="mb-6"> <label class="block text-sm font-medium text-gray-700 mb-2">Availability</label> <div class="flex items-center"> <div class="relative inline-block w-12 mr-2 align-middle select-none"> <input type="checkbox" id="availability-toggle" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="availability-toggle" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> <span id="availability-text" class="text-sm font-medium">Available</span> </div> </div> <div class="flex justify-end"> <button type="submit" class="primary-bg text-white py-2 px-6 rounded-lg hover:bg-[#022b3d] transition font-medium">Save Changes</button> </div> </form> </div> </div> </div> <!-- Admin Page --> <div id="admin-page" class="p-4 md:p-6 hidden"> <div class="max-w-6xl mx-auto"> <div class="mb-6"> <h2 class="text-2xl font-bold primary-text">Admin Dashboard</h2> <p class="text-gray-600">Manage interpreters and system settings</p> </div> <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6"> <div class="bg-white p-6 rounded-xl shadow-sm"> <h3 class="text-lg font-semibold mb-4 text-gray-800">Interpreter Management</h3> <div id="interpreter-form" class="hidden mb-6 bg-gray-50 p-4 rounded-lg"> <h4 class="font-medium mb-3">Add New Interpreter</h4> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"> <div> <label class="block text-sm font-medium text-gray-800 mb-1">First Name</label> <input type="text" id="interpreter-firstname" class="w-full px-3 py-2 border border-gray-300 rounded-md text-gray-800"> </div> <div> <label class="block text-sm font-medium text-gray-800 mb-1">Last Name</label> <input type="text" id="interpreter-lastname" class="w-full px-3 py-2 border border-gray-300 rounded-md text-gray-800"> </div> <div> <label class="block text-sm font-medium text-gray-800 mb-1">Email</label> <input type="email" id="interpreter-email" class="w-full px-3 py-2 border border-gray-300 rounded-md text-gray-800"> </div> <div> <label class="block text-sm font-medium text-gray-800 mb-1">Phone</label> <input type="tel" id="interpreter-phone" class="w-full px-3 py-2 border border-gray-300 rounded-md text-gray-800"> </div> </div> <div class="mb-4"> <label class="block text-sm font-medium text-gray-800 mb-2">Languages</label> <div class="flex flex-wrap gap-2"> <label class="inline-flex items-center"> <input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="ZSL"> <span class="ml-2 text-sm text-gray-800">ZSL</span> </label> <label class="inline-flex items-center"> <input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="English"> <span class="ml-2 text-sm text-gray-800">English</span> </label> <label class="inline-flex items-center"> <input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="Bemba"> <span class="ml-2 text-sm text-gray-800">Bemba</span> </label> <label class="inline-flex items-center"> <input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="Nyanja"> <span class="ml-2 text-sm text-gray-800">Nyanja</span> </label> <label class="inline-flex items-center"> <input type="checkbox" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300 rounded" value="Lozi"> <span class="ml-2 text-sm text-gray-800">Lozi</span> </label> </div> </div> <div class="flex justify-end space-x-3"> <button id="cancel-interpreter-btn" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium">Cancel</button> <button id="save-interpreter-btn" class="px-4 py-2 bg-[#023047] text-white rounded-md text-sm font-medium">Save Interpreter</button> </div> </div> <button id="add-interpreter-btn" class="w-full primary-bg text-white py-2 px-4 rounded-lg hover:bg-[#022b3d] transition font-medium mb-4"> <i class="fas fa-user-plus mr-2"></i> Add New Interpreter </button> <button id="view-interpreters-btn" class="w-full bg-white border border-[#023047] primary-text py-2 px-4 rounded-lg hover:bg-gray-50 transition font-medium"> <i class="fas fa-list mr-2"></i> View All Interpreters </button> </div> <div class="bg-white p-6 rounded-xl shadow-sm"> <h3 class="text-lg font-semibold mb-4 text-gray-800">System Statistics</h3> <div class="space-y-4"> <div> <p class="text-sm text-gray-500">Total Interpreters</p> <h3 class="text-xl font-bold">24</h3> </div> <div> <p class="text-sm text-gray-500">Active Sessions</p> <h3 class="text-xl font-bold">8</h3> </div> <div> <p class="text-sm text-gray-500">Average Rating</p> <h3 class="text-xl font-bold">4.6</h3> </div> </div> </div> <div class="bg-white p-6 rounded-xl shadow-sm"> <h3 class="text-lg font-semibold mb-4 text-gray-800">Quick Actions</h3> <div class="space-y-3"> <button class="w-full text-left text-sm p-2 hover:bg-gray-50 rounded-lg"> <i class="fas fa-bell mr-2"></i> Send Announcement </button> <button class="w-full text-left text-sm p-2 hover:bg-gray-50 rounded-lg"> <i class="fas fa-file-export mr-2"></i> Export Reports </button> <button class="w-full text-left text-sm p-2 hover:bg-gray-50 rounded-lg"> <i class="fas fa-cog mr-2"></i> System Settings </button> </div> </div> </div> <!-- Recent Activity --> <div class="bg-white p-6 rounded-xl shadow-sm"> <h3 class="text-lg font-semibold mb-4 text-gray-800">Recent Activity</h3> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Activity</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">User</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Details</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200"> <tr> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Today, 10:30 AM</td> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">New Interpreter</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Admin User</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Registered John Mwansa</td> </tr> <tr> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Today, 09:15 AM</td> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Session Completed</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Sarah K.</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Duration: 22 minutes</td> </tr> <tr> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Yesterday, 4:45 PM</td> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">System Update</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">System</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Applied security patches</td> </tr> </tbody> </table> </div> </div> </div> </div> <!-- Settings Page --> <div id="settings-page" class="p-4 md:p-6 hidden"> <div class="max-w-3xl mx-auto"> <div class="mb-6"> <h2 class="text-2xl font-bold primary-text">Settings</h2> <p class="text-gray-600">Configure your app preferences</p> </div> <div class="bg-white rounded-xl shadow-sm p-6"> <div class="mb-8"> <h3 class="text-lg font-semibold mb-4 primary-text">Notification Preferences</h3> <div class="space-y-4"> <div class="flex items-center justify-between"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Email Notifications</label> <p class="text-xs text-gray-500">Receive email alerts for new calls</p> </div> <div class="relative inline-block w-12 align-middle select-none"> <input type="checkbox" id="email-notifications" checked class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="email-notifications" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> </div> <div class="flex items-center justify-between"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">In-App Notifications</label> <p class="text-xs text-gray-500">Show popup notifications for incoming calls</p> </div> <div class="relative inline-block w-12 align-middle select-none"> <input type="checkbox" id="app-notifications" checked class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="app-notifications" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> </div> <div class="flex items-center justify-between"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Sound Alerts</label> <p class="text-xs text-gray-500">Play sound for incoming calls</p> </div> <div class="relative inline-block w-12 align-middle select-none"> <input type="checkbox" id="sound-alerts" checked class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="sound-alerts" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> </div> </div> </div> <div class="mb-8"> <h3 class="text-lg font-semibold mb-4 primary-text">Video Settings</h3> <div class="space-y-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Video Quality</label> <div class="flex space-x-4"> <div class="flex items-center"> <input id="low-quality" name="video-quality" type="radio" checked class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300"> <label for="low-quality" class="ml-2 block text-sm text-gray-700">Low (for slow networks)</label> </div> <div class="flex items-center"> <input id="hd-quality" name="video-quality" type="radio" class="h-4 w-4 text-[#023047] focus:ring-[#023047] border-gray-300"> <label for="hd-quality" class="ml-2 block text-sm text-gray-700">HD</label> </div> </div> </div> <div class="flex items-center justify-between"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Auto-accept Calls</label> <p class="text-xs text-gray-500">Automatically accept calls when available</p> </div> <div class="relative inline-block w-12 align-middle select-none"> <input type="checkbox" id="auto-accept" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="auto-accept" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> </div> </div> </div> <div class="mb-8"> <h3 class="text-lg font-semibold mb-4 primary-text">Privacy & Security</h3> <div class="space-y-4"> <div class="flex items-center justify-between"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Show My Location</label> <p class="text-xs text-gray-500">Allow VRS calls to see your approximate location</p> </div> <div class="relative inline-block w-12 align-middle select-none"> <input type="checkbox" id="show-location" checked class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> <label for="show-location" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> </div> </div> <div class="flex items-center justify-between"> <div> <label class="block text-sm font-medium text-gray-700 mb-1">Two-Factor Authentication</label> <p class="text-xs text-gray-500">Add extra security to your account</p> </div> <button class="text-sm primary-text font-medium">Enable</button> </div> </div> </div> <div class="flex justify-between items-center pt-4 border-t border-gray-200"> <button class="text-sm text-gray-500 hover:underline">Need help? Contact Support</button> <button class="primary-bg text-white py-2 px-6 rounded-lg hover:bg-[#022b3d] transition font-medium">Save Settings</button> </div> </div> </div> </div> </main> <!-- Interpreter Search Modal (Hidden by Default) --> <div id="interpreter-modal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 hidden"> <div class="bg-white rounded-xl w-full max-w-md mx-4"> <div class="p-6"> <div class="flex justify-between items-center mb-4"> <h3 class="text-xl font-bold">Available Interpreters</h3> <button id="close-interpreter-modal" class="text-gray-500 hover:text-gray-700"> <i class="fas fa-times"></i> </button> </div> <div id="interpreter-list" class="max-h-96 overflow-y-auto mb-4"> <!-- Interpreters will be listed here --> </div> <input type="hidden" id="selected-interpreter-id" value=""> <button id="connect-interpreter-btn" class="w-full bg-gray-400 text-white py-3 px-6 rounded-lg font-bold disabled:opacity-75" disabled> <i class="fas fa-phone-alt mr-2"></i> Connect to Interpreter </button> </div> </div> </div> <!-- Call Modal (Hidden by Default) --> <div id="call-modal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 hidden"> <div class="bg-white rounded-xl w-full max-w-md mx-4 call-modal"> <div class="p-6"> <h3 class="text-xl font-bold mb-2">Incoming Call Request</h3> <div class="space-y-3 mb-6"> <div class="flex items-center"> <i class="fas fa-user-tie mr-3 text-gray-500"></i> <span>Requester: <strong>Nurse</strong> at Kitwe Central Hospital</span> </div> <div class="flex items-center"> <i class="fas fa-phone-alt mr-3 text-gray-500"></i> <span>Call Type: <strong>VRI</strong> (Video Remote Interpreting)</span> </div> <div class="flex items-center"> <i class="fas fa-video mr-3 text-gray-500"></i> <span>Mode: <strong>Video</strong></span> </div> <div class="flex items-center"> <i class="fas fa-clock mr-3 text-gray-500"></i> <span>Time left: <strong id="call-timer">15</strong> seconds</span> </div> </div> <div class="flex justify-center space-x-4"> <button id="modal-accept-btn" class="bg-green-500 text-white px-6 py-3 rounded-lg font-bold flex items-center hover:bg-green-600 transition"> <i class="fas fa-phone-alt mr-2"></i> Accept </button> <button id="modal-decline-btn" class="bg-red-500 text-white px-6 py-3 rounded-lg font-bold flex items-center hover:bg-red-600 transition"> <i class="fas fa-times mr-2"></i> Decline </button> </div> </div> </div> </div> <!-- Video Call Interface (Hidden by Default) --> <div id="video-call" class="fixed inset-0 bg-black z-50 hidden flex flex-col"> <div class="flex-1 relative"> <!-- Remote Video --> <div class="absolute inset-0 video-placeholder flex items-center justify-center"> <div class="text-center text-white"> <i class="fas fa-user-tie text-5xl mb-2"></i> <p class="text-xl font-medium">Nurse at Kitwe Central</p> <p class="text-sm opacity-75">Connecting...</p> </div> </div> <!-- Local Video --> <div class="absolute bottom-4 right-4 w-32 h-48 bg-gray-800 rounded-lg overflow-hidden"> <div class="w-full h-full flex items-center justify-center"> <i class="fas fa-user text-white text-2xl"></i> </div> </div> <!-- Call Controls --> <div class="absolute bottom-0 left-0 right-0 bg-gray-900 bg-opacity-70 p-4"> <div class="flex justify-center space-x-6"> <button class="w-12 h-12 rounded-full bg-gray-700 text-white flex items-center justify-center hover:bg-gray-600 transition"> <i class="fas fa-microphone"></i> </button> <button class="w-12 h-12 rounded-full bg-gray-700 text-white flex items-center justify-center hover:bg-gray-600 transition"> <i class="fas fa-video"></i> </button> <button id="end-call-btn" class="w-12 h-12 rounded-full bg-red-600 text-white flex items-center justify-center hover:bg-red-700 transition"> <i class="fas fa-phone-slash"></i> </button> </div> </div> </div> </div> <!-- Mobile FAB --> <button id="fab-online" class="md:hidden fixed bottom-6 right-6 w-14 h-14 rounded-full primary-bg text-white flex items-center justify-center shadow-lg fab"> <i class="fas fa-power-off text-xl"></i> </button> </div> <script> // DOM Elements const loginPage = document.getElementById('login-page'); const appContainer = document.getElementById('app-container'); const loginForm = document.getElementById('login-form'); const mobileMenuBtn = document.getElementById('mobile-menu-btn'); const mobileSidebar = document.getElementById('mobile-sidebar'); const logoutBtn = document.getElementById('logout-btn'); const mobileLogoutBtn = document.getElementById('mobile-logout-btn'); const statusToggle = document.getElementById('status-toggle'); const statusText = document.getElementById('status-text'); const fabOnline = document.getElementById('fab-online'); const incomingCallBanner = document.getElementById('incoming-call-banner'); const acceptCallBtn = document.getElementById('accept-call-btn'); const declineCallBtn = document.getElementById('decline-call-btn'); const callModal = document.getElementById('call-modal'); const modalAcceptBtn = document.getElementById('modal-accept-btn'); const modalDeclineBtn = document.getElementById('modal-decline-btn'); const callTimer = document.getElementById('call-timer'); const videoCall = document.getElementById('video-call'); const endCallBtn = document.getElementById('end-call-btn'); const pageLinks = document.querySelectorAll('[data-page]'); const pages = document.querySelectorAll('[id$="-page"]:not([id="admin-page"])'); const profilePicInput = document.getElementById('profile-pic'); const profilePicPreview = document.getElementById('profile-pic-preview'); const availabilityToggle = document.getElementById('availability-toggle'); const availabilityText = document.getElementById('availability-text'); // State let isOnline = false; let callTimerInterval; let timeLeft = 15; // Event Listeners loginForm.addEventListener('submit', handleLogin); mobileMenuBtn.addEventListener('click', toggleMobileSidebar); logoutBtn.addEventListener('click', handleLogout); mobileLogoutBtn.addEventListener('click', handleLogout); statusToggle.addEventListener('change', toggleStatus); fabOnline.addEventListener('click', toggleStatus); acceptCallBtn.addEventListener('click', showCallModal); declineCallBtn.addEventListener('click', declineCall); modalAcceptBtn.addEventListener('click', acceptCall); modalDeclineBtn.addEventListener('click', declineCall); endCallBtn.addEventListener('click', endCall); document.getElementById('close-interpreter-modal').addEventListener('click', () => { document.getElementById('interpreter-modal').classList.add('hidden'); }); profilePicInput.addEventListener('change', updateProfilePic); availabilityToggle.addEventListener('change', toggleAvailability); // Page navigation pageLinks.forEach(link => { link.addEventListener('click', (e) => { e.preventDefault(); const pageName = link.getAttribute('data-page'); showPage(pageName); // Update active state document.querySelector('.active-page').classList.remove('active-page'); link.classList.add('active-page'); // Close mobile sidebar if open if (mobileSidebar.classList.contains('translate-x-0')) { toggleMobileSidebar(); } }); }); // Functions function handleLogin(e) { e.preventDefault(); loginPage.classList.add('hidden'); appContainer.classList.remove('hidden'); // For demo purposes, simulate a successful login setTimeout(() => { showPage('dashboard'); }, 500); } function handleLogout() { appContainer.classList.add('hidden'); loginPage.classList.remove('hidden'); isOnline = false; statusToggle.checked = false; statusText.textContent = 'Offline'; fabOnline.classList.remove('accent-bg'); fabOnline.classList.add('primary-bg'); } function toggleMobileSidebar() { mobileSidebar.classList.toggle('-translate-x-full'); mobileSidebar.classList.toggle('translate-x-0'); } function toggleStatus() { isOnline = !isOnline; statusToggle.checked = isOnline; if (isOnline) { statusText.textContent = 'Online'; fabOnline.classList.remove('primary-bg'); fabOnline.classList.add('accent-bg'); // Simulate incoming call after 3 seconds setTimeout(() => { incomingCallBanner.classList.remove('hidden'); }, 3000); } else { statusText.textContent = 'Offline'; fabOnline.classList.remove('accent-bg'); fabOnline.classList.add('primary-bg'); incomingCallBanner.classList.add('hidden'); } } function showCallModal() { incomingCallBanner.classList.add('hidden'); callModal.classList.remove('hidden'); // Start countdown timer timeLeft = 15; callTimer.textContent = timeLeft; callTimerInterval = setInterval(() => { timeLeft--; callTimer.textContent = timeLeft; if (timeLeft <= 0) { clearInterval(callTimerInterval); declineCall(); } }, 1000); } function acceptCall() { clearInterval(callTimerInterval); callModal.classList.add('hidden'); videoCall.classList.remove('hidden'); } function declineCall() { clearInterval(callTimerInterval); callModal.classList.add('hidden'); // Show notification that call was declined alert('Call declined. You have been marked as available for the next call.'); } function endCall() { videoCall.classList.add('hidden'); // Show call summary (for demo) alert('Call ended. Duration: 12 minutes. Please complete your session notes.'); } function showPage(pageName) { pages.forEach(page => { if (page.id === `${pageName}-page`) { page.classList.remove('hidden'); page.classList.add('active-page'); } else { page.classList.add('hidden'); page.classList.remove('active-page'); } }); } function updateProfilePic() { const file = profilePicInput.files[0]; if (file) { const reader = new FileReader(); reader.onload = (e) => { profilePicPreview.src = e.target.result; }; reader.readAsDataURL(file); } } function toggleAvailability() { const isAvailable = availabilityToggle.checked; availabilityText.textContent = isAvailable ? 'Available' : 'Unavailable'; } // Jitsi Elements const jitsiContainer = document.getElementById('jitsi-container'); const jitsiIframe = document.getElementById('jitsi-iframe'); const startSessionBtn = document.getElementById('start-session-btn'); const joinDoctorBtn = document.getElementById('join-doctor-btn'); const joinPatientBtn = document.getElementById('join-patient-btn'); // Jitsi Functions function startJitsiSession(roomName, config = {}) { jitsiContainer.classList.remove('hidden'); const domain = '8x8.vc'; const options = { roomName: roomName, width: '100%', height: '100%', parentNode: jitsiContainer, jwt: 'vpaas-magic-cookie-1ccca8c667d1427ab468f81fc71eda73/1e3ce2', configOverwrite: { disableSimulcast: false, enableNoAudioDetection: true, enableNoisyMicDetection: true, startWithAudioMuted: true, startWithVideoMuted: false, ...config.configOverwrite }, interfaceConfigOverwrite: { APP_NAME: 'ZSL Interpreter Connect', SHOW_JITSI_WATERMARK: false, SHOW_WATERMARK_FOR_GUESTS: false, ...config.interfaceConfigOverwrite } }; jitsiIframe.src = `https://${domain}/${roomName}?jwt=${options.jwt}`; } // Event Listeners for new buttons startSessionBtn.addEventListener('click', () => { const roomName = `ZSL-${Date.now()}`; startJitsiSession(roomName, { configOverwrite: { startWithAudioMuted: true, startWithVideoMuted: false } }); }); joinDoctorBtn.addEventListener('click', () => { const roomName = prompt("Enter Doctor's Room ID:"); if (roomName) { startJitsiSession(roomName, { configOverwrite: { startWithAudioMuted: true, startWithVideoMuted: false } }); } }); joinPatientBtn.addEventListener('click', () => { const roomName = prompt("Enter Patient's Room ID:"); if (roomName) { startJitsiSession(roomName, { configOverwrite: { startWithAudioMuted: true, startWithVideoMuted: false } }); } }); // Search Interpreter Elements const searchInterpreterBtn = document.getElementById('search-interpreter-btn'); const interpreterModal = document.getElementById('interpreter-modal'); const interpreterList = document.getElementById('interpreter-list'); const connectInterpreterBtn = document.getElementById('connect-interpreter-btn'); const selectedInterpreterId = document.getElementById('selected-interpreter-id'); // Mock interpreter data (in real app, this would come from API) const interpreters = [ { id: 'int1', name: 'Obed Mambwe', distance: '0.5 km', rating: 4.8, languages: ['ZSL', 'English'] }, { id: 'int2', name: 'Richard Mumba', distance: '1.2 km', rating: 4.9, languages: ['ZSL', 'Bemba'] }, { id: 'int3', name: 'Ruth Mukuma', distance: '2.5 km', rating: 4.7, languages: ['ZSL', 'Nyanja'] } ]; // Event Listeners for new elements searchInterpreterBtn.addEventListener('click', searchInterpreters); connectInterpreterBtn.addEventListener('click', connectToInterpreter); // Functions for interpreter search function searchInterpreters() { // In real app, this would use Geolocation API and fetch from server navigator.geolocation.getCurrentPosition((position) => { const { latitude, longitude } = position.coords; console.log(`Searching interpreters near ${latitude}, ${longitude}`); // Show loading state interpreterList.innerHTML = '<div class="p-4 text-center">Searching nearby interpreters...</div>'; interpreterModal.classList.remove('hidden'); // Simulate API call delay setTimeout(() => { renderInterpreterList(); }, 1500); }, (error) => { alert('Please enable location services to find interpreters'); console.error('Geolocation error:', error); }); } function renderInterpreterList() { interpreterList.innerHTML = interpreters.map(interpreter => ` <div class="interpreter-item p-4 border-b border-gray-200 hover:bg-gray-50 cursor-pointer" data-id="${interpreter.id}"> <div class="flex justify-between items-center"> <div> <h4 class="font-medium">${interpreter.name}</h4> <div class="flex items-center text-sm text-gray-500 mt-1"> <i class="fas fa-map-marker-alt mr-1"></i> <span>${interpreter.distance} away</span> </div> </div> <div class="text-right"> <div class="flex items-center justify-end"> <i class="fas fa-star text-yellow-400 mr-1"></i> <span>${interpreter.rating}</span> </div> <div class="text-xs mt-1">${interpreter.languages.join(', ')}</div> </div> </div> </div> `).join(''); // Add click handlers to interpreter items document.querySelectorAll('.interpreter-item').forEach(item => { item.addEventListener('click', function() { const id = this.getAttribute('data-id'); selectInterpreter(id); }); }); } function selectInterpreter(id) { // Highlight selected interpreter document.querySelectorAll('.interpreter-item').forEach(item => { item.classList.remove('bg-blue-50', 'border-l-4', 'border-blue-500'); }); const selected = document.querySelector(`.interpreter-item[data-id="${id}"]`); if (selected) { selected.classList.add('bg-blue-50', 'border-l-4', 'border-blue-500'); } // Enable connect button selectedInterpreterId.value = id; connectInterpreterBtn.disabled = false; connectInterpreterBtn.classList.remove('bg-gray-400'); connectInterpreterBtn.classList.add('bg-green-600', 'hover:bg-green-700'); } function connectToInterpreter() { const interpreterId = selectedInterpreterId.value; if (!interpreterId) return; const interpreter = interpreters.find(i => i.id === interpreterId); if (interpreter) { interpreterModal.classList.add('hidden'); startJitsiSession(`ZSL-Interpreter-${interpreterId}-${Date.now()}`, { configOverwrite: { startWithAudioMuted: true, startWithVideoMuted: false, enableClosePage: true } }); } } // Admin Interpreter Form Elements const addInterpreterBtn = document.getElementById('add-interpreter-btn'); const interpreterForm = document.getElementById('interpreter-form'); const cancelInterpreterBtn = document.getElementById('cancel-interpreter-btn'); const saveInterpreterBtn = document.getElementById('save-interpreter-btn'); const interpreterFirstname = document.getElementById('interpreter-firstname'); const interpreterLastname = document.getElementById('interpreter-lastname'); const interpreterEmail = document.getElementById('interpreter-email'); const interpreterPhone = document.getElementById('interpreter-phone'); const languageCheckboxes = document.querySelectorAll('#interpreter-form input[type="checkbox"]'); // Event Listeners for Admin addInterpreterBtn.addEventListener('click', () => { interpreterForm.classList.toggle('hidden'); }); cancelInterpreterBtn.addEventListener('click', () => { interpreterForm.classList.add('hidden'); clearInterpreterForm(); }); saveInterpreterBtn.addEventListener('click', saveInterpreter); // Functions for Admin function clearInterpreterForm() { interpreterFirstname.value = ''; interpreterLastname.value = ''; interpreterEmail.value = ''; interpreterPhone.value = ''; languageCheckboxes.forEach(checkbox => { checkbox.checked = false; }); } function saveInterpreter() { const firstName = interpreterFirstname.value.trim(); const lastName = interpreterLastname.value.trim(); const email = interpreterEmail.value.trim(); const phone = interpreterPhone.value.trim(); const languages = Array.from(languageCheckboxes) .filter(checkbox => checkbox.checked) .map(checkbox => checkbox.value); if (!firstName || !lastName || !email || languages.length === 0) { alert('Please fill in all required fields (Name, Email, and at least one language)'); return; } // In a real app, this would send to your backend API console.log('Saving interpreter:', { firstName, lastName, email, phone, languages }); // For demo purposes, just show success and clear form alert('Interpreter saved successfully!'); clearInterpreterForm(); interpreterForm.classList.add('hidden'); } // Initialize document.addEventListener('DOMContentLoaded', () => { // Initialize any default values statusToggle.checked = false; availabilityToggle.checked = true; }); </script> <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=dataquantals/interpreter" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> }); </script> </body> </html>
</html><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ZSL Interpreter Connect</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f9fafb;
}
.primary-bg {
background-color: #023047;
}
.primary-text {
color: #023047;
}
.accent-bg {
background-color: #fb8500;
}
.accent-text {
color: #fb8500;
}
.sidebar {
transition: all 0.3s ease;
}
.call-modal {
animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.video-placeholder {
background: linear-gradient(135deg, #023047 0%, #219ebc 100%);
}
#jitsi-container {
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
#start-session-btn:hover, #join-doctor-btn:hover, #join-patient-btn:hover {
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.toggle-checkbox:checked {
right: 0;
border-color: #fb8500;
}
.toggle-checkbox:checked + .toggle-label {
background-color: #fb8500;
}
.fab {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transition: all 0.3s ease;
}
.fab:hover {
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.call-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.profile-pic-upload {
opacity: 0;
position: absolute;
z-index: -1;
}
.profile-pic-label {
cursor: pointer;
transition: all 0.3s ease;
}
.profile-pic-label:hover {
transform: scale(1.05);
}
</style>
</head>
<body class="min-h-screen">
<!-- Login Page (Default View) -->