nhs-buddy / index.html
sidhusmart's picture
The AI assistant tab does not seem to have the same height as the tablet - it does not fill the page fully. Can you change it to fit the tab properly? - Follow Up Deployment
8166ce1 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NHS Doctor's App</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;
}
.nhs-blue {
background-color: #005EB8;
}
.nhs-button {
transition: all 0.3s ease;
}
.nhs-button:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 94, 184, 0.2);
}
.vital-card {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
.vital-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}
.pulse-animation {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(0, 94, 184, 0.4);
}
70% {
box-shadow: 0 0 0 10px rgba(0, 94, 184, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(0, 94, 184, 0);
}
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
#chat-messages {
max-height: calc(100vh - 300px);
min-height: 300px;
}
</style>
</head>
<body class="bg-gray-100">
<div class="flex flex-col md:flex-row h-screen max-w-6xl mx-auto border-8 border-gray-800 rounded-3xl overflow-hidden shadow-2xl">
<!-- Left Pane - Action Buttons -->
<div class="w-full md:w-1/3 bg-white p-6 flex flex-col space-y-8">
<div class="text-center mb-8">
<h1 class="text-2xl font-bold text-gray-800">NHS Doctor's Portal</h1>
<p class="text-gray-600">Patient Consultation</p>
</div>
<!-- MIC Button -->
<button id="micButton" class="nhs-button nhs-blue text-white py-12 rounded-2xl flex flex-col items-center justify-center pulse-animation">
<i class="fas fa-microphone text-4xl mb-4"></i>
<span class="text-xl font-semibold">VOICE CHAT</span>
<span class="text-sm mt-2 opacity-80">Talk with AI Assistant</span>
</button>
<!-- Photo Button -->
<button id="photoButton" class="nhs-button bg-white border-2 border-blue-500 text-blue-500 py-12 rounded-2xl flex flex-col items-center justify-center hover:bg-blue-50">
<i class="fas fa-camera text-4xl mb-4"></i>
<span class="text-xl font-semibold">PHOTO</span>
<span class="text-sm mt-2 opacity-80">Capture or upload</span>
</button>
<!-- Bottom Navigation -->
<div class="mt-auto flex justify-between text-gray-500">
<button class="p-2 rounded-full hover:bg-gray-100">
<i class="fas fa-home"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-100">
<i class="fas fa-calendar-alt"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-100">
<i class="fas fa-user-md"></i>
</button>
<button class="p-2 rounded-full hover:bg-gray-100">
<i class="fas fa-cog"></i>
</button>
</div>
</div>
<!-- Right Pane - Patient Information -->
<div class="w-full md:w-2/3 bg-gray-50 p-6 overflow-y-auto">
<!-- Tab Navigation -->
<div class="flex border-b border-gray-200 mb-6">
<button class="tab-button active px-4 py-2 font-medium text-blue-600 border-b-2 border-blue-600" data-tab="patient-tab">
Patient Overview
</button>
<button class="tab-button px-4 py-2 font-medium text-gray-500 hover:text-gray-700" data-tab="assistant-tab">
AI Assistant
</button>
</div>
<!-- Patient Overview Tab -->
<div id="patient-tab" class="tab-content active">
<div class="flex justify-between items-center mb-6">
<div>
<h2 class="text-2xl font-bold text-gray-800">Patient Overview</h2>
<p class="text-gray-600">Current consultation</p>
</div>
<div class="flex space-x-2">
<button class="p-2 bg-white rounded-lg shadow-sm hover:bg-gray-100">
<i class="fas fa-search text-gray-600"></i>
</button>
<button class="p-2 bg-white rounded-lg shadow-sm hover:bg-gray-100">
<i class="fas fa-ellipsis-v text-gray-600"></i>
</button>
</div>
</div>
<!-- Patient Card -->
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
<div class="flex items-center space-x-4 mb-4">
<div class="w-16 h-16 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user text-2xl text-blue-500"></i>
</div>
<div>
<h3 class="text-xl font-bold text-gray-800">Emily Johnson</h3>
<div class="flex space-x-2 text-sm">
<span class="bg-blue-100 text-blue-800 px-2 py-1 rounded">Female</span>
<span class="bg-green-100 text-green-800 px-2 py-1 rounded">32 years</span>
<span class="bg-purple-100 text-purple-800 px-2 py-1 rounded">NHS No: 485 920 3847</span>
</div>
</div>
</div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mt-4">
<div class="vital-card bg-white p-3 rounded-lg border border-gray-100">
<p class="text-xs text-gray-500">Blood Pressure</p>
<p class="text-xl font-bold">120/80 <span class="text-sm font-normal text-green-500">mmHg</span></p>
</div>
<div class="vital-card bg-white p-3 rounded-lg border border-gray-100">
<p class="text-xs text-gray-500">Heart Rate</p>
<p class="text-xl font-bold">72 <span class="text-sm font-normal text-green-500">bpm</span></p>
</div>
<div class="vital-card bg-white p-3 rounded-lg border border-gray-100">
<p class="text-xs text-gray-500">Temperature</p>
<p class="text-xl font-bold">36.8 <span class="text-sm font-normal text-green-500">°C</span></p>
</div>
<div class="vital-card bg-white p-3 rounded-lg border border-gray-100">
<p class="text-xs text-gray-500">Oxygen</p>
<p class="text-xl font-bold">98 <span class="text-sm font-normal text-green-500">%</span></p>
</div>
</div>
</div>
<!-- Medical History -->
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Medical History</h3>
<div class="space-y-3">
<div class="flex justify-between items-center p-3 hover:bg-gray-50 rounded-lg">
<div>
<p class="font-medium">Type 2 Diabetes</p>
<p class="text-sm text-gray-500">Diagnosed 2018</p>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
<div class="flex justify-between items-center p-3 hover:bg-gray-50 rounded-lg">
<div>
<p class="font-medium">Hypertension</p>
<p class="text-sm text-gray-500">Diagnosed 2019</p>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
<div class="flex justify-between items-center p-3 hover:bg-gray-50 rounded-lg">
<div>
<p class="font-medium">Allergy: Penicillin</p>
<p class="text-sm text-gray-500">Severe reaction</p>
</div>
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</div>
</div>
<!-- Recent Consultations -->
<div class="bg-white rounded-xl shadow-sm p-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Recent Consultations</h3>
<div class="space-y-4">
<div class="border-l-4 border-blue-500 pl-4 py-1">
<p class="font-medium">Follow-up: Diabetes Management</p>
<p class="text-sm text-gray-500">Dr. Smith • 15 May 2023</p>
</div>
<div class="border-l-4 border-green-500 pl-4 py-1">
<p class="font-medium">Annual Checkup</p>
<p class="text-sm text-gray-500">Dr. Patel • 12 Feb 2023</p>
</div>
<div class="border-l-4 border-purple-500 pl-4 py-1">
<p class="font-medium">Blood Pressure Review</p>
<p class="text-sm text-gray-500">Dr. Jones • 5 Nov 2022</p>
</div>
</div>
</div>
</div>
<!-- AI Assistant Tab -->
<div id="assistant-tab" class="tab-content h-full">
<div class="flex flex-col h-full">
<div class="flex justify-between items-center mb-6">
<div>
<h2 class="text-2xl font-bold text-gray-800">AI Assistant</h2>
<p class="text-gray-600">Ask about patient history or treatment options</p>
</div>
</div>
<!-- Chat Messages Container -->
<div id="chat-messages" class="flex-1 overflow-y-auto space-y-4">
<div class="bg-blue-50 p-4 rounded-lg max-w-3/4">
<p class="text-sm text-gray-600 mb-1">AI Assistant</p>
<p>Hello Doctor, how can I assist you with Emily Johnson's case today?</p>
</div>
</div>
<!-- Message Input -->
<div class="flex items-center space-x-2 mt-auto pt-4">
<input type="text" id="message-input" placeholder="Type your question..."
class="flex-1 p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<button id="send-button" class="nhs-button nhs-blue text-white p-3 rounded-lg">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
</div>
</div>
</div>
<script>
// MIC Button functionality
const micButton = document.getElementById('micButton');
let isRecording = false;
micButton.addEventListener('click', function() {
isRecording = !isRecording;
if (isRecording) {
micButton.innerHTML = `
<i class="fas fa-microphone-slash text-4xl mb-4"></i>
<span class="text-xl font-semibold">RECORDING</span>
<span class="text-sm mt-2 opacity-80">Tap to stop</span>
<div class="mt-2 flex space-x-1">
<div class="w-2 h-2 bg-white rounded-full animate-pulse"></div>
<div class="w-2 h-2 bg-white rounded-full animate-pulse" style="animation-delay: 0.2s"></div>
<div class="w-2 h-2 bg-white rounded-full animate-pulse" style="animation-delay: 0.4s"></div>
</div>
`;
micButton.classList.add('bg-red-500');
micButton.classList.remove('nhs-blue');
micButton.classList.remove('pulse-animation');
// Simulate recording
console.log("Recording started...");
} else {
micButton.innerHTML = `
<i class="fas fa-microphone text-4xl mb-4"></i>
<span class="text-xl font-semibold">VOICE CHAT</span>
<span class="text-sm mt-2 opacity-80">Talking with AI Assistant</span>
`;
micButton.classList.remove('bg-red-500');
micButton.classList.add('nhs-blue');
micButton.classList.add('pulse-animation');
// Simulate recording stopped
console.log("Recording stopped. Processing voice input...");
// Show processing message
setTimeout(() => {
alert("Processing your voice input with AI Assistant...");
}, 500);
}
});
// Photo Button functionality
const photoButton = document.getElementById('photoButton');
photoButton.addEventListener('click', function() {
console.log("Opening photo interface...");
// In a real app, this would open the camera or file picker
alert("Please choose to take a new photo or select from library");
});
// Tab Switching Functionality
const tabButtons = document.querySelectorAll('.tab-button');
const tabContents = document.querySelectorAll('.tab-content');
tabButtons.forEach(button => {
button.addEventListener('click', () => {
// Remove active classes from all buttons and contents
tabButtons.forEach(btn => {
btn.classList.remove('active', 'text-blue-600', 'border-blue-600');
btn.classList.add('text-gray-500');
});
tabContents.forEach(content => {
content.classList.remove('active');
content.classList.add('hidden');
});
// Add active classes to clicked button and corresponding content
button.classList.add('active', 'text-blue-600', 'border-blue-600');
button.classList.remove('text-gray-500');
const tabId = button.getAttribute('data-tab');
document.getElementById(tabId).classList.remove('hidden');
document.getElementById(tabId).classList.add('active');
});
});
// Chat Functionality
const messageInput = document.getElementById('message-input');
const sendButton = document.getElementById('send-button');
const chatMessages = document.getElementById('chat-messages');
function sendMessage() {
const message = messageInput.value.trim();
if (message) {
// Add user message
chatMessages.innerHTML += `
<div class="bg-white p-4 rounded-lg max-w-3/4 ml-auto">
<p class="text-sm text-gray-600 mb-1">You</p>
<p>${message}</p>
</div>
`;
messageInput.value = '';
// Simulate AI response
setTimeout(() => {
chatMessages.innerHTML += `
<div class="bg-blue-50 p-4 rounded-lg max-w-3/4">
<p class="text-sm text-gray-600 mb-1">AI Assistant</p>
<p>I'm analyzing your question about "${message}". Here's what I found relevant to Emily Johnson's case...</p>
</div>
`;
chatMessages.scrollTop = chatMessages.scrollHeight;
}, 1000);
chatMessages.scrollTop = chatMessages.scrollHeight;
}
}
sendButton.addEventListener('click', sendMessage);
messageInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter') sendMessage();
});
</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=sidhusmart/nhs-buddy" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>