Spaces:
Running
Running
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Test de Sistema Nervioso Autónomo</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> | |
.fade-in { | |
animation: fadeIn 0.5s ease-in-out; | |
} | |
@keyframes fadeIn { | |
from { opacity: 0; transform: translateY(10px); } | |
to { opacity: 1; transform: translateY(0); } | |
} | |
.pulse { | |
animation: pulse 2s infinite; | |
} | |
@keyframes pulse { | |
0% { transform: scale(1); } | |
50% { transform: scale(1.05); } | |
100% { transform: scale(1); } | |
} | |
.progress-bar { | |
transition: width 0.5s ease-in-out; | |
} | |
</style> | |
</head> | |
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen font-sans"> | |
<div class="container mx-auto px-4 py-12 max-w-3xl"> | |
<!-- Header --> | |
<header class="text-center mb-12 fade-in"> | |
<div class="bg-white rounded-full p-4 shadow-lg inline-block mb-6"> | |
<i class="fas fa-brain text-4xl text-indigo-600"></i> | |
</div> | |
<h1 class="text-3xl md:text-4xl font-bold text-gray-800 mb-2">Test de Sistema Nervioso Autónomo</h1> | |
<p class="text-gray-600 max-w-lg mx-auto">Descubre si tu sistema nervioso tiene tendencia simpática o parasimpática respondiendo estas 5 preguntas</p> | |
</header> | |
<!-- Progress Bar --> | |
<div class="bg-white rounded-full h-4 mb-8 shadow-inner overflow-hidden fade-in"> | |
<div id="progress" class="progress-bar h-full bg-gradient-to-r from-indigo-400 to-purple-500 rounded-full" style="width: 0%"></div> | |
</div> | |
<!-- Test Container --> | |
<div id="test-container" class="bg-white rounded-xl shadow-lg overflow-hidden fade-in"> | |
<!-- Question Screen --> | |
<div id="question-screen"> | |
<div class="p-6 md:p-8"> | |
<h2 id="question-number" class="text-sm font-semibold text-indigo-600 mb-1">Pregunta 1 de 5</h2> | |
<h3 id="question-text" class="text-xl md:text-2xl font-bold text-gray-800 mb-6"></h3> | |
<div class="space-y-4 mb-8"> | |
<button onclick="answerQuestion(true)" class="answer-btn w-full py-4 px-6 rounded-lg bg-gradient-to-r from-red-500 to-pink-500 text-white font-semibold text-lg shadow-md hover:shadow-lg transform hover:-translate-y-1 transition-all duration-200 flex items-center justify-center"> | |
<i class="fas fa-check-circle mr-3"></i> Sí | |
</button> | |
<button onclick="answerQuestion(false)" class="answer-btn w-full py-4 px-6 rounded-lg bg-gradient-to-r from-green-500 to-teal-500 text-white font-semibold text-lg shadow-md hover:shadow-lg transform hover:-translate-y-1 transition-all duration-200 flex items-center justify-center"> | |
<i class="fas fa-times-circle mr-3"></i> No | |
</button> | |
</div> | |
<p id="question-note" class="text-sm text-gray-500 italic"></p> | |
</div> | |
</div> | |
<!-- Results Screen (Hidden Initially) --> | |
<div id="results-screen" class="hidden p-6 md:p-8 text-center"> | |
<div id="sympathetic-result" class="hidden"> | |
<div class="bg-red-50 border border-red-200 rounded-xl p-6 mb-6"> | |
<div class="w-20 h-20 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4"> | |
<i class="fas fa-bolt text-red-500 text-3xl"></i> | |
</div> | |
<h2 class="text-2xl font-bold text-red-600 mb-2">Predominio Simpático</h2> | |
<p class="text-gray-700 mb-4">Tu sistema nervioso autónomo muestra tendencia hacia el sistema simpático.</p> | |
<div class="bg-white p-4 rounded-lg border border-red-100 text-left"> | |
<h3 class="font-semibold text-red-500 mb-2">Características:</h3> | |
<ul class="list-disc list-inside text-sm text-gray-600 space-y-1"> | |
<li>Mayor actividad de "lucha o huida"</li> | |
<li>Posible dificultad en la digestión de ciertos alimentos</li> | |
<li>Mayor sensibilidad a interrupciones del sueño</li> | |
<li>Metabolismo más acelerado</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<div id="parasympathetic-result" class="hidden"> | |
<div class="bg-green-50 border border-green-200 rounded-xl p-6 mb-6"> | |
<div class="w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4"> | |
<i class="fas fa-leaf text-green-500 text-3xl"></i> | |
</div> | |
<h2 class="text-2xl font-bold text-green-600 mb-2">Predominio Parasimpático</h2> | |
<p class="text-gray-700 mb-4">Tu sistema nervioso autónomo muestra tendencia hacia el sistema parasimpático.</p> | |
<div class="bg-white p-4 rounded-lg border border-green-100 text-left"> | |
<h3 class="font-semibold text-green-500 mb-2">Características:</h3> | |
<ul class="list-disc list-inside text-sm text-gray-600 space-y-1"> | |
<li>Mayor actividad de "descanso y digestión"</li> | |
<li>Buena tolerancia digestiva</li> | |
<li>Sueño menos interrumpido</li> | |
<li>Metabolismo más equilibrado</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<button onclick="restartTest()" class="mt-6 py-3 px-6 bg-indigo-600 text-white font-semibold rounded-lg shadow-md hover:bg-indigo-700 transition-colors duration-200 inline-flex items-center"> | |
<i class="fas fa-redo mr-2"></i> Realizar otro test | |
</button> | |
</div> | |
</div> | |
<!-- Info Section --> | |
<div class="mt-12 bg-white bg-opacity-70 backdrop-blur-sm rounded-xl p-6 shadow-sm fade-in"> | |
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center"> | |
<i class="fas fa-info-circle text-indigo-500 mr-2"></i> Sobre el sistema nervioso autónomo | |
</h2> | |
<div class="grid md:grid-cols-2 gap-6"> | |
<div class="bg-indigo-50 p-4 rounded-lg border border-indigo-100"> | |
<h3 class="font-semibold text-indigo-700 mb-2 flex items-center"> | |
<i class="fas fa-bolt text-indigo-500 mr-2"></i> Sistema Simpático | |
</h3> | |
<p class="text-sm text-gray-600">Se activa en situaciones de estrés o alerta, preparando el cuerpo para la acción (respuesta de "lucha o huida"). Aumenta el ritmo cardíaco, dilata las pupilas y reduce la digestión.</p> | |
</div> | |
<div class="bg-green-50 p-4 rounded-lg border border-green-100"> | |
<h3 class="font-semibold text-green-700 mb-2 flex items-center"> | |
<i class="fas fa-leaf text-green-500 mr-2"></i> Sistema Parasimpático | |
</h3> | |
<p class="text-sm text-gray-600">Promueve la relajación y procesos de recuperación ("descanso y digestión"). Disminuye el ritmo cardíaco, contrae las pupilas y estimula la digestión y el sueño.</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script> | |
// Questions data | |
const questions = [ | |
{ | |
text: "Cuando comes carne roja (vaca/res, cerdo o cordero, conejo, cabrito) ¿No digiere bien o tarda en digerirla? ¿Te caen mal de vez en cuando?", | |
note: "(Tu respuesta por el 'Sí' puede ser eventual o que siempre te suceda)" | |
}, | |
{ | |
text: "Cuando comes tarde de noche, antes de dormir… ¿Tienes dificultad para digerir?", | |
note: "(Tu respuesta por el 'Sí' puede ser eventual o que siempre te suceda)" | |
}, | |
{ | |
text: "Si comes cosas grasosas: manteca/mantequilla, pasta de maní, quesos amarillos, carnes grasosas o aceites o alimentos fritos. ¿Te caen pesadas?", | |
note: "(Tu respuesta por el 'Sí' puede ser eventual o que siempre te suceda)" | |
}, | |
{ | |
text: "Si comes tarde, en la noche, antes de irte a dormir. ¿Eso te impide un buen sueño y descanso?", | |
note: "(Tu respuesta por el 'Sí' puede ser eventual o que siempre te suceda)" | |
}, | |
{ | |
text: "Durante tu dormir, tu sueño (NO EL SOÑAR). ¿Te despiertas por cualquier suceso propio o ajeno, interior o exterior a vos, como ruidos?", | |
note: "(Tu respuesta por el 'Sí' puede ser eventual o que siempre te suceda)" | |
} | |
]; | |
// Test state | |
let currentQuestion = 0; | |
let answers = []; | |
// DOM elements | |
const questionText = document.getElementById('question-text'); | |
const questionNote = document.getElementById('question-note'); | |
const questionNumber = document.getElementById('question-number'); | |
const progressBar = document.getElementById('progress'); | |
const questionScreen = document.getElementById('question-screen'); | |
const resultsScreen = document.getElementById('results-screen'); | |
const sympatheticResult = document.getElementById('sympathetic-result'); | |
const parasympatheticResult = document.getElementById('parasympathetic-result'); | |
// Initialize the test | |
function initTest() { | |
currentQuestion = 0; | |
answers = []; | |
updateQuestion(); | |
questionScreen.classList.remove('hidden'); | |
resultsScreen.classList.add('hidden'); | |
} | |
// Update the current question display | |
function updateQuestion() { | |
if (currentQuestion < questions.length) { | |
questionText.textContent = questions[currentQuestion].text; | |
questionNote.textContent = questions[currentQuestion].note; | |
questionNumber.textContent = `Pregunta ${currentQuestion + 1} de ${questions.length}`; | |
progressBar.style.width = `${(currentQuestion / questions.length) * 100}%`; | |
} else { | |
showResults(); | |
} | |
} | |
// Handle answer selection | |
function answerQuestion(answer) { | |
answers.push(answer); | |
currentQuestion++; | |
// Add animation to buttons | |
const buttons = document.querySelectorAll('.answer-btn'); | |
buttons.forEach(btn => { | |
btn.classList.add('opacity-50', 'cursor-not-allowed'); | |
setTimeout(() => { | |
btn.classList.remove('opacity-50', 'cursor-not-allowed'); | |
}, 500); | |
}); | |
setTimeout(() => { | |
updateQuestion(); | |
}, 300); | |
} | |
// Show test results | |
function showResults() { | |
// Calculate result (if any 'true' answer, sympathetic; else parasympathetic) | |
const hasSympatheticTendency = answers.includes(true); | |
questionScreen.classList.add('hidden'); | |
resultsScreen.classList.remove('hidden'); | |
if (hasSympatheticTendency) { | |
sympatheticResult.classList.remove('hidden'); | |
sympatheticResult.classList.add('pulse'); | |
} else { | |
parasympatheticResult.classList.remove('hidden'); | |
parasympatheticResult.classList.add('pulse'); | |
} | |
// Complete progress bar | |
progressBar.style.width = '100%'; | |
} | |
// Restart the test | |
function restartTest() { | |
sympatheticResult.classList.add('hidden'); | |
parasympatheticResult.classList.add('hidden'); | |
sympatheticResult.classList.remove('pulse'); | |
parasympatheticResult.classList.remove('pulse'); | |
initTest(); | |
} | |
// Start the test when page loads | |
window.onload = initTest; | |
</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=luisgiam/c-digo-biol-gico-sna" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
</html> |