Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>My Profile | CommunityPulse Hub</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen flex flex-col"> | |
| <custom-navbar></custom-navbar> | |
| <main class="flex-grow container mx-auto px-4 py-8"> | |
| <div class="mb-8 flex justify-between items-center"> | |
| <div> | |
| <h1 class="text-2xl font-bold text-gray-800">My Profile</h1> | |
| <p class="text-gray-600">View and update your personal information</p> | |
| </div> | |
| <button onclick="toggleEditMode()" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-md flex items-center gap-2 transition duration-300"> | |
| <i data-feather="edit" class="w-4 h-4"></i> | |
| Edit Profile | |
| </button> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <div class="lg:col-span-1"> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-6"> | |
| <div class="flex flex-col items-center"> | |
| <div class="h-32 w-32 rounded-full bg-gray-100 mb-4 overflow-hidden relative"> | |
| <img src="http://static.photos/people/200x200/1" alt="Profile photo" class="h-full w-full object-cover"> | |
| <div id="editPhotoBtn" class="absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity duration-300 cursor-pointer hidden"> | |
| <i data-feather="camera" class="w-6 h-6 text-white"></i> | |
| </div> | |
| </div> | |
| <h3 class="text-xl font-bold text-gray-800">John Doe</h3> | |
| <p class="text-gray-500 mb-2">Member since Jan 15, 2020</p> | |
| <span class="px-3 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800">Active</span> | |
| </div> | |
| <div class="mt-6 space-y-4"> | |
| <div class="flex items-center"> | |
| <div class="p-2 rounded-full bg-primary-100 text-primary-500 mr-3"> | |
| <i data-feather="mail" class="w-4 h-4"></i> | |
| </div> | |
| <div> | |
| <p class="text-sm text-gray-500">Email</p> | |
| <p class="text-sm font-medium text-gray-800">john@example.com</p> | |
| </div> | |
| </div> | |
| <div class="flex items-center"> | |
| <div class="p-2 rounded-full bg-primary-100 text-primary-500 mr-3"> | |
| <i data-feather="phone" class="w-4 h-4"></i> | |
| </div> | |
| <div> | |
| <p class="text-sm text-gray-500">Phone</p> | |
| <p class="text-sm font-medium text-gray-800">+63 912 345 6789</p> | |
| </div> | |
| </div> | |
| <div class="flex items-center"> | |
| <div class="p-2 rounded-full bg-primary-100 text-primary-500 mr-3"> | |
| <i data-feather="map-pin" class="w-4 h-4"></i> | |
| </div> | |
| <div> | |
| <p class="text-sm text-gray-500">Address</p> | |
| <p class="text-sm font-medium text-gray-800">123 Main St, Manila, Philippines</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow overflow-hidden mt-6"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h3 class="text-lg font-medium text-gray-900">Security</h3> | |
| </div> | |
| <div class="p-6 space-y-4"> | |
| <a href="#" class="block p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition duration-150 flex items-center gap-3"> | |
| <div class="p-3 rounded-full bg-primary-100 text-primary-500"> | |
| <i data-feather="lock" class="w-5 h-5"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Change Password</p> | |
| <p class="text-sm text-gray-500">Update your account password</p> | |
| </div> | |
| </a> | |
| <a href="#" class="block p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition duration-150 flex items-center gap-3"> | |
| <div class="p-3 rounded-full bg-secondary-100 text-secondary-500"> | |
| <i data-feather="shield" class="w-5 h-5"></i> | |
| </div> | |
| <div> | |
| <p class="font-medium">Two-Factor Authentication</p> | |
| <p class="text-sm text-gray-500">Add an extra layer of security</p> | |
| </div> | |
| </a> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="lg:col-span-2"> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h3 class="text-lg font-medium text-gray-900">Personal Information</h3> | |
| </div> | |
| <div class="p-6"> | |
| <form id="profileForm"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"> | |
| <div> | |
| <label for="firstName" class="block text-sm font-medium text-gray-700 mb-1">First Name</label> | |
| <input type="text" id="firstName" name="firstName" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="John" disabled> | |
| </div> | |
| <div> | |
| <label for="lastName" class="block text-sm font-medium text-gray-700 mb-1">Last Name</label> | |
| <input type="text" id="lastName" name="lastName" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="Doe" disabled> | |
| </div> | |
| <div> | |
| <label for="birthDate" class="block text-sm font-medium text-gray-700 mb-1">Birth Date</label> | |
| <input type="date" id="birthDate" name="birthDate" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="1985-06-15" disabled> | |
| </div> | |
| <div> | |
| <label for="gender" class="block text-sm font-medium text-gray-700 mb-1">Gender</label> | |
| <select id="gender" name="gender" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" disabled> | |
| <option value="male" selected>Male</option> | |
| <option value="female">Female</option> | |
| <option value="other">Other</option> | |
| <option value="prefer-not">Prefer not to say</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email Address</label> | |
| <input type="email" id="email" name="email" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="john@example.com" disabled> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="phone" class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label> | |
| <input type="tel" id="phone" name="phone" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="+63 912 345 6789" disabled> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="address" class="block text-sm font-medium text-gray-700 mb-1">Address</label> | |
| <input type="text" id="address" name="address" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm mb-2" value="123 Main Street" disabled> | |
| <input type="text" id="city" name="city" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm mb-2" value="Manila" disabled> | |
| <input type="text" id="province" name="province" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm mb-2" value="Metro Manila" disabled> | |
| <input type="text" id="postalCode" name="postalCode" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="1000" disabled> | |
| </div> | |
| <div class="pt-5 border-t border-gray-200 hidden" id="formActions"> | |
| <div class="flex justify-end"> | |
| <button type="button" onclick="toggleEditMode()" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500"> | |
| Cancel | |
| </button> | |
| <button type="submit" class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-500 hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500"> | |
| Save Changes | |
| </button> | |
| </div> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow overflow-hidden mt-6"> | |
| <div class="p-6 border-b border-gray-200"> | |
| <h3 class="text-lg font-medium text-gray-900">Emergency Contact</h3> | |
| </div> | |
| <div class="p-6"> | |
| <form id="emergencyForm"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"> | |
| <div> | |
| <label for="emergencyName" class="block text-sm font-medium text-gray-700 mb-1">Full Name</label> | |
| <input type="text" id="emergencyName" name="emergencyName" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="Jane Smith" disabled> | |
| </div> | |
| <div> | |
| <label for="emergencyRelationship" class="block text-sm font-medium text-gray-700 mb-1">Relationship</label> | |
| <input type="text" id="emergencyRelationship" name="emergencyRelationship" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="Spouse" disabled> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="emergencyPhone" class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label> | |
| <input type="tel" id="emergencyPhone" name="emergencyPhone" class="block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm" value="+63 987 654 3210" disabled> | |
| </div> | |
| <div class="pt-5 border-t border-gray-200 hidden" id="emergencyFormActions"> | |
| <div class="flex justify-end"> | |
| <button type="button" onclick="toggleEditMode()" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500"> | |
| Cancel | |
| </button> | |
| <button type="submit" class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-500 hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500"> | |
| Save Changes | |
| </button> | |
| </div> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| <script> | |
| let editMode = false; | |
| function toggleEditMode() { | |
| editMode = !editMode; | |
| // Toggle all input fields | |
| document.querySelectorAll('#profileForm input, #profileForm select, #emergencyForm input').forEach(input => { | |
| input.disabled = !editMode; | |
| }); | |
| // Toggle edit photo button | |
| document.getElementById('editPhotoBtn').classList.toggle('hidden', !editMode); | |
| // Toggle form action buttons | |
| document.getElementById('formActions').classList.toggle('hidden', !editMode); | |
| document.getElementById('emergencyFormActions').classList.toggle('hidden', !editMode); | |
| // Update the edit button text | |
| const editButton = document.querySelector('button[onclick="toggleEditMode()"]'); | |
| editButton.innerHTML = editMode ? | |
| '<i data-feather="x" class="w-4 h-4"></i>Cancel' : | |
| '<i data-feather="edit" class="w-4 h-4"></i>Edit Profile'; | |
| feather.replace(); | |
| } | |
| document.getElementById('profileForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // In a real app, you would save the changes to the server | |
| toggleEditMode(); | |
| alert('Profile updated successfully!'); | |
| }); | |
| document.getElementById('emergencyForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // In a real app, you would save the changes to the server | |
| toggleEditMode(); | |
| alert('Emergency contact updated successfully!'); | |
| }); | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> |