|
<!DOCTYPE html> |
|
<html lang="es"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Guía Completa de Medicamentos y Posología</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"> |
|
<script> |
|
tailwind.config = { |
|
theme: { |
|
extend: { |
|
colors: { |
|
primary: '#3b82f6', |
|
secondary: '#10b981', |
|
accent: '#f59e0b', |
|
dark: '#1e293b', |
|
light: '#f8fafc' |
|
} |
|
} |
|
} |
|
} |
|
</script> |
|
<style> |
|
.med-card:hover { |
|
transform: translateY(-5px); |
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); |
|
} |
|
.dosage-table { |
|
border-collapse: separate; |
|
border-spacing: 0; |
|
} |
|
.dosage-table th { |
|
position: sticky; |
|
top: 0; |
|
background-color: #3b82f6; |
|
color: white; |
|
} |
|
.search-highlight { |
|
background-color: #fef08a; |
|
} |
|
.floating-btn { |
|
animation: float 3s ease-in-out infinite; |
|
} |
|
@keyframes float { |
|
0% { transform: translateY(0px); } |
|
50% { transform: translateY(-10px); } |
|
100% { transform: translateY(0px); } |
|
} |
|
</style> |
|
</head> |
|
<body class="bg-gray-50 font-sans"> |
|
|
|
<header class="bg-gradient-to-r from-primary to-secondary text-white shadow-lg"> |
|
<div class="container mx-auto px-4 py-6"> |
|
<div class="flex flex-col md:flex-row justify-between items-center"> |
|
<div class="flex items-center mb-4 md:mb-0"> |
|
<img src="https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg" alt="Medicamentos" class="w-16 h-16 rounded-full object-cover mr-4 border-2 border-white"> |
|
<div> |
|
<h1 class="text-3xl font-bold">Guía Farmacéutica</h1> |
|
<p class="text-sm opacity-90">Información detallada sobre medicamentos</p> |
|
</div> |
|
</div> |
|
<div class="relative w-full md:w-64"> |
|
<input type="text" id="searchInput" placeholder="Buscar medicamento..." class="w-full px-4 py-2 rounded-full text-dark focus:outline-none focus:ring-2 focus:ring-accent"> |
|
<button class="absolute right-3 top-2 text-gray-500"> |
|
<i class="fas fa-search"></i> |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
</header> |
|
|
|
|
|
<section class="bg-white py-12"> |
|
<div class="container mx-auto px-4"> |
|
<div class="flex flex-col md:flex-row items-center"> |
|
<div class="md:w-1/2 mb-8 md:mb-0"> |
|
<h2 class="text-4xl font-bold text-dark mb-4">Información Farmacológica Completa</h2> |
|
<p class="text-lg text-gray-600 mb-6">Accede a datos detallados sobre nombres comerciales, principios activos, posologías recomendadas, interacciones y efectos secundarios de los medicamentos más comunes.</p> |
|
<div class="flex flex-wrap gap-3"> |
|
<button class="bg-primary hover:bg-blue-700 text-white px-6 py-2 rounded-full flex items-center"> |
|
<i class="fas fa-book-medical mr-2"></i> Ver Guía Completa |
|
</button> |
|
<button class="border border-primary text-primary hover:bg-blue-50 px-6 py-2 rounded-full flex items-center"> |
|
<i class="fas fa-file-pdf mr-2"></i> Descargar PDF |
|
</button> |
|
</div> |
|
</div> |
|
<div class="md:w-1/2 flex justify-center"> |
|
<img src="https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg" alt="Medicamentos" class="rounded-lg shadow-xl max-w-full h-auto md:max-w-md border-4 border-white"> |
|
</div> |
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<section class="bg-gray-100 py-10"> |
|
<div class="container mx-auto px-4"> |
|
<h2 class="text-3xl font-bold text-center text-dark mb-10">Categorías de Medicamentos</h2> |
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-4"> |
|
<div class="bg-white p-6 rounded-xl shadow-md text-center hover:bg-primary hover:text-white transition-all cursor-pointer"> |
|
<i class="fas fa-heartbeat text-4xl mb-3 text-accent"></i> |
|
<h3 class="font-semibold">Cardiovasculares</h3> |
|
</div> |
|
<div class="bg-white p-6 rounded-xl shadow-md text-center hover:bg-primary hover:text-white transition-all cursor-pointer"> |
|
<i class="fas fa-brain text-4xl mb-3 text-accent"></i> |
|
<h3 class="font-semibold">Neurológicos</h3> |
|
</div> |
|
<div class="bg-white p-6 rounded-xl shadow-md text-center hover:bg-primary hover:text-white transition-all cursor-pointer"> |
|
<i class="fas fa-allergies text-4xl mb-3 text-accent"></i> |
|
<h3 class="font-semibold">Antialérgicos</h3> |
|
</div> |
|
<div class="bg-white p-6 rounded-xl shadow-md text-center hover:bg-primary hover:text-white transition-all cursor-pointer"> |
|
<i class="fas fa-virus text-4xl mb-3 text-accent"></i> |
|
<h3 class="font-semibold">Antibióticos</h3> |
|
</div> |
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<section class="py-12 bg-white"> |
|
<div class="container mx-auto px-4"> |
|
<h2 class="text-3xl font-bold text-center text-dark mb-10">Medicamentos Destacados</h2> |
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8" id="medicationsContainer"> |
|
|
|
</div> |
|
|
|
<div class="text-center mt-10"> |
|
<button id="loadMoreBtn" class="bg-primary hover:bg-blue-700 text-white px-6 py-3 rounded-full font-medium"> |
|
Cargar más medicamentos <i class="fas fa-chevron-down ml-2"></i> |
|
</button> |
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<section class="py-12 bg-gray-100"> |
|
<div class="container mx-auto px-4"> |
|
<h2 class="text-3xl font-bold text-center text-dark mb-10">Guía de Posología</h2> |
|
|
|
<div class="bg-white rounded-xl shadow-md overflow-hidden"> |
|
<div class="overflow-x-auto"> |
|
<table class="dosage-table w-full"> |
|
<thead> |
|
<tr class="text-left"> |
|
<th class="px-6 py-4">Medicamento</th> |
|
<th class="px-6 py-4">Principio Activo</th> |
|
<th class="px-6 py-4">Dosis Adultos</th> |
|
<th class="px-6 py-4">Dosis Niños</th> |
|
<th class="px-6 py-4">Frecuencia</th> |
|
</tr> |
|
</thead> |
|
<tbody id="dosageTableBody"> |
|
|
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
|
|
<div class="mt-8 bg-white p-6 rounded-xl shadow-md"> |
|
<h3 class="text-xl font-semibold text-dark mb-4"><i class="fas fa-exclamation-triangle text-accent mr-2"></i> Consideraciones Importantes</h3> |
|
<ul class="list-disc pl-6 space-y-2 text-gray-700"> |
|
<li>Las dosis indicadas son generales y pueden variar según criterio médico.</li> |
|
<li>Consulte siempre con un profesional de la salud antes de iniciar cualquier tratamiento.</li> |
|
<li>No exceda las dosis recomendadas sin supervisión médica.</li> |
|
<li>Algunos medicamentos pueden requerir ajustes en pacientes con insuficiencia hepática o renal.</li> |
|
<li>Informe a su médico sobre todos los medicamentos que esté tomando para evitar interacciones.</li> |
|
</ul> |
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<section class="py-12 bg-white"> |
|
<div class="container mx-auto px-4"> |
|
<h2 class="text-3xl font-bold text-center text-dark mb-10">Recursos Adicionales</h2> |
|
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-8"> |
|
<div class="bg-gray-100 p-6 rounded-xl shadow-md hover:shadow-lg transition-shadow"> |
|
<div class="bg-primary text-white p-3 rounded-full w-12 h-12 flex items-center justify-center mb-4"> |
|
<i class="fas fa-link"></i> |
|
</div> |
|
<h3 class="text-xl font-semibold mb-3">Enlaces Oficiales</h3> |
|
<ul class="space-y-2"> |
|
<li><a href="https://www.aemps.gob.es/" class="text-primary hover:underline" target="_blank">AEMPS (España)</a></li> |
|
<li><a href="https://www.fda.gov/" class="text-primary hover:underline" target="_blank">FDA (EE.UU.)</a></li> |
|
<li><a href="https://www.who.int/" class="text-primary hover:underline" target="_blank">OMS</a></li> |
|
</ul> |
|
</div> |
|
|
|
<div class="bg-gray-100 p-6 rounded-xl shadow-md hover:shadow-lg transition-shadow"> |
|
<div class="bg-secondary text-white p-3 rounded-full w-12 h-12 flex items-center justify-center mb-4"> |
|
<i class="fas fa-book"></i> |
|
</div> |
|
<h3 class="text-xl font-semibold mb-3">Bibliografía</h3> |
|
<ul class="space-y-2"> |
|
<li>Guía Farmacológica Vademécum</li> |
|
<li>Martindale: The Complete Drug Reference</li> |
|
<li>Goodman & Gilman's Pharmacological Basis of Therapeutics</li> |
|
</ul> |
|
</div> |
|
|
|
<div class="bg-gray-100 p-6 rounded-xl shadow-md hover:shadow-lg transition-shadow"> |
|
<div class="bg-accent text-white p-3 rounded-full w-12 h-12 flex items-center justify-center mb-4"> |
|
<i class="fas fa-phone-alt"></i> |
|
</div> |
|
<h3 class="text-xl font-semibold mb-3">Contacto de Emergencia</h3> |
|
<ul class="space-y-2"> |
|
<li>Servicio de Información Toxicológica: <span class="font-semibold">915 620 420</span></li> |
|
<li>Urgencias: <span class="font-semibold">112</span></li> |
|
<li>Farmacias de Guardia: <a href="tel:098" class="text-primary hover:underline">098</a></li> |
|
</ul> |
|
</div> |
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<section class="py-12 bg-gray-100"> |
|
<div class="container mx-auto px-4"> |
|
<h2 class="text-3xl font-bold text-center text-dark mb-10">Preguntas Frecuentes</h2> |
|
|
|
<div class="max-w-3xl mx-auto space-y-4" id="faqAccordion"> |
|
|
|
</div> |
|
</div> |
|
</section> |
|
|
|
|
|
<footer class="bg-dark text-white py-10"> |
|
<div class="container mx-auto px-4"> |
|
<div class="grid grid-cols-1 md:grid-cols-4 gap-8"> |
|
<div> |
|
<h3 class="text-xl font-semibold mb-4">Guía Farmacéutica</h3> |
|
<p class="text-gray-400">Información verificada por profesionales de la salud. Actualizada en julio 2023.</p> |
|
</div> |
|
<div> |
|
<h4 class="font-semibold mb-4">Enlaces Rápidos</h4> |
|
<ul class="space-y-2"> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Inicio</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Medicamentos</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Posología</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Recursos</a></li> |
|
</ul> |
|
</div> |
|
<div> |
|
<h4 class="font-semibold mb-4">Legal</h4> |
|
<ul class="space-y-2"> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Aviso Legal</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Política de Privacidad</a></li> |
|
<li><a href="#" class="text-gray-400 hover:text-white">Cookies</a></li> |
|
</ul> |
|
</div> |
|
<div> |
|
<h4 class="font-semibold mb-4">Síguenos</h4> |
|
<div class="flex space-x-4"> |
|
<a href="#" class="bg-gray-700 hover:bg-gray-600 w-10 h-10 rounded-full flex items-center justify-center"> |
|
<i class="fab fa-facebook-f"></i> |
|
</a> |
|
<a href="#" class="bg-gray-700 hover:bg-gray-600 w-10 h-10 rounded-full flex items-center justify-center"> |
|
<i class="fab fa-twitter"></i> |
|
</a> |
|
<a href="#" class="bg-gray-700 hover:bg-gray-600 w-10 h-10 rounded-full flex items-center justify-center"> |
|
<i class="fab fa-instagram"></i> |
|
</a> |
|
<a href="#" class="bg-gray-700 hover:bg-gray-600 w-10 h-10 rounded-full flex items-center justify-center"> |
|
<i class="fab fa-linkedin-in"></i> |
|
</a> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400"> |
|
<p>© 2023 Guía Farmacéutica. Todos los derechos reservados.</p> |
|
<p class="mt-2 text-sm">La información proporcionada no sustituye el consejo médico profesional.</p> |
|
</div> |
|
</div> |
|
</footer> |
|
|
|
|
|
<div class="fixed bottom-8 right-8"> |
|
<button class="floating-btn bg-primary hover:bg-blue-700 text-white w-14 h-14 rounded-full shadow-lg flex items-center justify-center text-xl"> |
|
<i class="fas fa-question"></i> |
|
</button> |
|
</div> |
|
|
|
|
|
<script> |
|
|
|
const medications = [ |
|
{ |
|
name: "Paracetamol", |
|
brandNames: ["Termalgin", "Efferalgan", "Gelocatil", "Panadol"], |
|
activeIngredient: "Paracetamol", |
|
dosageAdults: "500-1000 mg cada 6-8 horas", |
|
dosageChildren: "10-15 mg/kg/dosis cada 6 horas", |
|
frequency: "Cada 4-6 horas (máx 4g/día)", |
|
category: "Analgésico/Antipirético", |
|
image: "https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg", |
|
description: "Analgésico y antipirético utilizado para el alivio del dolor leve a moderado y la fiebre." |
|
}, |
|
{ |
|
name: "Ibuprofeno", |
|
brandNames: ["Nurofen", "Espidifen", "Dalsy", "Algiasdin"], |
|
activeIngredient: "Ibuprofeno", |
|
dosageAdults: "400-600 mg cada 6-8 horas", |
|
dosageChildren: "5-10 mg/kg/dosis cada 6-8 horas", |
|
frequency: "Cada 6-8 horas (máx 2400mg/día)", |
|
category: "AINE/Antiinflamatorio", |
|
image: "https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg", |
|
description: "Antiinflamatorio no esteroideo (AINE) utilizado para el dolor, inflamación y fiebre." |
|
}, |
|
{ |
|
name: "Omeprazol", |
|
brandNames: ["Losec", "Prilosec", "Mepral", "Zoltar"], |
|
activeIngredient: "Omeprazol", |
|
dosageAdults: "20-40 mg/día", |
|
dosageChildren: "0.7-3.5 mg/kg/día", |
|
frequency: "Una vez al día (mañana)", |
|
category: "Inhibidor bomba protones", |
|
image: "https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg", |
|
description: "Inhibidor de la bomba de protones que reduce la producción de ácido gástrico." |
|
}, |
|
{ |
|
name: "Amoxicilina", |
|
brandNames: ["Clamoxyl", "Augmentine", "Amoxil", "Amoxicilina Normon"], |
|
activeIngredient: "Amoxicilina", |
|
dosageAdults: "250-500 mg cada 8 horas", |
|
dosageChildren: "20-50 mg/kg/día dividido cada 8 horas", |
|
frequency: "Cada 8 horas", |
|
category: "Antibiótico", |
|
image: "https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg", |
|
description: "Antibiótico betalactámico de amplio espectro para infecciones bacterianas." |
|
}, |
|
{ |
|
name: "Atorvastatina", |
|
brandNames: ["Lipitor", "Tahor", "Cardyl", "Atorvastatina Cinfa"], |
|
activeIngredient: "Atorvastatina cálcica", |
|
dosageAdults: "10-80 mg/día", |
|
dosageChildren: "No recomendado <10 años", |
|
frequency: "Una vez al día (noche)", |
|
category: "Hipolipemiante", |
|
image: "https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg", |
|
description: "Estatinas para reducir el colesterol LDL y prevenir eventos cardiovasculares." |
|
}, |
|
{ |
|
name: "Loratadina", |
|
brandNames: ["Clarityne", "Alergil", "Loratadina Cinfa", "Loratadina Stada"], |
|
activeIngredient: "Loratadina", |
|
dosageAdults: "10 mg/día", |
|
dosageChildren: "5 mg/día (2-12 años)", |
|
frequency: "Una vez al día", |
|
category: "Antihistamínico", |
|
image: "https://pbs.twimg.com/media/GpSS6oRXMAAd32g?format=jpg", |
|
description: "Antihistamínico no sedante para el tratamiento de alergias." |
|
} |
|
]; |
|
|
|
|
|
const faqs = [ |
|
{ |
|
question: "¿Cómo debo tomar los medicamentos con alimentos?", |
|
answer: "Algunos medicamentos deben tomarse con alimentos para reducir la irritación gástrica (como el ibuprofeno), mientras que otros deben tomarse en ayunas para una mejor absorción (como la levotiroxina). Consulte siempre el prospecto o consulte con su farmacéutico." |
|
}, |
|
{ |
|
question: "¿Qué hago si olvidé una dosis?", |
|
answer: "Si olvida una dosis, tómela tan pronto como lo recuerde. Sin embargo, si es casi la hora de la siguiente dosis, salte la dosis olvidada y continúe con su horario regular. No duplique las dosis para compensar la olvidada." |
|
}, |
|
{ |
|
question: "¿Puedo triturar o partir las pastillas?", |
|
answer: "No todas las pastillas pueden triturarse o partirse. Algunas tienen cubiertas especiales o son de liberación prolongada. Consulte con su farmacéutico antes de alterar la forma farmacéutica." |
|
}, |
|
{ |
|
question: "¿Qué significa 'tomar cada 8 horas'?", |
|
answer: "Significa que debe distribuir las dosis uniformemente a lo largo del día. Por ejemplo, si toma la primera dosis a las 8:00 am, las siguientes serían a las 4:00 pm y a las 12:00 am." |
|
}, |
|
{ |
|
question: "¿Cómo almacenar correctamente los medicamentos?", |
|
answer: "La mayoría de medicamentos deben almacenarse en un lugar fresco y seco, lejos de la luz directa y la humedad. Algunos requieren refrigeración. Verifique siempre las instrucciones de almacenamiento en el envase." |
|
} |
|
]; |
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
renderMedicationCards(); |
|
|
|
|
|
renderDosageTable(); |
|
|
|
|
|
renderFAQAccordion(); |
|
|
|
|
|
setupSearch(); |
|
|
|
|
|
document.getElementById('loadMoreBtn').addEventListener('click', loadMoreMedications); |
|
}); |
|
|
|
|
|
function renderMedicationCards(limit = 3) { |
|
const container = document.getElementById('medicationsContainer'); |
|
container.innerHTML = ''; |
|
|
|
medications.slice(0, limit).forEach(med => { |
|
const card = document.createElement('div'); |
|
card.className = 'bg-white rounded-xl shadow-md overflow-hidden med-card transition-all duration-300'; |
|
card.innerHTML = ` |
|
<img src="${med.image}" alt="${med.name}" class="w-full h-48 object-cover"> |
|
<div class="p-6"> |
|
<div class="flex justify-between items-start mb-2"> |
|
<h3 class="text-xl font-bold text-dark">${med.name}</h3> |
|
<span class="bg-blue-100 text-primary text-xs px-2 py-1 rounded-full">${med.category}</span> |
|
</div> |
|
<p class="text-gray-600 mb-4">${med.description}</p> |
|
|
|
<div class="mb-4"> |
|
<h4 class="font-semibold text-dark mb-1">Marcas comerciales:</h4> |
|
<div class="flex flex-wrap gap-2"> |
|
${med.brandNames.map(brand => `<span class="bg-gray-100 text-dark text-sm px-2 py-1 rounded">${brand}</span>`).join('')} |
|
</div> |
|
</div> |
|
|
|
<div class="grid grid-cols-2 gap-2 mb-4"> |
|
<div> |
|
<h4 class="font-semibold text-sm text-dark">Dosis adultos:</h4> |
|
<p class="text-sm">${med.dosageAdults}</p> |
|
</div> |
|
<div> |
|
<h4 class="font-semibold text-sm text-dark">Dosis niños:</h4> |
|
<p class="text-sm">${med.dosageChildren}</p> |
|
</div> |
|
</div> |
|
|
|
<button class="w-full bg-primary hover:bg-blue-700 text-white py-2 rounded-lg flex items-center justify-center"> |
|
<i class="fas fa-info-circle mr-2"></i> Ver detalles completos |
|
</button> |
|
</div> |
|
`; |
|
container.appendChild(card); |
|
}); |
|
} |
|
|
|
|
|
function renderDosageTable() { |
|
const tbody = document.getElementById('dosageTableBody'); |
|
tbody.innerHTML = ''; |
|
|
|
medications.forEach(med => { |
|
const row = document.createElement('tr'); |
|
row.className = 'hover:bg-gray-50 border-b border-gray-200'; |
|
row.innerHTML = ` |
|
<td class="px-6 py-4 font-medium">${med.name}</td> |
|
<td class="px-6 py-4">${med.activeIngredient}</td> |
|
<td class="px-6 py-4">${med.dosageAdults}</td> |
|
<td class="px-6 py-4">${med.dosageChildren}</td> |
|
<td class="px-6 py-4">${med.frequency}</td> |
|
`; |
|
tbody.appendChild(row); |
|
}); |
|
} |
|
|
|
|
|
function renderFAQAccordion() { |
|
const container = document.getElementById('faqAccordion'); |
|
container.innerHTML = ''; |
|
|
|
faqs.forEach((faq, index) => { |
|
const item = document.createElement('div'); |
|
item.className = 'bg-white rounded-lg shadow-md overflow-hidden'; |
|
item.innerHTML = ` |
|
<button class="w-full text-left px-6 py-4 flex justify-between items-center focus:outline-none" onclick="toggleFAQ(${index})"> |
|
<span class="font-semibold text-dark">${faq.question}</span> |
|
<i class="fas fa-chevron-down transition-transform duration-300" id="faqIcon${index}"></i> |
|
</button> |
|
<div class="px-6 pb-0 max-h-0 overflow-hidden transition-all duration-300" id="faqAnswer${index}"> |
|
<div class="pb-4 text-gray-700">${faq.answer}</div> |
|
</div> |
|
`; |
|
container.appendChild(item); |
|
}); |
|
} |
|
|
|
|
|
window.toggleFAQ = function(index) { |
|
const answer = document.getElementById(`faqAnswer${index}`); |
|
const icon = document.getElementById(`faqIcon${index}`); |
|
|
|
if (answer.classList.contains('max-h-0')) { |
|
answer.classList.remove('max-h-0'); |
|
answer.classList.add('max-h-96', 'pb-4'); |
|
icon.classList.remove('fa-chevron-down'); |
|
icon.classList.add('fa-chevron-up'); |
|
} else { |
|
answer.classList.add('max-h-0'); |
|
answer.classList.remove('max-h-96', 'pb-4'); |
|
icon.classList.add('fa-chevron-down'); |
|
icon.classList.remove('fa-chevron-up'); |
|
} |
|
}; |
|
|
|
|
|
function setupSearch() { |
|
const searchInput = document.getElementById('searchInput'); |
|
|
|
searchInput.addEventListener('input', function() { |
|
const searchTerm = this.value.toLowerCase(); |
|
|
|
if (searchTerm.length > 2) { |
|
|
|
document.querySelectorAll('#medicationsContainer .med-card h3').forEach(title => { |
|
const text = title.textContent; |
|
const highlighted = text.replace(new RegExp(searchTerm, 'gi'), match => |
|
`<span class="search-highlight">${match}</span>` |
|
); |
|
title.innerHTML = highlighted; |
|
}); |
|
|
|
|
|
document.querySelectorAll('#dosageTableBody tr').forEach(row => { |
|
const cells = row.querySelectorAll('td'); |
|
let found = false; |
|
|
|
cells.forEach(cell => { |
|
const text = cell.textContent; |
|
if (text.toLowerCase().includes(searchTerm)) { |
|
found = true; |
|
const highlighted = text.replace(new RegExp(searchTerm, 'gi'), match => |
|
`<span class="search-highlight">${match}</span>` |
|
); |
|
cell.innerHTML = highlighted; |
|
} |
|
}); |
|
|
|
|
|
row.style.display = found ? '' : 'none'; |
|
}); |
|
} else { |
|
|
|
document.querySelectorAll('.search-highlight').forEach(el => { |
|
const parent = el.parentNode; |
|
parent.textContent = parent.textContent; |
|
}); |
|
|
|
|
|
document.querySelectorAll('#dosageTableBody tr').forEach(row => { |
|
row.style.display = ''; |
|
}); |
|
} |
|
}); |
|
} |
|
|
|
|
|
function loadMoreMedications() { |
|
const currentCount = document.querySelectorAll('#medicationsContainer .med-card').length; |
|
renderMedicationCards(currentCount + 3); |
|
|
|
|
|
if (currentCount + 3 >= medications.length) { |
|
document.getElementById('loadMoreBtn').style.display = 'none'; |
|
} |
|
} |
|
</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=Merlintxu/farma" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
|
</html> |