JarleyPro commited on
Commit
590f831
·
verified ·
1 Parent(s): a05d169

que las preguntas este directamente en la ruleta

Browse files
Files changed (2) hide show
  1. README.md +9 -5
  2. index.html +175 -18
README.md CHANGED
@@ -1,10 +1,14 @@
1
  ---
2
- title: Undefined
3
- emoji: 😻
4
- colorFrom: pink
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
+ title: undefined
3
+ colorFrom: purple
4
+ colorTo: red
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
14
+
index.html CHANGED
@@ -1,19 +1,176 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="es">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Spin & Win Trivia Roulette</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <style>
11
+ @keyframes spin {
12
+ 0% { transform: rotate(0deg); }
13
+ 100% { transform: rotate(calc(360deg * 5 + var(--stop-rotation))); }
14
+ }
15
+ .wheel {
16
+ transition-timing-function: cubic-bezier(0.1, 0.7, 0.1, 1);
17
+ }
18
+ .question-card {
19
+ transform: scale(0.95);
20
+ transition: all 0.3s ease;
21
+ }
22
+ .question-card:hover {
23
+ transform: scale(1);
24
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
25
+ }
26
+ </style>
27
+ </head>
28
+ <body class="bg-gradient-to-br from-purple-900 to-indigo-800 min-h-screen text-white">
29
+ <div class="container mx-auto px-4 py-10">
30
+ <header class="text-center mb-12">
31
+ <h1 class="text-4xl md:text-6xl font-bold mb-3 tracking-tight">🎡 Spin & Win Trivia</h1>
32
+ <p class="text-xl text-purple-200">Gira la ruleta y responde 15 preguntas divertidas</p>
33
+ </header>
34
+
35
+ <div class="flex flex-col lg:flex-row items-center justify-center gap-12">
36
+ <!-- Wheel Container -->
37
+ <div class="relative w-64 h-64 md:w-80 md:h-80 lg:w-96 lg:h-96">
38
+ <div id="wheel" class="wheel w-full h-full rounded-full border-8 border-yellow-400 bg-white relative overflow-hidden transition-transform duration-5000">
39
+ <!-- Wheel segments will be added by JS -->
40
+ </div>
41
+ <div class="absolute top-0 left-1/2 -translate-x-1/2 -mt-4">
42
+ <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-yellow-400">
43
+ <path d="M12 2L12 22M12 2L22 12M12 2L2 12"></path>
44
+ </svg>
45
+ </div>
46
+ <button id="spin-btn" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-yellow-400 hover:bg-yellow-300 text-purple-900 font-bold w-16 h-16 rounded-full flex items-center justify-center transition-all shadow-lg hover:shadow-xl focus:outline-none focus:ring-2 focus:ring-yellow-200">
47
+ <i data-feather="rotate-cw"></i>
48
+ </button>
49
+ </div>
50
+
51
+ <!-- Question Display -->
52
+ <div class="w-full lg:w-1/2 max-w-2xl">
53
+ <div id="question-display" class="bg-white bg-opacity-10 backdrop-filter backdrop-blur-lg rounded-xl p-6 shadow-xl min-h-64 flex flex-col justify-center">
54
+ <p id="current-question" class="text-center text-2xl font-medium mb-6 text-purple-100">Presiona el botón para girar la ruleta y obtener una pregunta</p>
55
+ <button id="answer-btn" class="hidden mt-4 bg-purple-600 hover:bg-purple-500 text-white font-bold py-3 px-6 rounded-lg transition-all self-center">Mostrar Respuesta</button>
56
+ <p id="answer-text" class="hidden mt-4 text-center text-lg bg-purple-900 bg-opacity-50 rounded-lg p-4"></p>
57
+ </div>
58
+
59
+ <div class="mt-8 grid grid-cols-1 md:grid-cols-2 gap-4">
60
+ <div class="bg-indigo-700 bg-opacity-50 rounded-lg p-4 text-center">
61
+ <p class="text-sm text-purple-200">Preguntas Restantes</p>
62
+ <p id="questions-left" class="text-3xl font-bold">15</p>
63
+ </div>
64
+ <div class="bg-indigo-700 bg-opacity-50 rounded-lg p-4 text-center">
65
+ <p class="text-sm text-purple-200">Preguntas Contestadas</p>
66
+ <p id="questions-answered" class="text-3xl font-bold">0</p>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+
73
+ <script>
74
+ feather.replace();
75
+ const questions = [
76
+ "Elefante (No salta)",
77
+ "Fresa (Semillas fuera)",
78
+ "Rusia (País grande)",
79
+ "Marte (Planeta rojo)",
80
+ "Estribo (Hueso pequeño)",
81
+ "Oro (Símbolo Au)",
82
+ "1969 (Llegada Luna)",
83
+ "Guepardo (Más rápido)",
84
+ "Van Gogh (Oreja cortada)",
85
+ "Pacífico (Océano grande)",
86
+ "Italia (Forma bota)",
87
+ "Canberra (Capital Australia)",
88
+ "Tenis (Wimbledon)",
89
+ "Nilo (Río largo)",
90
+ "Piano (Teclas)"
91
+ ];
92
+ let remainingQuestions = [...questions];
93
+ let currentQuestion = null;
94
+ let isSpinning = false;
95
+
96
+ // Create wheel segments
97
+ const wheel = document.getElementById('wheel');
98
+ const colors = [
99
+ 'bg-red-500', 'bg-blue-500', 'bg-green-500', 'bg-yellow-500',
100
+ 'bg-purple-500', 'bg-pink-500', 'bg-indigo-500', 'bg-teal-500',
101
+ 'bg-orange-500', 'bg-amber-500', 'bg-lime-500', 'bg-cyan-500',
102
+ 'bg-violet-500', 'bg-fuchsia-500', 'bg-rose-500'
103
+ ];
104
+
105
+ questions.forEach((_, index) => {
106
+ const segment = document.createElement('div');
107
+ segment.className = `absolute w-1/2 h-1/2 origin-bottom-right ${colors[index]} flex items-start justify-center`;
108
+ segment.style.transform = `rotate(${(360 / questions.length) * index}deg)`;
109
+ segment.style.clipPath = 'polygon(0 0, 60% 0, 100% 100%, 0 60%)';
110
+
111
+ const questionText = document.createElement('span');
112
+ questionText.className = 'text-white text-xs font-bold transform rotate-45 origin-left ml-12 mt-4';
113
+ questionText.textContent = questions[index];
114
+ segment.appendChild(questionText);
115
+
116
+ wheel.appendChild(segment);
117
+ });
118
+
119
+ // Spin the wheel
120
+ document.getElementById('spin-btn').addEventListener('click', () => {
121
+ if (isSpinning || remainingQuestions.length === 0) return;
122
+
123
+ isSpinning = true;
124
+ const spinBtn = document.getElementById('spin-btn');
125
+ spinBtn.disabled = true;
126
+ spinBtn.innerHTML = '<i data-feather="loader" class="animate-spin"></i>';
127
+ feather.replace();
128
+
129
+ // Random stop position
130
+ const segmentAngle = 360 / questions.length;
131
+ const stopRotation = Math.floor(Math.random() * 360);
132
+ const selectedSegment = Math.floor(stopRotation / segmentAngle);
133
+
134
+ // Ensure we don't repeat questions
135
+ let adjustedIndex = selectedSegment % remainingQuestions.length;
136
+ currentQuestion = {
137
+ question: remainingQuestions[adjustedIndex],
138
+ answer: remainingQuestions[adjustedIndex].split(' (')[0]
139
+ };
140
+ remainingQuestions.splice(adjustedIndex, 1);
141
+ // Spin animation
142
+ wheel.style.setProperty('--stop-rotation', `${stopRotation}deg`);
143
+ wheel.style.animation = 'spin 5s forwards';
144
+
145
+ setTimeout(() => {
146
+ wheel.style.animation = 'none';
147
+ wheel.style.transform = `rotate(${stopRotation}deg)`;
148
+
149
+ // Show question
150
+ document.getElementById('current-question').textContent = `Pregunta: ${currentQuestion.question}`;
151
+ document.getElementById('answer-btn').classList.remove('hidden');
152
+ document.getElementById('answer-text').classList.add('hidden');
153
+
154
+ // Update counters
155
+ document.getElementById('questions-left').textContent = remainingQuestions.length;
156
+ document.getElementById('questions-answered').textContent = questions.length - remainingQuestions.length;
157
+
158
+ isSpinning = false;
159
+ spinBtn.disabled = false;
160
+ spinBtn.innerHTML = '<i data-feather="rotate-cw"></i>';
161
+ feather.replace();
162
+ }, 5000);
163
+ });
164
+
165
+ // Show answer
166
+ document.getElementById('answer-btn').addEventListener('click', () => {
167
+ document.getElementById('answer-text').textContent = currentQuestion.answer;
168
+ document.getElementById('answer-text').classList.remove('hidden');
169
+ document.getElementById('answer-btn').classList.add('hidden');
170
+ });
171
+
172
+ // Reset wheel position on load
173
+ wheel.style.transform = 'rotate(0deg)';
174
+ </script>
175
+ </body>
176
  </html>