-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
562 lines (543 loc) · 22.5 KB
/
index.html
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Career Recommendation Quiz</title>
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js"></script>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f0e6ff;
color: #333;
line-height: 1.6;
padding: 20px;
margin: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
background-color: white;
padding: 30px;
border-radius: 15px;
box-shadow: 0 0 20px rgba(106, 13, 173, 0.1);
}
h1 {
color: #6a0dad;
text-align: center;
font-size: 2.5em;
margin-bottom: 30px;
}
.question-container {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 30px;
}
.question-image {
width: 100%;
max-width: 400px;
height: auto;
margin-bottom: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.question-content {
width: 100%;
max-width: 600px;
}
.question {
font-size: 1.2em;
margin-bottom: 20px;
color: #4a0080;
text-align: center;
}
.options {
display: flex;
flex-direction: column;
}
.option {
margin: 10px 0;
padding: 10px;
background-color: #f9f0ff;
border-radius: 5px;
transition: background-color 0.3s;
cursor: pointer;
}
.option:hover {
background-color: #e6d0ff;
}
.option input[type="radio"] {
display: none;
}
.option label {
cursor: pointer;
display: block;
width: 100%;
}
.option.selected {
background-color: #d4a6ff;
}
.button-container {
display: flex;
justify-content: flex-end;
margin-top: 20px;
}
button {
background-color: #6a0dad;
color: white;
border: none;
padding: 12px 24px;
font-size: 18px;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
}
button:hover {
background-color: #8a2be2;
}
#result {
margin-top: 30px;
}
#chart-container {
margin-top: 30px;
height: 400px;
}
.progress-container {
width: 100%;
height: 20px;
background-color: #f0e6ff;
border-radius: 10px;
margin-bottom: 20px;
overflow: hidden;
}
.progress-bar {
height: 100%;
background-color: #6a0dad;
transition: width 0.5s ease-in-out;
}
.result-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 30px;
}
.career-card {
background-color: #f9f0ff;
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.3s;
}
.career-card:hover {
transform: translateY(-5px);
}
.career-card h3 {
color: #6a0dad;
margin-top: 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Discover Your Ideal Career Path</h1>
<div class="progress-container">
<div class="progress-bar" id="progress"></div>
</div>
<div id="quiz"></div>
<div class="button-container">
<button id="next" style="display: none;">Next</button>
<button id="submit" style="display: none;">See Your Results</button>
</div>
<div id="result" style="display: none;"></div>
<div id="chart-container" style="display: none;">
<canvas id="resultChart"></canvas>
</div>
</div>
<script>
const questions = [
{
question: "How do you handle high-pressure situations?",
options: ["Thrive under pressure", "Manage well with some stress", "Prefer low-stress environments", "Struggle with high pressure"],
image: "images/pressure.png"
},
{
question: "What type of work environment do you prefer?",
options: ["Fast-paced and dynamic", "Structured and organized", "Creative and flexible", "Collaborative and team-oriented"],
image: "images/work_environment.png"
},
{
question: "How important is work-life balance to you?",
options: ["Extremely important", "Important, but can be flexible", "Not a top priority", "Willing to work long hours for career growth"],
image: "images/work_life_balance.png"
},
{
question: "Are you interested in technology and working with computers?",
options: ["Very interested", "Somewhat interested", "Neutral", "Not interested"],
image: "images/technology.png"
},
{
question: "How would you rate your communication skills?",
options: ["Excellent", "Good", "Average", "Need improvement"],
image: "images/communication.png"
},
{
question: "Do you enjoy problem-solving and analytical tasks?",
options: ["Love it", "Enjoy it", "It's okay", "Not my strength"],
image: "images/problem_solving.png"
},
{
question: "How do you feel about public speaking or presenting to groups?",
options: ["Very comfortable", "Somewhat comfortable", "Nervous but can manage", "Strongly dislike it"],
image: "images/public_speaking.png"
},
{
question: "Are you more interested in working with data or with people?",
options: ["Primarily data", "More data than people", "More people than data", "Primarily people"],
image: "images/data_vs_people.png"
},
{
question: "How important is creativity in your ideal job?",
options: ["Extremely important", "Somewhat important", "Nice to have", "Not important"],
image: "images/creativity.png"
},
{
question: "Do you prefer working independently or as part of a team?",
options: ["Strongly prefer independent work", "Prefer independent work but can collaborate", "Prefer teamwork but can work independently", "Strongly prefer teamwork"],
image: "images/teamwork.png"
},
{
question: "How comfortable are you with learning new technologies or software?",
options: ["Very comfortable and excited to learn", "Comfortable", "Somewhat uncomfortable but willing to learn", "Prefer to stick with familiar technologies"],
image: "images/learning_tech.png"
},
{
question: "How do you feel about taking on leadership roles?",
options: ["Very interested in leading", "Comfortable leading when necessary", "Prefer to follow but can lead if needed", "Not interested in leadership roles"],
image: "images/leadership.png"
},
{
question: "How important is having a varied workday with different tasks?",
options: ["Very important", "Somewhat important", "Neutral", "Prefer routine tasks"],
image: "images/varied_tasks.png"
},
{
question: "Are you interested in working with physical products or in a hands-on environment?",
options: ["Very interested", "Somewhat interested", "Neutral", "Prefer non-physical work"],
image: "images/hands_on.png"
},
{
question: "How do you approach decision-making?",
options: ["Quickly and decisively", "Carefully after thorough analysis", "Collaboratively with others", "Prefer others to make decisions"],
image: "images/decision_making.png"
}
];
const careerInfo = {
"Software Developer": {
description: "Design, develop, and maintain software applications and systems.",
skills: ["Programming", "Problem-solving", "Logical thinking"],
education: "Bachelor's degree in Computer Science or related field",
outlook: "High demand with excellent growth prospects"
},
"Data Analyst": {
description: "Interpret complex data to inform business decisions.",
skills: ["Statistical analysis", "Data visualization", "Critical thinking"],
education: "Bachelor's degree in Statistics, Mathematics, or related field",
outlook: "Growing field with increasing importance in various industries"
},
"Marketing Specialist": {
description: "Develop and implement marketing strategies to promote products or services.",
skills: ["Creativity", "Communication", "Strategic thinking"],
education: "Bachelor's degree in Marketing, Business, or related field",
outlook: "Steady growth with evolving digital marketing opportunities"
},
"Project Manager": {
description: "Plan, execute, and oversee projects to ensure they are completed on time and within budget.",
skills: ["Leadership", "Organization", "Communication"],
education: "Bachelor's degree in Business or related field, PMP certification often preferred",
outlook: "Strong demand across various industries"
},
"Teacher": {
description: "Educate students and help them develop knowledge and skills.",
skills: ["Patience", "Communication", "Adaptability"],
education: "Bachelor's degree in Education, teaching certification required",
outlook: "Stable career with consistent demand"
},
"Sales Representative": {
description: "Sell products or services to customers and businesses.",
skills: ["Persuasion", "Networking", "Resilience"],
education: "Bachelor's degree often preferred, but not always required",
outlook: "Opportunities available in various industries"
},
"Graphic Designer": {
description: "Create visual concepts using computer software or by hand.",
skills: ["Creativity", "Attention to detail", "Software proficiency"],
education: "Bachelor's degree in Graphic Design or related field",
outlook: "Competitive field with opportunities in digital media"
},
"Financial Analyst": {
description: "Provide guidance to businesses and individuals making investment decisions.",
skills: ["Analytical thinking", "Mathematical aptitude", "Attention to detail"],
education: "Bachelor's degree in Finance, Accounting, or related field",
outlook: "Good growth prospects, especially with increasing global investments"
},
"Human Resources Specialist": {
description: "Recruit, screen, interview, and place workers; handle employee relations, payroll, benefits, and training.",
skills: ["Interpersonal skills", "Organization", "Communication"],
education: "Bachelor's degree in Human Resources, Business, or related field",
outlook: "Steady growth as companies focus on employee satisfaction and retention"
},
"Entrepreneur": {
description: "Start and run your own business ventures.",
skills: ["Risk-taking", "Leadership", "Adaptability"],
education: "Varies, but business knowledge is crucial",
outlook: "Unlimited potential, but high risk"
}
};
const careerScores = Object.fromEntries(Object.keys(careerInfo).map(career => [career, 0]));
let currentQuestion = 0;
const quizContainer = document.getElementById('quiz');
const nextButton = document.getElementById('next');
const submitButton = document.getElementById('submit');
const resultContainer = document.getElementById('result');
const chartContainer = document.getElementById('chart-container');
const progressBar = document.getElementById('progress');
function displayQuestion() {
const question = questions[currentQuestion];
let html = `
<div class="question-container">
<img src="${question.image}" alt="Question Image" class="question-image">
<div class="question-content">
<div class="question"><h2>${question.question}</h2></div>
<div class="options">
`;
question.options.forEach((option, index) => {
html += `
<div class="option" data-index="${index}">
<input type="radio" name="q${currentQuestion}" value="${index}" id="q${currentQuestion}o${index}">
<label for="q${currentQuestion}o${index}">${option}</label>
</div>`;
});
html += '</div></div></div>';
quizContainer.innerHTML = html;
// Add click event listeners to options
document.querySelectorAll('.option').forEach(option => {
option.addEventListener('click', () => {
document.querySelectorAll('.option').forEach(opt => opt.classList.remove('selected'));
option.classList.add('selected');
option.querySelector('input[type="radio"]').checked = true;
});
});
if (currentQuestion === questions.length - 1) {
nextButton.style.display = 'none';
submitButton.style.display = 'block';
} else {
nextButton.style.display = 'block';
submitButton.style.display = 'none';
}
updateProgressBar();
}
function updateProgressBar() {
const progress = ((currentQuestion + 1) / questions.length) * 100;
progressBar.style.width = `${progress}%`;
}
function nextQuestion() {
const selectedOption = document.querySelector(`input[name="q${currentQuestion}"]:checked`);
if (selectedOption) {
updateScores(parseInt(selectedOption.value));
currentQuestion++;
if (currentQuestion < questions.length) {
displayQuestion();
} else {
showResults();
}
} else {
alert('Please select an option before proceeding.');
}
}
function updateScores(answerIndex) {
switch (currentQuestion) {
case 0: // High-pressure situations
if (answerIndex === 0) {
careerScores["Software Developer"] += 2;
careerScores["Project Manager"] += 2;
careerScores["Entrepreneur"] += 2;
}
break;
case 1: // Work environment
if (answerIndex === 0) {
careerScores["Sales Representative"] += 2;
careerScores["Entrepreneur"] += 2;
} else if (answerIndex === 1) {
careerScores["Financial Analyst"] += 2;
careerScores["Project Manager"] += 2;
} else if (answerIndex === 2) {
careerScores["Graphic Designer"] += 2;
careerScores["Marketing Specialist"] += 2;
}
break;
case 2: // Work-life balance
if (answerIndex === 0) {
careerScores["Teacher"] += 2;
careerScores["Human Resources Specialist"] += 2;
}
break;
case 3: // Interest in technology
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Software Developer"] += 2;
careerScores["Data Analyst"] += 2;
}
break;
case 4: // Communication skills
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Sales Representative"] += 2;
careerScores["Marketing Specialist"] += 2;
careerScores["Teacher"] += 2;
}
break;
case 5: // Problem-solving
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Software Developer"] += 2;
careerScores["Data Analyst"] += 2;
careerScores["Financial Analyst"] += 2;
}
break;
case 6: // Public speaking
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Teacher"] += 2;
careerScores["Sales Representative"] += 2;
careerScores["Marketing Specialist"] += 2;
}
break;
case 7: // Data vs People
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Data Analyst"] += 2;
careerScores["Financial Analyst"] += 2;
} else {
careerScores["Human Resources Specialist"] += 2;
careerScores["Sales Representative"] += 2;
}
break;
case 8: // Creativity
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Graphic Designer"] += 2;
careerScores["Marketing Specialist"] += 2;
}
break;
case 9: // Independent vs Team work
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Software Developer"] += 1;
careerScores["Graphic Designer"] += 1;
} else {
careerScores["Project Manager"] += 1;
careerScores["Human Resources Specialist"] += 1;
}
break;
case 10: // Learning new technologies
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Software Developer"] += 2;
careerScores["Data Analyst"] += 2;
}
break;
case 11: // Leadership roles
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Project Manager"] += 2;
careerScores["Entrepreneur"] += 2;
}
break;
case 12: // Varied workday
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Entrepreneur"] += 1;
careerScores["Project Manager"] += 1;
}
break;
case 13: // Physical products or hands-on environment
if (answerIndex === 0 || answerIndex === 1) {
careerScores["Graphic Designer"] += 1;
}
break;
case 14: // Decision-making
if (answerIndex === 0) {
careerScores["Entrepreneur"] += 2;
} else if (answerIndex === 1) {
careerScores["Financial Analyst"] += 2;
careerScores["Data Analyst"] += 2;
}
break;
}
}
function showResults() {
quizContainer.style.display = 'none';
nextButton.style.display = 'none';
submitButton.style.display = 'none';
resultContainer.style.display = 'block';
chartContainer.style.display = 'block';
const sortedCareers = Object.entries(careerScores).sort((a, b) => b[1] - a[1]);
const topCareers = sortedCareers.slice(0, 3);
let resultHTML = '<h2>Your Top Career Recommendations:</h2><div class="result-grid">';
topCareers.forEach(([career, score]) => {
const info = careerInfo[career];
resultHTML += `
<div class="career-card">
<h3>${career}</h3>
<p><strong>Description:</strong> ${info.description}</p>
<p><strong>Key Skills:</strong> ${info.skills.join(', ')}</p>
<p><strong>Education:</strong> ${info.education}</p>
<p><strong>Job Outlook:</strong> ${info.outlook}</p>
</div>
`;
});
resultHTML += '</div><p>These recommendations are based on your responses. Consider exploring these career paths further!</p>';
resultContainer.innerHTML = resultHTML;
// Create chart
const ctx = document.getElementById('resultChart').getContext('2d');
new Chart(ctx, {
type: 'bar',
data: {
labels: Object.keys(careerScores),
datasets: [{
label: 'Career Compatibility',
data: Object.values(careerScores),
backgroundColor: 'rgba(106, 13, 173, 0.7)',
borderColor: 'rgba(106, 13, 173, 1)',
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Compatibility Score'
}
},
x: {
title: {
display: true,
text: 'Career Options'
}
}
},
plugins: {
legend: {
display: false
},
title: {
display: true,
text: 'Career Compatibility Chart',
font: {
size: 18
}
}
}
}
});
}
displayQuestion();
nextButton.addEventListener('click', nextQuestion);
submitButton.addEventListener('click', showResults);
</script>
</body>
</html>