Leandroprofessor commited on
Commit
0d416bb
·
verified ·
1 Parent(s): 21303b9

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +689 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Teste De Programa O
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: teste-de-programa-o
3
+ emoji: 🐳
4
+ colorFrom: blue
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,689 @@
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="pt-BR">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Quiz Interativo - 50 Perguntas</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .progress-bar {
11
+ transition: width 0.5s ease-in-out;
12
+ }
13
+ .question-card {
14
+ transform: translateX(0);
15
+ transition: transform 0.5s ease-in-out;
16
+ }
17
+ .question-card.hidden {
18
+ transform: translateX(-100%);
19
+ opacity: 0;
20
+ position: absolute;
21
+ }
22
+ .option:hover {
23
+ transform: translateY(-2px);
24
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
25
+ }
26
+ .option.selected {
27
+ background-color: #3b82f6;
28
+ color: white;
29
+ border-color: #3b82f6;
30
+ }
31
+ .option.correct {
32
+ background-color: #10b981;
33
+ color: white;
34
+ border-color: #10b981;
35
+ }
36
+ .option.incorrect {
37
+ background-color: #ef4444;
38
+ color: white;
39
+ border-color: #ef4444;
40
+ }
41
+ .confetti {
42
+ position: fixed;
43
+ width: 10px;
44
+ height: 10px;
45
+ background-color: #f00;
46
+ border-radius: 50%;
47
+ animation: fall 5s linear forwards;
48
+ }
49
+ @keyframes fall {
50
+ to {
51
+ transform: translateY(100vh) rotate(360deg);
52
+ opacity: 0;
53
+ }
54
+ }
55
+ </style>
56
+ </head>
57
+ <body class="bg-gray-100 min-h-screen font-sans">
58
+ <div class="container mx-auto px-4 py-8 max-w-4xl">
59
+ <!-- Header -->
60
+ <header class="text-center mb-8">
61
+ <h1 class="text-4xl font-bold text-indigo-700 mb-2">Quiz Interativo</h1>
62
+ <p class="text-gray-600">Teste seus conhecimentos com 50 perguntas desafiadoras!</p>
63
+ </header>
64
+
65
+ <!-- Start Screen -->
66
+ <div id="start-screen" class="bg-white rounded-xl shadow-lg p-8 text-center">
67
+ <div class="mb-6">
68
+ <i class="fas fa-brain text-6xl text-indigo-500 mb-4"></i>
69
+ <h2 class="text-2xl font-bold text-gray-800 mb-2">Bem-vindo ao Quiz!</h2>
70
+ <p class="text-gray-600 mb-6">Responda 50 perguntas de diferentes categorias e descubra o quanto você sabe.</p>
71
+ </div>
72
+ <div class="mb-6">
73
+ <label for="username" class="block text-gray-700 mb-2">Seu nome (opcional):</label>
74
+ <input type="text" id="username" class="w-full max-w-xs px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
75
+ </div>
76
+ <button id="start-btn" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-3 px-8 rounded-lg transition duration-300 transform hover:scale-105">
77
+ Começar Quiz <i class="fas fa-play ml-2"></i>
78
+ </button>
79
+ </div>
80
+
81
+ <!-- Quiz Container -->
82
+ <div id="quiz-container" class="hidden bg-white rounded-xl shadow-lg overflow-hidden">
83
+ <!-- Quiz Header -->
84
+ <div class="bg-indigo-600 text-white p-4 flex justify-between items-center">
85
+ <div class="flex items-center">
86
+ <i class="fas fa-question-circle text-xl mr-2"></i>
87
+ <span id="question-counter" class="font-bold">Pergunta 1/50</span>
88
+ </div>
89
+ <div class="flex items-center">
90
+ <i class="fas fa-clock mr-2"></i>
91
+ <span id="timer">00:00</span>
92
+ </div>
93
+ </div>
94
+
95
+ <!-- Progress Bar -->
96
+ <div class="h-2 bg-gray-200">
97
+ <div id="progress-bar" class="progress-bar h-full bg-indigo-500" style="width: 0%"></div>
98
+ </div>
99
+
100
+ <!-- Question Area -->
101
+ <div id="question-area" class="p-6 relative min-h-64">
102
+ <!-- Questions will be inserted here by JavaScript -->
103
+ </div>
104
+
105
+ <!-- Quiz Footer -->
106
+ <div class="bg-gray-50 p-4 flex justify-between">
107
+ <button id="prev-btn" class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded-lg transition disabled:opacity-50" disabled>
108
+ <i class="fas fa-arrow-left mr-2"></i> Anterior
109
+ </button>
110
+ <button id="next-btn" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded-lg transition">
111
+ Próxima <i class="fas fa-arrow-right ml-2"></i>
112
+ </button>
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Results Screen -->
117
+ <div id="results-screen" class="hidden bg-white rounded-xl shadow-lg p-8 text-center">
118
+ <div class="mb-6">
119
+ <i class="fas fa-trophy text-6xl text-yellow-500 mb-4"></i>
120
+ <h2 class="text-3xl font-bold text-gray-800 mb-2">Quiz Concluído!</h2>
121
+ <p id="results-message" class="text-xl text-gray-600 mb-6">Você acertou <span class="font-bold text-indigo-600">X</span> de 50 perguntas.</p>
122
+ </div>
123
+ <div class="bg-gray-100 rounded-lg p-4 mb-6">
124
+ <div class="flex justify-between mb-2">
125
+ <span>Tempo total:</span>
126
+ <span id="total-time" class="font-bold">00:00</span>
127
+ </div>
128
+ <div class="flex justify-between mb-2">
129
+ <span>Porcentagem de acertos:</span>
130
+ <span id="percentage" class="font-bold">0%</span>
131
+ </div>
132
+ <div class="flex justify-between">
133
+ <span>Pontuação:</span>
134
+ <span id="score" class="font-bold">0/50</span>
135
+ </div>
136
+ </div>
137
+ <div class="flex justify-center space-x-4">
138
+ <button id="restart-btn" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-6 rounded-lg transition">
139
+ <i class="fas fa-redo mr-2"></i> Refazer
140
+ </button>
141
+ <button id="share-btn" class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-6 rounded-lg transition">
142
+ <i class="fas fa-share-alt mr-2"></i> Compartilhar
143
+ </button>
144
+ </div>
145
+ </div>
146
+ </div>
147
+
148
+ <script>
149
+ // Quiz questions
150
+ const questions = [
151
+ {
152
+ question: "Qual é o maior planeta do sistema solar?",
153
+ options: ["Terra", "Marte", "Júpiter", "Saturno"],
154
+ answer: 2,
155
+ category: "Ciência"
156
+ },
157
+ {
158
+ question: "Quem pintou a Mona Lisa?",
159
+ options: ["Vincent van Gogh", "Pablo Picasso", "Leonardo da Vinci", "Michelangelo"],
160
+ answer: 2,
161
+ category: "Arte"
162
+ },
163
+ {
164
+ question: "Qual é o elemento químico com símbolo 'O'?",
165
+ options: ["Ouro", "Oxigênio", "Ósmio", "Oganésson"],
166
+ answer: 1,
167
+ category: "Ciência"
168
+ },
169
+ {
170
+ question: "Em que ano o homem pisou na Lua pela primeira vez?",
171
+ options: ["1965", "1969", "1972", "1958"],
172
+ answer: 1,
173
+ category: "História"
174
+ },
175
+ {
176
+ question: "Qual é o maior oceano do mundo?",
177
+ options: ["Atlântico", "Índico", "Ártico", "Pacífico"],
178
+ answer: 3,
179
+ category: "Geografia"
180
+ },
181
+ {
182
+ question: "Quem escreveu 'Dom Quixote'?",
183
+ options: ["Miguel de Cervantes", "Gabriel García Márquez", "Pablo Neruda", "Fernando Pessoa"],
184
+ answer: 0,
185
+ category: "Literatura"
186
+ },
187
+ {
188
+ question: "Qual é a capital do Canadá?",
189
+ options: ["Toronto", "Vancouver", "Ottawa", "Montreal"],
190
+ answer: 2,
191
+ category: "Geografia"
192
+ },
193
+ {
194
+ question: "Quantos continentes existem?",
195
+ options: ["5", "6", "7", "8"],
196
+ answer: 2,
197
+ category: "Geografia"
198
+ },
199
+ {
200
+ question: "Qual é o animal terrestre mais rápido?",
201
+ options: ["Leão", "Guepardo", "Antílope", "Leopardo"],
202
+ answer: 1,
203
+ category: "Natureza"
204
+ },
205
+ {
206
+ question: "Quem foi o primeiro presidente do Brasil?",
207
+ options: ["Getúlio Vargas", "Deodoro da Fonseca", "Prudente de Morais", "Floriano Peixoto"],
208
+ answer: 1,
209
+ category: "História"
210
+ },
211
+ {
212
+ question: "Qual é o livro mais vendido do mundo depois da Bíblia?",
213
+ options: ["Dom Quixote", "Um Conto de Duas Cidades", "O Pequeno Príncipe", "O Senhor dos Anéis"],
214
+ answer: 0,
215
+ category: "Literatura"
216
+ },
217
+ {
218
+ question: "Qual é a língua mais falada no mundo?",
219
+ options: ["Inglês", "Mandarim", "Espanhol", "Hindi"],
220
+ answer: 1,
221
+ category: "Cultura"
222
+ },
223
+ {
224
+ question: "Quantos ossos tem o corpo humano adulto?",
225
+ options: ["206", "300", "150", "187"],
226
+ answer: 0,
227
+ category: "Ciência"
228
+ },
229
+ {
230
+ question: "Qual é o menor país do mundo?",
231
+ options: ["Mônaco", "Vaticano", "San Marino", "Liechtenstein"],
232
+ answer: 1,
233
+ category: "Geografia"
234
+ },
235
+ {
236
+ question: "Quem descobriu a penicilina?",
237
+ options: ["Marie Curie", "Alexander Fleming", "Louis Pasteur", "Robert Koch"],
238
+ answer: 1,
239
+ category: "Ciência"
240
+ },
241
+ {
242
+ question: "Qual é o rio mais longo do mundo?",
243
+ options: ["Amazonas", "Nilo", "Yangtzé", "Mississipi"],
244
+ answer: 0,
245
+ category: "Geografia"
246
+ },
247
+ {
248
+ question: "Em que ano começou a Segunda Guerra Mundial?",
249
+ options: ["1939", "1941", "1935", "1945"],
250
+ answer: 0,
251
+ category: "História"
252
+ },
253
+ {
254
+ question: "Qual é a montanha mais alta do mundo?",
255
+ options: ["K2", "Monte Everest", "Aconcágua", "Kilimanjaro"],
256
+ answer: 1,
257
+ category: "Geografia"
258
+ },
259
+ {
260
+ question: "Quem foi o autor de '1984'?",
261
+ options: ["Aldous Huxley", "George Orwell", "Ray Bradbury", "J.R.R. Tolkien"],
262
+ answer: 1,
263
+ category: "Literatura"
264
+ },
265
+ {
266
+ question: "Qual é a moeda oficial do Japão?",
267
+ options: ["Won", "Yen", "Yuan", "Dólar"],
268
+ answer: 1,
269
+ category: "Cultura"
270
+ },
271
+ {
272
+ question: "Quantas cores tem o arco-íris?",
273
+ options: ["5", "6", "7", "8"],
274
+ answer: 2,
275
+ category: "Ciência"
276
+ },
277
+ {
278
+ question: "Qual é o maior deserto do mundo?",
279
+ options: ["Deserto do Saara", "Deserto de Gobi", "Deserto da Arábia", "Antártida"],
280
+ answer: 3,
281
+ category: "Geografia"
282
+ },
283
+ {
284
+ question: "Quem foi o primeiro homem a viajar no espaço?",
285
+ options: ["Neil Armstrong", "Yuri Gagarin", "John Glenn", "Alan Shepard"],
286
+ answer: 1,
287
+ category: "História"
288
+ },
289
+ {
290
+ question: "Qual é o símbolo químico do ouro?",
291
+ options: ["Ag", "Au", "Og", "Gd"],
292
+ answer: 1,
293
+ category: "Ciência"
294
+ },
295
+ {
296
+ question: "Em que país nasceu o futebolista Lionel Messi?",
297
+ options: ["Brasil", "Espanha", "Portugal", "Argentina"],
298
+ answer: 3,
299
+ category: "Esportes"
300
+ },
301
+ {
302
+ question: "Qual é a capital da Austrália?",
303
+ options: ["Sydney", "Melbourne", "Canberra", "Brisbane"],
304
+ answer: 2,
305
+ category: "Geografia"
306
+ },
307
+ {
308
+ question: "Quantos anos durou a Guerra dos Cem Anos?",
309
+ options: ["100", "116", "97", "110"],
310
+ answer: 1,
311
+ category: "História"
312
+ },
313
+ {
314
+ question: "Qual é o maior órgão do corpo humano?",
315
+ options: ["Coração", "Fígado", "Pele", "Cérebro"],
316
+ answer: 2,
317
+ category: "Ciência"
318
+ },
319
+ {
320
+ question: "Quem escreveu 'Romeu e Julieta'?",
321
+ options: ["Charles Dickens", "William Shakespeare", "Jane Austen", "Mark Twain"],
322
+ answer: 1,
323
+ category: "Literatura"
324
+ },
325
+ {
326
+ question: "Qual é o país mais populoso do mundo?",
327
+ options: ["Índia", "Estados Unidos", "China", "Indonésia"],
328
+ answer: 2,
329
+ category: "Geografia"
330
+ },
331
+ {
332
+ question: "Qual destes não é um sistema operacional?",
333
+ options: ["Windows", "Linux", "MacOS", "Google"],
334
+ answer: 3,
335
+ category: "Tecnologia"
336
+ },
337
+ {
338
+ question: "Qual é a capital da Islândia?",
339
+ options: ["Oslo", "Reykjavik", "Helsinque", "Estocolmo"],
340
+ answer: 1,
341
+ category: "Geografia"
342
+ },
343
+ {
344
+ question: "Quantas peças tem um xadrez tradicional?",
345
+ options: ["16", "24", "32", "40"],
346
+ answer: 2,
347
+ category: "Jogos"
348
+ },
349
+ {
350
+ question: "Qual é o nome do processo de transformação de lagarta em borboleta?",
351
+ options: ["Fotossíntese", "Metamorfose", "Osmose", "Fertilização"],
352
+ answer: 1,
353
+ category: "Natureza"
354
+ },
355
+ {
356
+ question: "Qual destes é um instrumento de percussão?",
357
+ options: ["Violino", "Trompete", "Bateria", "Harpa"],
358
+ answer: 2,
359
+ category: "Música"
360
+ },
361
+ {
362
+ question: "Em que ano o Brasil foi descoberto?",
363
+ options: ["1492", "1500", "1520", "1450"],
364
+ answer: 1,
365
+ category: "História"
366
+ },
367
+ {
368
+ question: "Qual é o nome do maior osso do corpo humano?",
369
+ options: ["Úmero", "Fêmur", "Tíbia", "Crânio"],
370
+ answer: 1,
371
+ category: "Ciência"
372
+ },
373
+ {
374
+ question: "Qual destes não é um planeta do sistema solar?",
375
+ options: ["Vênus", "Urano", "Plutão", "Marte"],
376
+ answer: 2,
377
+ category: "Ciência"
378
+ },
379
+ {
380
+ question: "Quem foi o criador da teoria da relatividade?",
381
+ options: ["Isaac Newton", "Albert Einstein", "Galileu Galilei", "Stephen Hawking"],
382
+ answer: 1,
383
+ category: "Ciência"
384
+ },
385
+ {
386
+ question: "Qual é o nome do processo de divisão celular?",
387
+ options: ["Fotossíntese", "Mitose", "Respiração", "Digestão"],
388
+ answer: 1,
389
+ category: "Ciência"
390
+ },
391
+ {
392
+ question: "Qual é o nome do famoso quadro de Edvard Munch que representa uma pessoa gritando?",
393
+ options: ["O Grito", "A Noite Estrelada", "Guernica", "A Persistência da Memória"],
394
+ answer: 0,
395
+ category: "Arte"
396
+ },
397
+ {
398
+ question: "Qual é o metal mais condutor de eletricidade?",
399
+ options: ["Ouro", "Prata", "Cobre", "Alumínio"],
400
+ answer: 1,
401
+ category: "Ciência"
402
+ },
403
+ {
404
+ question: "Quantas cordas tem um violão tradicional?",
405
+ options: ["4", "5", "6", "7"],
406
+ answer: 2,
407
+ category: "Música"
408
+ },
409
+ {
410
+ question: "Qual é o nome do autor de 'O Pequeno Príncipe'?",
411
+ options: ["Jules Verne", "Antoine de Saint-Exupéry", "Victor Hugo", "Charles Perrault"],
412
+ answer: 1,
413
+ category: "Literatura"
414
+ },
415
+ {
416
+ question: "Qual é o país de origem da vodka?",
417
+ options: ["Polônia", "Rússia", "Suécia", "Finlândia"],
418
+ answer: 1,
419
+ category: "Cultura"
420
+ },
421
+ {
422
+ question: "Qual é o nome do processo de formação de palavras novas?",
423
+ options: ["Conjugação", "Derivação", "Flexão", "Concordância"],
424
+ answer: 1,
425
+ category: "Linguística"
426
+ },
427
+ {
428
+ question: "Qual é o nome do maior felino do mundo?",
429
+ options: ["Leão", "Tigre", "Onça-pintada", "Leopardo"],
430
+ answer: 1,
431
+ category: "Natureza"
432
+ },
433
+ {
434
+ question: "Qual é o nome do inventor da lâmpada elétrica?",
435
+ options: ["Nikola Tesla", "Thomas Edison", "Alexander Graham Bell", "Guglielmo Marconi"],
436
+ answer: 1,
437
+ category: "História"
438
+ },
439
+ {
440
+ question: "Qual é o nome do maior osso do crânio humano?",
441
+ options: ["Mandíbula", "Frontal", "Parietal", "Occipital"],
442
+ answer: 0,
443
+ category: "Ciência"
444
+ },
445
+ {
446
+ question: "Qual é o nome do processo de formação de gametas?",
447
+ options: ["Mitose", "Meiose", "Fertilização", "Osmose"],
448
+ answer: 1,
449
+ category: "Ciência"
450
+ },
451
+ {
452
+ question: "Qual é o nome do autor de 'Crime e Castigo'?",
453
+ options: ["Leo Tolstoy", "Fyodor Dostoevsky", "Anton Chekhov", "Vladimir Nabokov"],
454
+ answer: 1,
455
+ category: "Literatura"
456
+ },
457
+ {
458
+ question: "Qual é o nome do maior lago de água doce do mundo?",
459
+ options: ["Lago Vitória", "Lago Superior", "Lago Baikal", "Lago Tanganica"],
460
+ answer: 1,
461
+ category: "Geografia"
462
+ }
463
+ ];
464
+
465
+ // DOM Elements
466
+ const startScreen = document.getElementById('start-screen');
467
+ const quizContainer = document.getElementById('quiz-container');
468
+ const resultsScreen = document.getElementById('results-screen');
469
+ const questionArea = document.getElementById('question-area');
470
+ const questionCounter = document.getElementById('question-counter');
471
+ const progressBar = document.getElementById('progress-bar');
472
+ const prevBtn = document.getElementById('prev-btn');
473
+ const nextBtn = document.getElementById('next-btn');
474
+ const startBtn = document.getElementById('start-btn');
475
+ const restartBtn = document.getElementById('restart-btn');
476
+ const shareBtn = document.getElementById('share-btn');
477
+ const resultsMessage = document.getElementById('results-message');
478
+ const totalTime = document.getElementById('total-time');
479
+ const percentage = document.getElementById('percentage');
480
+ const score = document.getElementById('score');
481
+ const timer = document.getElementById('timer');
482
+ const usernameInput = document.getElementById('username');
483
+
484
+ // Quiz Variables
485
+ let currentQuestion = 0;
486
+ let userAnswers = Array(questions.length).fill(null);
487
+ let startTime;
488
+ let timerInterval;
489
+ let correctAnswers = 0;
490
+
491
+ // Start Quiz
492
+ startBtn.addEventListener('click', () => {
493
+ startScreen.classList.add('hidden');
494
+ quizContainer.classList.remove('hidden');
495
+ startTime = new Date();
496
+ startTimer();
497
+ showQuestion(currentQuestion);
498
+ });
499
+
500
+ // Restart Quiz
501
+ restartBtn.addEventListener('click', () => {
502
+ resultsScreen.classList.add('hidden');
503
+ startScreen.classList.remove('hidden');
504
+ currentQuestion = 0;
505
+ userAnswers = Array(questions.length).fill(null);
506
+ correctAnswers = 0;
507
+ clearInterval(timerInterval);
508
+ });
509
+
510
+ // Share Results
511
+ shareBtn.addEventListener('click', () => {
512
+ const username = usernameInput.value || 'Anônimo';
513
+ const scoreText = `${correctAnswers}/50`;
514
+ const percentageText = `${Math.round((correctAnswers / questions.length) * 100)}%`;
515
+ const timeText = document.getElementById('total-time').textContent;
516
+
517
+ if (navigator.share) {
518
+ navigator.share({
519
+ title: 'Meu resultado no Quiz',
520
+ text: `${username} acertou ${scoreText} (${percentageText}) no Quiz em ${timeText}!`,
521
+ url: window.location.href
522
+ }).catch(err => {
523
+ console.log('Erro ao compartilhar:', err);
524
+ fallbackShare();
525
+ });
526
+ } else {
527
+ fallbackShare();
528
+ }
529
+ });
530
+
531
+ function fallbackShare() {
532
+ const shareText = `Eu acertei ${correctAnswers} de 50 perguntas no Quiz!`;
533
+ alert('Copie este texto para compartilhar:\n\n' + shareText);
534
+ }
535
+
536
+ // Timer Function
537
+ function startTimer() {
538
+ timerInterval = setInterval(() => {
539
+ const now = new Date();
540
+ const elapsed = new Date(now - startTime);
541
+ const minutes = elapsed.getMinutes().toString().padStart(2, '0');
542
+ const seconds = elapsed.getSeconds().toString().padStart(2, '0');
543
+ timer.textContent = `${minutes}:${seconds}`;
544
+ }, 1000);
545
+ }
546
+
547
+ // Show Question
548
+ function showQuestion(index) {
549
+ // Update progress
550
+ const progress = ((index + 1) / questions.length) * 100;
551
+ progressBar.style.width = `${progress}%`;
552
+ questionCounter.textContent = `Pergunta ${index + 1}/${questions.length}`;
553
+
554
+ // Update navigation buttons
555
+ prevBtn.disabled = index === 0;
556
+ nextBtn.textContent = index === questions.length - 1 ? 'Finalizar' : 'Próxima';
557
+
558
+ // Clear previous question
559
+ questionArea.innerHTML = '';
560
+
561
+ // Create question card
562
+ const questionCard = document.createElement('div');
563
+ questionCard.className = 'question-card';
564
+
565
+ // Add category
566
+ const categoryDiv = document.createElement('div');
567
+ categoryDiv.className = 'text-sm font-semibold text-indigo-600 mb-2';
568
+ categoryDiv.textContent = questions[index].category;
569
+ questionCard.appendChild(categoryDiv);
570
+
571
+ // Add question
572
+ const questionDiv = document.createElement('div');
573
+ questionDiv.className = 'text-xl font-bold text-gray-800 mb-6';
574
+ questionDiv.textContent = questions[index].question;
575
+ questionCard.appendChild(questionDiv);
576
+
577
+ // Add options
578
+ const optionsDiv = document.createElement('div');
579
+ optionsDiv.className = 'space-y-3';
580
+
581
+ questions[index].options.forEach((option, i) => {
582
+ const optionDiv = document.createElement('div');
583
+ optionDiv.className = `option p-4 border rounded-lg cursor-pointer transition ${userAnswers[index] === i ? 'selected' : ''}`;
584
+ optionDiv.textContent = option;
585
+ optionDiv.dataset.index = i;
586
+
587
+ optionDiv.addEventListener('click', () => {
588
+ // Remove selected class from all options
589
+ document.querySelectorAll('.option').forEach(opt => {
590
+ opt.classList.remove('selected');
591
+ });
592
+
593
+ // Add selected class to clicked option
594
+ optionDiv.classList.add('selected');
595
+
596
+ // Store user answer
597
+ userAnswers[index] = i;
598
+
599
+ // Enable next button if not already enabled
600
+ if (nextBtn.disabled) {
601
+ nextBtn.disabled = false;
602
+ }
603
+ });
604
+
605
+ optionsDiv.appendChild(optionDiv);
606
+ });
607
+
608
+ questionCard.appendChild(optionsDiv);
609
+ questionArea.appendChild(questionCard);
610
+ }
611
+
612
+ // Navigation
613
+ nextBtn.addEventListener('click', () => {
614
+ if (currentQuestion < questions.length - 1) {
615
+ currentQuestion++;
616
+ showQuestion(currentQuestion);
617
+ } else {
618
+ finishQuiz();
619
+ }
620
+ });
621
+
622
+ prevBtn.addEventListener('click', () => {
623
+ if (currentQuestion > 0) {
624
+ currentQuestion--;
625
+ showQuestion(currentQuestion);
626
+ }
627
+ });
628
+
629
+ // Finish Quiz
630
+ function finishQuiz() {
631
+ clearInterval(timerInterval);
632
+
633
+ // Calculate results
634
+ const endTime = new Date();
635
+ const elapsed = new Date(endTime - startTime);
636
+ const minutes = elapsed.getMinutes().toString().padStart(2, '0');
637
+ const seconds = elapsed.getSeconds().toString().padStart(2, '0');
638
+
639
+ correctAnswers = 0;
640
+ for (let i = 0; i < questions.length; i++) {
641
+ if (userAnswers[i] === questions[i].answer) {
642
+ correctAnswers++;
643
+ }
644
+ }
645
+
646
+ const percentageCorrect = Math.round((correctAnswers / questions.length) * 100);
647
+
648
+ // Display results
649
+ quizContainer.classList.add('hidden');
650
+ resultsScreen.classList.remove('hidden');
651
+
652
+ const username = usernameInput.value || 'Você';
653
+ resultsMessage.innerHTML = `${username} acertou <span class="font-bold text-indigo-600">${correctAnswers}</span> de 50 perguntas.`;
654
+ totalTime.textContent = `${minutes}:${seconds}`;
655
+ percentage.textContent = `${percentageCorrect}%`;
656
+ score.textContent = `${correctAnswers}/50`;
657
+
658
+ // Add confetti for good scores
659
+ if (percentageCorrect >= 70) {
660
+ createConfetti();
661
+ }
662
+ }
663
+
664
+ // Confetti effect
665
+ function createConfetti() {
666
+ const colors = ['#f00', '#0f0', '#00f', '#ff0', '#f0f', '#0ff'];
667
+
668
+ for (let i = 0; i < 100; i++) {
669
+ const confetti = document.createElement('div');
670
+ confetti.className = 'confetti';
671
+ confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
672
+ confetti.style.left = `${Math.random() * 100}vw`;
673
+ confetti.style.animationDuration = `${3 + Math.random() * 4}s`;
674
+ confetti.style.transform = `scale(${0.5 + Math.random()})`;
675
+
676
+ document.body.appendChild(confetti);
677
+
678
+ // Remove confetti after animation
679
+ setTimeout(() => {
680
+ confetti.remove();
681
+ }, 5000);
682
+ }
683
+ }
684
+
685
+ // Initialize
686
+ showQuestion(currentQuestion);
687
+ </script>
688
+ <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=Leandroprofessor/teste-de-programa-o" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
689
+ </html>