File size: 13,724 Bytes
c8ad054
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<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></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>