prernajeet01 commited on
Commit
ddbf128
·
verified ·
1 Parent(s): e575b23

Delete index.html

Browse files
Files changed (1) hide show
  1. index.html +0 -503
index.html DELETED
@@ -1,503 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Candlestick Pattern Quiz</title>
7
- <style>
8
- :root {
9
- --primary: #4338ca;
10
- --secondary: #fbbf24;
11
- --success: #10b981;
12
- --danger: #ef4444;
13
- --dark: #1f2937;
14
- --light: #f3f4f6;
15
- }
16
-
17
- body {
18
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
19
- background-color: #f8fafc;
20
- margin: 0;
21
- padding: 0;
22
- color: var(--dark);
23
- }
24
-
25
- .container {
26
- max-width: 800px;
27
- margin: 0 auto;
28
- padding: 20px;
29
- }
30
-
31
- .header {
32
- background-color: var(--primary);
33
- color: white;
34
- padding: 20px;
35
- text-align: center;
36
- border-radius: 10px;
37
- margin-bottom: 20px;
38
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
39
- }
40
-
41
- .progress-container {
42
- background-color: white;
43
- border-radius: 8px;
44
- padding: 15px;
45
- margin-bottom: 20px;
46
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
47
- display: flex;
48
- justify-content: space-between;
49
- align-items: center;
50
- }
51
-
52
- .progress-bar {
53
- height: 10px;
54
- background-color: #e2e8f0;
55
- border-radius: 5px;
56
- overflow: hidden;
57
- flex-grow: 1;
58
- margin: 0 15px;
59
- }
60
-
61
- .progress {
62
- height: 100%;
63
- background-color: var(--secondary);
64
- width: 0%;
65
- transition: width 0.3s ease;
66
- }
67
-
68
- .quiz-container {
69
- background-color: white;
70
- border-radius: 8px;
71
- padding: 20px;
72
- margin-bottom: 20px;
73
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
74
- }
75
-
76
- .pattern-image {
77
- max-width: 100%;
78
- height: auto;
79
- border-radius: 8px;
80
- margin-bottom: 20px;
81
- display: block;
82
- margin: 0 auto 20px;
83
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
84
- }
85
-
86
- .options {
87
- display: grid;
88
- grid-template-columns: 1fr 1fr;
89
- gap: 10px;
90
- margin-bottom: 20px;
91
- }
92
-
93
- .option {
94
- background-color: var(--light);
95
- border: 2px solid #e2e8f0;
96
- border-radius: 8px;
97
- padding: 15px;
98
- cursor: pointer;
99
- transition: all 0.2s ease;
100
- font-weight: 500;
101
- }
102
-
103
- .option:hover {
104
- background-color: #e2e8f0;
105
- transform: translateY(-2px);
106
- }
107
-
108
- .selected {
109
- border-color: var(--primary);
110
- background-color: rgba(67, 56, 202, 0.1);
111
- }
112
-
113
- .correct {
114
- border-color: var(--success);
115
- background-color: rgba(16, 185, 129, 0.1);
116
- }
117
-
118
- .incorrect {
119
- border-color: var(--danger);
120
- background-color: rgba(239, 68, 68, 0.1);
121
- }
122
-
123
- .button {
124
- background-color: var(--primary);
125
- color: white;
126
- border: none;
127
- padding: 12px 24px;
128
- border-radius: 8px;
129
- cursor: pointer;
130
- font-weight: 600;
131
- transition: all 0.2s ease;
132
- display: inline-block;
133
- }
134
-
135
- .button:hover {
136
- background-color: #3730a3;
137
- transform: translateY(-2px);
138
- }
139
-
140
- .button:disabled {
141
- background-color: #cbd5e1;
142
- cursor: not-allowed;
143
- transform: none;
144
- }
145
-
146
- .explanation {
147
- background-color: #f1f5f9;
148
- border-left: 4px solid var(--primary);
149
- padding: 15px;
150
- border-radius: 0 8px 8px 0;
151
- margin-bottom: 20px;
152
- display: none;
153
- }
154
-
155
- .signal {
156
- display: inline-block;
157
- padding: 6px 12px;
158
- border-radius: 4px;
159
- color: white;
160
- font-weight: 600;
161
- margin-bottom: 10px;
162
- }
163
-
164
- .buy {
165
- background-color: var(--success);
166
- }
167
-
168
- .sell {
169
- background-color: var(--danger);
170
- }
171
-
172
- .results {
173
- text-align: center;
174
- display: none;
175
- }
176
-
177
- .score {
178
- font-size: 36px;
179
- font-weight: 700;
180
- color: var(--primary);
181
- margin-bottom: 10px;
182
- }
183
-
184
- .cash-reward {
185
- background-color: var(--secondary);
186
- color: var(--dark);
187
- padding: 10px 20px;
188
- border-radius: 8px;
189
- font-size: 24px;
190
- font-weight: 700;
191
- display: inline-block;
192
- margin: 20px 0;
193
- }
194
-
195
- .pattern-list {
196
- display: grid;
197
- grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
198
- gap: 15px;
199
- margin-top: 20px;
200
- }
201
-
202
- .pattern-card {
203
- background-color: white;
204
- border-radius: 8px;
205
- padding: 15px;
206
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
207
- }
208
-
209
- .pattern-card h3 {
210
- margin-top: 0;
211
- color: var(--primary);
212
- }
213
-
214
- .pattern-card img {
215
- max-width: 100%;
216
- border-radius: 4px;
217
- margin-bottom: 10px;
218
- }
219
- </style>
220
- </head>
221
- <body>
222
- <div class="container">
223
- <div class="header">
224
- <h1>Candlestick Pattern Quiz Game</h1>
225
- <p>Test your knowledge of candlestick patterns and earn reward points!</p>
226
- </div>
227
-
228
- <div class="progress-container">
229
- <span>Question: <span id="current-question">1</span>/<span id="total-questions">10</span></span>
230
- <div class="progress-bar">
231
- <div class="progress" id="progress"></div>
232
- </div>
233
- <span>Score: <span id="score">0</span></span>
234
- </div>
235
-
236
- <div class="quiz-container" id="quiz">
237
- <img src="/api/placeholder/600/300" alt="Candlestick Pattern" class="pattern-image" id="pattern-image">
238
- <h2>What candlestick pattern is shown above?</h2>
239
- <div class="options" id="options">
240
- <!-- Options will be inserted here -->
241
- </div>
242
- <div class="explanation" id="explanation">
243
- <!-- Explanation will be inserted here -->
244
- </div>
245
- <button class="button" id="next-btn" disabled>Next Question</button>
246
- </div>
247
-
248
- <div class="results" id="results">
249
- <h2>Quiz Complete!</h2>
250
- <p>Your final score:</p>
251
- <div class="score" id="final-score">0/10</div>
252
- <div class="cash-reward">
253
- Reward: $<span id="cash-reward">0.00</span>
254
- </div>
255
- <p>You've earned points that can be converted to cash rewards!</p>
256
- <button class="button" id="restart-btn">Try Again</button>
257
- </div>
258
- </div>
259
-
260
- <script>
261
- const candlestickPatterns = [
262
- {
263
- name: "Doji",
264
- image: "doji.png",
265
- signal: "neutral",
266
- explanation: "A Doji forms when the opening and closing prices are virtually equal. It represents indecision in the market and can signal a potential reversal or continuation depending on previous price action."
267
- },
268
- {
269
- name: "Hammer",
270
- image: "hammer.png",
271
- signal: "buy",
272
- explanation: "The Hammer is a bullish reversal pattern that forms during a downtrend. It has a small body at the top with a long lower shadow (at least twice the size of the body). This indicates that sellers drove prices down during the session but buyers were able to push the price back up by closing."
273
- },
274
- {
275
- name: "Shooting Star",
276
- image: "shooting_star.png",
277
- signal: "sell",
278
- explanation: "The Shooting Star is a bearish reversal pattern that forms during an uptrend. It has a small body at the bottom with a long upper shadow. This signals that buyers pushed prices up during the session, but sellers took control and drove the price back down."
279
- },
280
- {
281
- name: "Bullish Engulfing",
282
- image: "bullish_engulfing.png",
283
- signal: "buy",
284
- explanation: "A Bullish Engulfing pattern forms when a small bearish candle is followed by a larger bullish candle that completely 'engulfs' the previous day's body. This indicates strong buying pressure and often signals a bullish reversal."
285
- },
286
- {
287
- name: "Bearish Engulfing",
288
- image: "bearish_engulfing.png",
289
- signal: "sell",
290
- explanation: "A Bearish Engulfing pattern forms when a small bullish candle is followed by a larger bearish candle that completely 'engulfs' the previous day's body. This indicates strong selling pressure and often signals a bearish reversal."
291
- },
292
- {
293
- name: "Morning Star",
294
- image: "morning_star.png",
295
- signal: "buy",
296
- explanation: "The Morning Star is a bullish reversal pattern consisting of three candles: a large bearish candle, followed by a small-bodied candle (star) that gaps down, followed by a large bullish candle that closes above the midpoint of the first candle. This shows a shift from selling to buying pressure."
297
- },
298
- {
299
- name: "Evening Star",
300
- image: "evening_star.png",
301
- signal: "sell",
302
- explanation: "The Evening Star is a bearish reversal pattern consisting of three candles: a large bullish candle, followed by a small-bodied candle (star) that gaps up, followed by a large bearish candle that closes below the midpoint of the first candle. This shows a shift from buying to selling pressure."
303
- },
304
- {
305
- name: "Three White Soldiers",
306
- image: "three_white_soldiers.png",
307
- signal: "buy",
308
- explanation: "The Three White Soldiers pattern consists of three consecutive bullish candles, each opening within the previous candle's body and closing above the previous candle's high. It signals strong buying pressure and often indicates a bullish reversal."
309
- }
310
- ];
311
-
312
- // Quiz questions
313
- const questions = [];
314
-
315
- // Generate 10 questions using the available patterns
316
- for (let i = 0; i < 10; i++) {
317
- // Cycle through the patterns if we need more than 8 questions
318
- const patternIndex = i % candlestickPatterns.length;
319
- const currentPattern = candlestickPatterns[patternIndex];
320
-
321
- // Create options (all patterns except the correct one)
322
- const otherOptions = candlestickPatterns
323
- .filter(pattern => pattern.name !== currentPattern.name)
324
- .map(pattern => pattern.name);
325
-
326
- // Randomly select 3 incorrect options
327
- const shuffledOptions = otherOptions.sort(() => 0.5 - Math.random()).slice(0, 3);
328
-
329
- // Add the correct answer and shuffle again
330
- shuffledOptions.push(currentPattern.name);
331
- const finalOptions = shuffledOptions.sort(() => 0.5 - Math.random());
332
-
333
- questions.push({
334
- pattern: currentPattern,
335
- options: finalOptions,
336
- correctAnswer: currentPattern.name
337
- });
338
- }
339
-
340
- // Quiz state
341
- let currentQuestionIndex = 0;
342
- let score = 0;
343
- let selectedOption = null;
344
- let answered = false;
345
-
346
- // DOM Elements
347
- const quizContainer = document.getElementById('quiz');
348
- const resultsContainer = document.getElementById('results');
349
- const patternImage = document.getElementById('pattern-image');
350
- const optionsContainer = document.getElementById('options');
351
- const explanationContainer = document.getElementById('explanation');
352
- const nextButton = document.getElementById('next-btn');
353
- const restartButton = document.getElementById('restart-btn');
354
- const currentQuestionSpan = document.getElementById('current-question');
355
- const totalQuestionsSpan = document.getElementById('total-questions');
356
- const scoreSpan = document.getElementById('score');
357
- const finalScoreSpan = document.getElementById('final-score');
358
- const cashRewardSpan = document.getElementById('cash-reward');
359
- const progressBar = document.getElementById('progress');
360
-
361
- // Initialize quiz
362
- function initQuiz() {
363
- totalQuestionsSpan.textContent = questions.length;
364
- displayQuestion();
365
-
366
- nextButton.addEventListener('click', nextQuestion);
367
- restartButton.addEventListener('click', restartQuiz);
368
- }
369
-
370
- // Display current question
371
- function displayQuestion() {
372
- const question = questions[currentQuestionIndex];
373
-
374
- // Update progress indicators
375
- currentQuestionSpan.textContent = currentQuestionIndex + 1;
376
- progressBar.style.width = `${((currentQuestionIndex + 1) / questions.length) * 100}%`;
377
-
378
- // Set image (placeholder for now, would be replaced with actual images)
379
- patternImage.src = `/api/placeholder/600/300`;
380
- patternImage.alt = `${question.pattern.name} Pattern`;
381
-
382
- // Clear previous options and explanation
383
- optionsContainer.innerHTML = '';
384
- explanationContainer.style.display = 'none';
385
- explanationContainer.innerHTML = '';
386
-
387
- // Add options
388
- question.options.forEach(option => {
389
- const optionElement = document.createElement('div');
390
- optionElement.className = 'option';
391
- optionElement.textContent = option;
392
- optionElement.addEventListener('click', () => selectOption(optionElement, option));
393
- optionsContainer.appendChild(optionElement);
394
- });
395
-
396
- // Reset state for new question
397
- selectedOption = null;
398
- answered = false;
399
- nextButton.disabled = true;
400
- }
401
-
402
- // Handle option selection
403
- function selectOption(optionElement, option) {
404
- if (answered) return;
405
-
406
- // Clear previous selection
407
- const allOptions = document.querySelectorAll('.option');
408
- allOptions.forEach(opt => opt.className = 'option');
409
-
410
- // Mark as selected
411
- optionElement.className = 'option selected';
412
- selectedOption = option;
413
-
414
- // Enable next button
415
- nextButton.disabled = false;
416
-
417
- // Check answer
418
- checkAnswer();
419
- }
420
-
421
- // Check if answer is correct
422
- function checkAnswer() {
423
- if (answered) return;
424
-
425
- const question = questions[currentQuestionIndex];
426
- const correct = selectedOption === question.correctAnswer;
427
-
428
- // Mark options as correct/incorrect
429
- const options = document.querySelectorAll('.option');
430
- options.forEach(option => {
431
- if (option.textContent === question.correctAnswer) {
432
- option.className = 'option correct';
433
- } else if (option.textContent === selectedOption && !correct) {
434
- option.className = 'option incorrect';
435
- }
436
- });
437
-
438
- // Update score if correct
439
- if (correct) {
440
- score++;
441
- scoreSpan.textContent = score;
442
- }
443
-
444
- // Display explanation
445
- const pattern = question.pattern;
446
- let explanationHTML = '';
447
-
448
- if (correct) {
449
- explanationHTML += '<h3>Correct! 🎉</h3>';
450
- } else {
451
- explanationHTML += `<h3>Incorrect</h3>`;
452
- explanationHTML += `<p>The correct answer is: <strong>${question.correctAnswer}</strong></p>`;
453
- }
454
-
455
- explanationHTML += `<div class="signal ${pattern.signal === 'buy' ? 'buy' : pattern.signal === 'sell' ? 'sell' : ''}">${pattern.signal.toUpperCase()}</div>`;
456
- explanationHTML += `<p>${pattern.explanation}</p>`;
457
-
458
- explanationContainer.innerHTML = explanationHTML;
459
- explanationContainer.style.display = 'block';
460
-
461
- answered = true;
462
- }
463
-
464
- // Move to next question
465
- function nextQuestion() {
466
- currentQuestionIndex++;
467
-
468
- if (currentQuestionIndex < questions.length) {
469
- displayQuestion();
470
- } else {
471
- showResults();
472
- }
473
- }
474
-
475
- // Show final results
476
- function showResults() {
477
- quizContainer.style.display = 'none';
478
- resultsContainer.style.display = 'block';
479
-
480
- finalScoreSpan.textContent = `${score}/${questions.length}`;
481
-
482
- // Calculate cash reward ($0.50 per correct answer)
483
- const cashReward = (score * 0.5).toFixed(2);
484
- cashRewardSpan.textContent = cashReward;
485
- }
486
-
487
- // Restart the quiz
488
- function restartQuiz() {
489
- currentQuestionIndex = 0;
490
- score = 0;
491
- scoreSpan.textContent = '0';
492
-
493
- quizContainer.style.display = 'block';
494
- resultsContainer.style.display = 'none';
495
-
496
- displayQuestion();
497
- }
498
-
499
- // Start the quiz
500
- initQuiz();
501
- </script>
502
- </body>
503
- </html>