las respuestas separadas de las preguntas
Browse files- index.html +63 -25
index.html
CHANGED
|
@@ -79,21 +79,63 @@
|
|
| 79 |
<script>
|
| 80 |
feather.replace();
|
| 81 |
const questions = [
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
let remainingQuestions = [...questions];
|
| 98 |
let currentQuestion = null;
|
| 99 |
let isSpinning = false;
|
|
@@ -106,15 +148,14 @@ let remainingQuestions = [...questions];
|
|
| 106 |
'bg-orange-500', 'bg-amber-500', 'bg-lime-500', 'bg-cyan-500',
|
| 107 |
'bg-violet-500', 'bg-fuchsia-500', 'bg-rose-500'
|
| 108 |
];
|
| 109 |
-
|
| 110 |
-
questions.forEach((_, index) => {
|
| 111 |
const segment = document.createElement('div');
|
| 112 |
segment.className = `absolute w-1/2 h-1/2 origin-bottom-right ${colors[index]} flex items-start justify-center`;
|
| 113 |
segment.style.transform = `rotate(${(360 / questions.length) * index}deg)`;
|
| 114 |
segment.style.clipPath = 'polygon(0 0, 60% 0, 100% 100%, 0 60%)';
|
| 115 |
const questionText = document.createElement('span');
|
| 116 |
questionText.className = 'text-white text-sm font-bold transform rotate-45 origin-left ml-16 mt-6';
|
| 117 |
-
questionText.textContent =
|
| 118 |
segment.appendChild(questionText);
|
| 119 |
|
| 120 |
wheel.appendChild(segment);
|
|
@@ -131,16 +172,13 @@ segment.appendChild(questionText);
|
|
| 131 |
feather.replace();
|
| 132 |
|
| 133 |
// Random stop position
|
| 134 |
-
|
| 135 |
const stopRotation = Math.floor(Math.random() * 360);
|
| 136 |
const selectedSegment = Math.floor(stopRotation / segmentAngle);
|
| 137 |
|
| 138 |
// Ensure we don't repeat questions
|
| 139 |
let adjustedIndex = selectedSegment % remainingQuestions.length;
|
| 140 |
-
currentQuestion =
|
| 141 |
-
question: remainingQuestions[adjustedIndex],
|
| 142 |
-
answer: remainingQuestions[adjustedIndex].split(' (')[0]
|
| 143 |
-
};
|
| 144 |
remainingQuestions.splice(adjustedIndex, 1);
|
| 145 |
// Spin animation
|
| 146 |
wheel.style.setProperty('--stop-rotation', `${stopRotation}deg`);
|
|
@@ -167,8 +205,8 @@ document.getElementById('answer-btn').classList.remove('hidden');
|
|
| 167 |
});
|
| 168 |
// Show answer
|
| 169 |
document.getElementById('answer-btn').addEventListener('click', () => {
|
| 170 |
-
document.getElementById('answer-text').textContent = currentQuestion.answer;
|
| 171 |
-
|
| 172 |
document.getElementById('answer-btn').classList.add('hidden');
|
| 173 |
});
|
| 174 |
|
|
|
|
| 79 |
<script>
|
| 80 |
feather.replace();
|
| 81 |
const questions = [
|
| 82 |
+
{
|
| 83 |
+
question: "¿Qué es un exoplaneta?",
|
| 84 |
+
answer: "Es un planeta que orbita un planeta distinta al sol"
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
question: "¿Cómo podemos identificar un exoplaneta?",
|
| 88 |
+
answer: "Midiendo disminución del brillo de una estrella cuando un exoplaneta orbita frente a ella"
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
question: "¿Qué características tiene el exoplaneta Kepler-442b?",
|
| 92 |
+
answer: "Es una supertierra más fría y menos luminosa"
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
question: "¿Cuál es el ambiente del exoplaneta Kepler-442b?",
|
| 96 |
+
answer: "Su ambiente es rocoso con probabilidad de presencia de agua"
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
question: "¿En qué década fueron descubiertos los primeros exoplanetas?",
|
| 100 |
+
answer: "En la década de 1990's"
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
question: "¿Por qué se le llaman supertierras a los exoplanetas?",
|
| 104 |
+
answer: "Porque aunque se parecen al Tierra, suelen ser mas grandes"
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
question: "¿En qué constelación está el exoplaneta Kepler-442b?",
|
| 108 |
+
answer: "En la constelación de Lyra"
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
question: "¿Qué características tiene la nave Starship 4.0?",
|
| 112 |
+
answer: "Tiene una longitud de 50m, más de 120t y 6 motores Raptor, entre otras características"
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
question: "¿Cuáles son los nombres de los personajes en el cortometraje?",
|
| 116 |
+
answer: "El astronauta se llama Steve y lo acompaña Lepton, un robot humanoide"
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
question: "¿Consideras que es importante la exploración espacial?",
|
| 120 |
+
answer: ""
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
question: "¿Te gustaría vivir en un exoplaneta? ¿Por qué?",
|
| 124 |
+
answer: ""
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
question: "¿Por qué se dice que el exoplaneta Kepler-442b se parece a la tierra?",
|
| 128 |
+
answer: "Por las condiciones atmosféricas y físicas que permiten la adaptación humana con algunas ayudas tecnológicas"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
question: "¿Consideras que el cortometraje te ayudo a aprender sobre los exoplanetas?",
|
| 132 |
+
answer: ""
|
| 133 |
+
},
|
| 134 |
+
{
|
| 135 |
+
question: "¿Qué cosas consideras que debe tener el exoplaneta Kepler-442b si queremos vivir allá?",
|
| 136 |
+
answer: ""
|
| 137 |
+
}
|
| 138 |
+
];
|
| 139 |
let remainingQuestions = [...questions];
|
| 140 |
let currentQuestion = null;
|
| 141 |
let isSpinning = false;
|
|
|
|
| 148 |
'bg-orange-500', 'bg-amber-500', 'bg-lime-500', 'bg-cyan-500',
|
| 149 |
'bg-violet-500', 'bg-fuchsia-500', 'bg-rose-500'
|
| 150 |
];
|
| 151 |
+
questions.forEach((q, index) => {
|
|
|
|
| 152 |
const segment = document.createElement('div');
|
| 153 |
segment.className = `absolute w-1/2 h-1/2 origin-bottom-right ${colors[index]} flex items-start justify-center`;
|
| 154 |
segment.style.transform = `rotate(${(360 / questions.length) * index}deg)`;
|
| 155 |
segment.style.clipPath = 'polygon(0 0, 60% 0, 100% 100%, 0 60%)';
|
| 156 |
const questionText = document.createElement('span');
|
| 157 |
questionText.className = 'text-white text-sm font-bold transform rotate-45 origin-left ml-16 mt-6';
|
| 158 |
+
questionText.textContent = q.question;
|
| 159 |
segment.appendChild(questionText);
|
| 160 |
|
| 161 |
wheel.appendChild(segment);
|
|
|
|
| 172 |
feather.replace();
|
| 173 |
|
| 174 |
// Random stop position
|
| 175 |
+
const segmentAngle = 360 / questions.length;
|
| 176 |
const stopRotation = Math.floor(Math.random() * 360);
|
| 177 |
const selectedSegment = Math.floor(stopRotation / segmentAngle);
|
| 178 |
|
| 179 |
// Ensure we don't repeat questions
|
| 180 |
let adjustedIndex = selectedSegment % remainingQuestions.length;
|
| 181 |
+
currentQuestion = remainingQuestions[adjustedIndex];
|
|
|
|
|
|
|
|
|
|
| 182 |
remainingQuestions.splice(adjustedIndex, 1);
|
| 183 |
// Spin animation
|
| 184 |
wheel.style.setProperty('--stop-rotation', `${stopRotation}deg`);
|
|
|
|
| 205 |
});
|
| 206 |
// Show answer
|
| 207 |
document.getElementById('answer-btn').addEventListener('click', () => {
|
| 208 |
+
document.getElementById('answer-text').textContent = currentQuestion.answer || "Esta pregunta no tiene una respuesta definida. ¡Piensa en tu propia respuesta!";
|
| 209 |
+
document.getElementById('answer-display').classList.remove('hidden');
|
| 210 |
document.getElementById('answer-btn').classList.add('hidden');
|
| 211 |
});
|
| 212 |
|