html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HealthHub Digital Front Door</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
header { background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.1); padding: 1rem 0; position: sticky; top: 0; z-index: 100; }
nav { display: flex; justify-content: space-between; align-items: center; }
nav ul { display: flex; list-style: none; gap: 2rem; }
nav a { text-decoration: none; color: #333; font-weight: 500; padding: 0.5rem 1rem; border-radius: 5px; transition: background 0.3s; }
nav a:hover { background: #f0f0f0; }
.logo { font-size: 1.5rem; font-weight: bold; color: #667eea; }
main { padding: 2rem 0; }
.hero { text-align: center; color: white; margin-bottom: 3rem; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; }
.btn { display: inline-block; background: white; color: #667eea; padding: 1rem 2rem; border-radius: 50px; text-decoration: none; font-weight: bold; transition: transform 0.3s, box-shadow 0.3s; margin: 0.5rem; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.section { background: white; border-radius: 20px; padding: 2rem; margin-bottom: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.hidden { display: none; }
.step { display: none; }
.step.active { display: block; }
form { max-width: 600px; margin: 0 auto; }
label { display: block; margin: 1rem 0 0.5rem; font-weight: 500; }
input[type="checkbox"], input[type="radio"] { margin-right: 0.5rem; }
input[type="text"], input[type="email"], input[type="tel"], select { width: 100%; padding: 0.75rem; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 1rem; }
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, select:focus { outline: none; border-color: #667eea; }
.btn-primary { background: #667eea; color: white; border: none; cursor: pointer; padding: 1rem 2rem; border-radius: 10px; font-size: 1rem; width: 100%; margin-top: 1rem; }
.btn-primary:hover { background: #5a67d8; }
.triage-result { text-align: center; padding: 2rem; }
.triage-emergency { background: #ff4444; color: white; }
.triage-urgent { background: #ffaa00; color: white; }
.triage-routine { background: #4CAF50; color: white; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 1rem; }
.day { padding: 1rem; text-align: center; background: #f8f9fa; border-radius: 5px; cursor: pointer; transition: background 0.3s; }
.day:hover, .day.available { background: #667eea; color: white; }
.day.booked { background: #ddd; cursor: not-allowed; }
.day.selected { background: #ff6b6b; color: white; }
footer { text-align: center; padding: 2rem; color: white; background: rgba(0,0,0,0.1); }
@media (max-width: 768px) { nav ul { flex-direction: column; gap: 1rem; } .hero h1 { font-size: 2rem; } }
</style>
</head>
<body>
<header>
<nav class="container">
<div class="logo">HealthHub</div>
<ul>
<li><a href="#home" onclick="showSection('home')">Home</a></li>
<li><a href="#symptom-checker" onclick="showSection('symptom-checker')">Symptom Checker</a></li>
<li><a href="#schedule" onclick="showSection('schedule')">Self-Schedule</a></li>
<li><a href="#triage" onclick="showSection('triage')">Triage Guide</a></li>
</ul>
</nav>
</header>
<main class="container">
<!-- Hero/Home Section -->
<section id="home" class="hero section">
<h1>Welcome to Your Digital Front Door</h1>
<p>Get fast access to care: Check symptoms, schedule visits, and get triaged instantly.</p>
<a href="#symptom-checker" class="btn" onclick="showSection('symptom-checker')">Start Symptom Check</a>
<a href="#schedule" class="btn" onclick="showSection('schedule')">Book Appointment</a>
</section>
<!-- Symptom Checker -->
<section id="symptom-checker" class="hidden section">
<h2>Symptom Checker</h2>
<form id="symptomForm">
<div class="step active" data-step="1">
<label>Age Group:</label>
<select id="age" required>
<option value="">Select...</option>
<option value="child">Child (0-12)</option>
<option value="adult">Adult (13-64)</option>
<option value="senior">Senior (65+)</option>
</select>
<button type="button" class="btn-primary" onclick="nextStep(1)">Next</button>
</div>
<div class="step" data-step="2">
<label>Select your symptoms (check all that apply):</label>
<label><input type="checkbox" name="symptoms" value="fever"> Fever >101°F</label>
<label><input type="checkbox" name="symptoms" value="chest_pain"> Chest pain or shortness of breath</label>
<label><input type="checkbox" name="symptoms" value="severe_pain"> Severe pain (head, abdomen, etc.)</label>
<label><input type="checkbox" name="symptoms" value="bleeding"> Heavy bleeding</label>
<label><input type="checkbox" name="symptoms" value="dizziness"> Severe dizziness or confusion</label>
<label><input type="checkbox" name="symptoms" value="cough"> Persistent cough or sore throat</label>
<label><input type="checkbox" name="symptoms" value="fatigue"> Fatigue or mild pain</label>
<button type="button" class="btn-primary" onclick="analyzeSymptoms()">Analyze</button>
</div>
</form>
<div id="symptom-result" class="triage-result hidden"></div>
</section>
<!-- Self-Scheduling -->
<section id="schedule" class="hidden section">
<h2>Self-Scheduling</h2>
<form id="scheduleForm">
<label>Full Name:</label>
<input type="text" id="name" required>
<label>Email:</label>
<input type="email" id="email" required>
<label>Phone:</label>
<input type="tel" id="phone" required>
<label>Preferred Date:</label>
<div class="calendar" id="calendar"></div>
<label>Time Slot:</label>
<select id="time">
<option>9:00 AM</option>
<option>10:00 AM</option>
<option>2:00 PM</option>
<option>4:00 PM</option>
</select>
<button type="button" class="btn-primary" onclick="bookAppointment()">Book Appointment</button>
</form>
<p id="booking-result" class="hidden" style="text-align: center; margin-top: 1rem; padding: 1rem; background: #4CAF50; color: white; border-radius: 10px;"></p>
</section>
<!-- Triage Rules Guide -->
<section id="triage" class="hidden section">
<h2>Triage Rules</h2>
<div class="triage-emergency">
<h3>🚨 Emergency (Go to ER Now)</h3>
<ul>
<li>Chest pain, difficulty breathing</li>
<li>Severe bleeding, trauma</li>
<li>Sudden confusion, stroke symptoms</li>
<li>Suicidal thoughts</li>
</ul>
</div>
<div class="triage-urgent">
<h3>⚠️ Urgent (Schedule Today)</h3>
<ul>
<li>High fever >101°F</li>
<li>Severe pain not improving</li>
<li>Vision changes, persistent vomiting</li>
</ul>
</div>
<div class="triage-routine">
<h3>✅ Routine (Schedule Anytime)</h3>
<ul>
<li>Mild symptoms, checkups</li>
<li>Chronic management</li>
</ul>
</div>
<p><strong>Note:</strong> This is not medical advice. Always consult a professional.</p>
</section>
</main>
<footer>
<p>© 2024 HealthHub. Built by Trailblazer Labs. For demonstration only.</p>
</footer>
<script>
let currentStep = 1;
let selectedSymptoms = [];
let triageLevel = '';
let bookedDate = '';
// Navigation
function showSection(sectionId) {
document.querySelectorAll('section').forEach(sec => sec.classList.add('hidden'));
document.getElementById(sectionId).classList.remove('hidden');
if (sectionId === 'symptom-checker') resetSymptomChecker();
if (sectionId === 'schedule') generateCalendar();
}
// Symptom Checker Steps
function nextStep(step) {
document.querySelectorAll('.step').forEach(s => s.classList.remove('active'));
document.querySelector(`[data-step="${step + 1}"]`).classList.add('active');
}
function analyzeSymptoms() {
const checkboxes = document.querySelectorAll('input[name="symptoms"]:checked');
selectedSymptoms = Array.from(checkboxes).map(cb => cb.value);
const age = document.getElementById('age').value;
let score = 0;
const highRisk = ['chest_pain', 'bleeding', 'dizziness'];
const medRisk = ['fever', 'severe_pain'];
highRisk.forEach(sym => { if (selectedSymptoms.includes(sym)) score += 3; });
medRisk.forEach(sym => { if (selectedSymptoms.includes(sym)) score += 2; });
if (selectedSymptoms.length > 0) score += 1;
if (score >= 5 || (age === 'senior' && score >= 3)) {
triageLevel = 'emergency';
} else if (score >= 3) {
triageLevel = 'urgent';
} else {
triageLevel = 'routine';
}
showTriageResult();
}
function showTriageResult() {
document.getElementById('symptomForm').classList.add('hidden');
const result = document.getElementById('symptom-result');
result.classList.remove('hidden');
result.innerHTML = `
<h3>${triageLevel.toUpperCase()} Level Detected</h3>
<p>Symptoms: ${selectedSymptoms.join(', ') || 'None selected'}</p>
<p><strong>Recommendation:</strong></p>
${triageLevel === 'emergency' ? '<p style="font-size:1.2rem;">Call 911 or go to ER IMMEDIATELY!</p>' : ''}
${triageLevel === 'urgent' ? '<p>Schedule an urgent appointment now. <a href="#schedule" class="btn" onclick="showSection(\'schedule\')">Book Now</a></p>' : ''}
${triageLevel === 'routine' ? '<p>Schedule a routine visit. <a href="#schedule" class="btn" onclick="showSection(\'schedule\')">Book Now</a></p>' : ''}
<button class="btn-primary" onclick="resetSymptomChecker()">New Check</button>
`;
result.className = `triage-result triage-${triageLevel}`;
}
function resetSymptomChecker() {
document.getElementById('symptomForm').classList.remove('hidden');
document.getElementById('symptom-result').classList.add('hidden');
document.querySelectorAll('.step').forEach(s => s.classList.remove('active'));
document.querySelector('[data-step="1"]').classList.add('active');
document.getElementById('age').value = '';
document.querySelectorAll('input[name="symptoms"]').forEach(cb => cb.checked = false);
currentStep = 1;
}
// Self-Scheduling
function generateCalendar() {
const calendar = document.getElementById('calendar');
const today = new Date();
calendar.innerHTML = '';
for (let i = 0; i < 35; i++) { // Next 5 weeks
const date = new Date(today);
date.setDate(today.getDate() + i);
const dayEl = document.createElement('div');
dayEl.className = 'day';
dayEl.textContent = date.getDate();
if (i < 1) dayEl.classList.add('booked'); // Today booked
else dayEl.classList.add('available');
dayEl.onclick = () => selectDate(dayEl, date);
calendar.appendChild(dayEl);
}
}
function selectDate(el, date) {
document.querySelectorAll('.day').forEach(d => d.classList.remove('selected'));
el.classList.add('selected');
bookedDate = date.toLocaleDateString();
}
function bookAppointment() {
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const phone = document.getElementById('phone').value;
const time = document.getElementById('time').value;
if (!name || !email || !phone || !bookedDate) {
alert('Please fill all fields and select a date.');
return;
}
const result = document.getElementById('booking-result');
result.textContent = `Appointment booked for ${name} on ${bookedDate} at ${time}! Confirmation sent to ${email}.`;
result.classList.remove('hidden');
// Simulate API call or reset form
document.getElementById('scheduleForm').reset();
document.querySelectorAll('.day').forEach(d => d.classList.remove('selected'));
}
// Default to home
showSection('home');
</script>
</body>
</html>