-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathbullish-bearish.html
More file actions
425 lines (375 loc) · 11.2 KB
/
bullish-bearish.html
File metadata and controls
425 lines (375 loc) · 11.2 KB
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bullish vs Bearish - Remember Which is Which!</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Helvetica, Arial, sans-serif;
margin: 0;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
color: #333;
}
.container {
max-width: 1000px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
overflow: hidden;
}
.header {
background: linear-gradient(45deg, #2c3e50, #34495e);
color: white;
text-align: center;
padding: 30px;
}
.header h1 {
margin: 0;
font-size: 2.5rem;
font-weight: 300;
}
.subtitle {
margin: 10px 0 0 0;
opacity: 0.8;
font-size: 1.1rem;
}
.comparison {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0;
}
.side {
padding: 40px 30px;
text-align: center;
position: relative;
transition: transform 0.3s ease;
}
.side:hover {
transform: translateY(-5px);
}
.bullish {
background: linear-gradient(135deg, #2ecc71, #27ae60);
color: white;
}
.bearish {
background: linear-gradient(135deg, #e74c3c, #c0392b);
color: white;
}
.animal-container {
height: 200px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
.animal-svg {
width: 150px;
height: 150px;
transition: transform 0.5s ease;
cursor: pointer;
}
.animal-svg:hover {
transform: scale(1.1) rotate(5deg);
}
.term {
font-size: 2.5rem;
font-weight: bold;
margin-bottom: 15px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.meaning {
font-size: 1.3rem;
margin-bottom: 20px;
font-weight: 300;
}
.direction {
font-size: 3rem;
margin-bottom: 15px;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-10px);
}
60% {
transform: translateY(-5px);
}
}
.memory-tip {
background: rgba(255,255,255,0.1);
padding: 15px;
border-radius: 10px;
margin-top: 20px;
font-style: italic;
}
.quiz-section {
background: #f8f9fa;
padding: 40px;
text-align: center;
}
.quiz-title {
font-size: 1.8rem;
margin-bottom: 20px;
color: #2c3e50;
}
.quiz-button {
background: linear-gradient(45deg, #667eea, #764ba2);
color: white;
border: none;
padding: 15px 30px;
font-size: 18px;
border-radius: 25px;
cursor: pointer;
transition: transform 0.3s ease;
font-family: Helvetica, Arial, sans-serif;
}
.quiz-button:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.quiz-result {
margin-top: 20px;
font-size: 1.2rem;
min-height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
@media (max-width: 768px) {
.comparison {
grid-template-columns: 1fr;
}
.header h1 {
font-size: 2rem;
}
.side {
padding: 30px 20px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Bullish vs Bearish</h1>
<p class="subtitle">Remember which is which with these friendly animals!</p>
</div>
<div class="comparison">
<div class="side bullish">
<div class="animal-container">
<svg class="animal-svg" viewBox="0 0 200 200" id="bull-svg">
<!-- Bull SVG -->
<defs>
<radialGradient id="bullGradient" cx="50%" cy="30%" r="70%">
<stop offset="0%" stop-color="#8B4513"/>
<stop offset="100%" stop-color="#654321"/>
</radialGradient>
</defs>
<!-- Bull body -->
<ellipse cx="100" cy="120" rx="60" ry="40" fill="url(#bullGradient)"/>
<!-- Bull head -->
<circle cx="100" cy="80" r="35" fill="url(#bullGradient)"/>
<!-- Bull horns -->
<path d="M 75 60 Q 70 45 65 50" stroke="#FFE4B5" stroke-width="4" fill="none" stroke-linecap="round"/>
<path d="M 125 60 Q 130 45 135 50" stroke="#FFE4B5" stroke-width="4" fill="none" stroke-linecap="round"/>
<!-- Bull eyes -->
<circle cx="90" cy="75" r="4" fill="white"/>
<circle cx="110" cy="75" r="4" fill="white"/>
<circle cx="90" cy="75" r="2" fill="black"/>
<circle cx="110" cy="75" r="2" fill="black"/>
<!-- Bull nose -->
<ellipse cx="100" cy="90" rx="8" ry="6" fill="#F4A460"/>
<circle cx="97" cy="88" r="1" fill="black"/>
<circle cx="103" cy="88" r="1" fill="black"/>
<!-- Bull legs -->
<rect x="75" y="150" width="8" height="25" fill="#654321"/>
<rect x="90" y="150" width="8" height="25" fill="#654321"/>
<rect x="110" y="150" width="8" height="25" fill="#654321"/>
<rect x="125" y="150" width="8" height="25" fill="#654321"/>
</svg>
</div>
<div class="direction">📈 ↗️</div>
<div class="term">BULLISH</div>
<div class="meaning">Optimistic • Positive • Going UP!</div>
<div class="memory-tip">
🐂 Bulls attack by thrusting their horns <strong>UPWARD</strong>
</div>
</div>
<div class="side bearish">
<div class="animal-container">
<svg class="animal-svg" viewBox="0 0 200 200" id="bear-svg">
<!-- Bear SVG -->
<defs>
<radialGradient id="bearGradient" cx="50%" cy="30%" r="70%">
<stop offset="0%" stop-color="#8B4513"/>
<stop offset="100%" stop-color="#5D4037"/>
</radialGradient>
</defs>
<!-- Bear body -->
<ellipse cx="100" cy="130" rx="55" ry="45" fill="url(#bearGradient)"/>
<!-- Bear head -->
<circle cx="100" cy="75" r="40" fill="url(#bearGradient)"/>
<!-- Bear ears -->
<circle cx="80" cy="50" r="15" fill="url(#bearGradient)"/>
<circle cx="120" cy="50" r="15" fill="url(#bearGradient)"/>
<circle cx="80" cy="50" r="8" fill="#D2691E"/>
<circle cx="120" cy="50" r="8" fill="#D2691E"/>
<!-- Bear eyes -->
<circle cx="88" cy="70" r="4" fill="white"/>
<circle cx="112" cy="70" r="4" fill="white"/>
<circle cx="88" cy="70" r="2" fill="black"/>
<circle cx="112" cy="70" r="2" fill="black"/>
<!-- Bear snout -->
<ellipse cx="100" cy="85" rx="12" ry="8" fill="#D2691E"/>
<!-- Bear nose -->
<ellipse cx="100" cy="82" rx="4" ry="3" fill="black"/>
<!-- Bear mouth -->
<path d="M 95 90 Q 100 95 105 90" stroke="black" stroke-width="2" fill="none"/>
<!-- Bear arms/claws -->
<ellipse cx="60" cy="120" rx="12" ry="8" fill="url(#bearGradient)" transform="rotate(-20 60 120)"/>
<ellipse cx="140" cy="120" rx="12" ry="8" fill="url(#bearGradient)" transform="rotate(20 140 120)"/>
<!-- Bear legs -->
<rect x="80" y="165" width="12" height="20" fill="#5D4037"/>
<rect x="108" y="165" width="12" height="20" fill="#5D4037"/>
</svg>
</div>
<div class="direction">📉 ↘️</div>
<div class="term">BEARISH</div>
<div class="meaning">Pessimistic • Negative • Going DOWN!</div>
<div class="memory-tip">
🐻 Bears attack by swiping their claws <strong>DOWNWARD</strong>
</div>
</div>
</div>
<div class="quiz-section">
<h2 class="quiz-title">Test your memory!</h2>
<button class="quiz-button" id="quiz-btn">Random Quiz Question</button>
<div class="quiz-result" id="quiz-result"></div>
</div>
</div>
<script type="module">
const quizBtn = document.getElementById('quiz-btn');
const quizResult = document.getElementById('quiz-result');
const bullSvg = document.getElementById('bull-svg');
const bearSvg = document.getElementById('bear-svg');
const questions = [
{
question: "If the market is going UP and investors are optimistic, that's called...",
answer: "BULLISH 🐂📈",
explanation: "Correct! Bulls thrust upward, just like a rising market!"
},
{
question: "If the market is going DOWN and investors are pessimistic, that's called...",
answer: "BEARISH 🐻📉",
explanation: "Right! Bears swipe downward, just like a falling market!"
},
{
question: "Which animal attacks by thrusting UPWARD?",
answer: "BULL 🐂",
explanation: "Yes! Bulls use their horns to thrust upward!"
},
{
question: "Which animal attacks by swiping DOWNWARD?",
answer: "BEAR 🐻",
explanation: "Exactly! Bears use their claws to swipe downward!"
},
{
question: "If someone says 'I'm bullish on this stock', they mean...",
answer: "They think it will go UP! 📈",
explanation: "Perfect! Bullish = optimistic = expecting prices to rise!"
},
{
question: "If someone says 'I'm bearish on this market', they mean...",
answer: "They think it will go DOWN! 📉",
explanation: "Correct! Bearish = pessimistic = expecting prices to fall!"
}
];
let currentQuestion = null;
let showingAnswer = false;
let recentQuestions = []; // Keep track of recent questions
function getRandomQuestion() {
// Get available questions (exclude the last 2 shown)
const availableQuestions = questions.filter((question, index) =>
!recentQuestions.includes(index)
);
// If we've exhausted most questions, reset and just avoid the last one
if (availableQuestions.length === 0) {
recentQuestions = recentQuestions.slice(-1); // Keep only the most recent
return getRandomQuestion(); // Try again
}
// Select random question from available ones
const randomIndex = Math.floor(Math.random() * availableQuestions.length);
const selectedQuestion = availableQuestions[randomIndex];
// Find the original index of the selected question
const originalIndex = questions.indexOf(selectedQuestion);
// Add to recent questions and maintain only last 2
recentQuestions.push(originalIndex);
if (recentQuestions.length > 2) {
recentQuestions.shift(); // Remove oldest
}
return selectedQuestion;
}
function displayQuestion() {
currentQuestion = getRandomQuestion();
quizResult.innerHTML = `
<div style="font-weight: bold; color: #2c3e50; margin-bottom: 10px;">
${currentQuestion.question}
</div>
<div style="font-size: 0.9rem; color: #7f8c8d;">
Click again to see the answer!
</div>
`;
showingAnswer = false;
}
function displayAnswer() {
quizResult.innerHTML = `
<div style="font-weight: bold; color: #27ae60; margin-bottom: 8px; font-size: 1.3rem;">
${currentQuestion.answer}
</div>
<div style="color: #2c3e50;">
${currentQuestion.explanation}
</div>
`;
showingAnswer = true;
}
quizBtn.addEventListener('click', () => {
if (!currentQuestion || showingAnswer) {
displayQuestion();
quizBtn.textContent = 'Show Answer';
} else {
displayAnswer();
quizBtn.textContent = 'New Question';
}
});
// Add click animations to the animals
bullSvg.addEventListener('click', () => {
bullSvg.style.animation = 'none';
setTimeout(() => {
bullSvg.style.animation = 'bounce 0.6s ease-in-out';
}, 10);
});
bearSvg.addEventListener('click', () => {
bearSvg.style.animation = 'none';
setTimeout(() => {
bearSvg.style.animation = 'bounce 0.6s ease-in-out';
}, 10);
});
// Initialize with a welcome message
quizResult.innerHTML = `
<div style="color: #7f8c8d;">
Ready to test your knowledge? Click the button above!
</div>
`;
</script>
</body>
</html>