forked from shalonjovan/VidyaGyan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexams.html
More file actions
500 lines (447 loc) · 26.1 KB
/
Copy pathexams.html
File metadata and controls
500 lines (447 loc) · 26.1 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VidyaGyan - Exams</title>
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<script src="translate.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #c8d8f0;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Custom CSS for the Chatbot Button */
#chatbot-button {
position: fixed;
bottom: 50px;
right: 50px;
width: 90px;
height: 90px;
border-radius: 50%;
overflow: hidden;
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
cursor: pointer;
transition: all 0.3s ease;
border: 3px solid #6366f1;
}
#chatbot-button:hover {
transform: scale(1.1);
box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}
#chatbot-button img {
width: 90%;
height: 90%;
object-fit: contain;
border-radius: 50%;
}
/* Custom CSS for the page content */
.exam-card {
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.exam-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.filter-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.sidebar {
width: 250px;
transform: translateX(-100%);
transition: transform 0.3s ease-in-out;
}
.sidebar.open {
transform: translateX(0);
}
</style>
</head>
<body class="bg-[#c8d8f0] flex flex-col min-h-screen">
<!-- Header Navigation Bar -->
<header class="relative z-20 w-full p-2 flex justify-between items-center text-white bg-gray-900">
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<div class="flex items-center space-x-2">
<!-- Mobile Menu Button -->
<button id="menu-btn" class="text-white focus:outline-none md:hidden">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16m-7 6h7"></path>
</svg>
</button>
<!-- Logo and Site Name -->
<div class="flex items-center space-x-2">
<a href="index.html">
<img src="./assets/mainlogo.png" alt="VidyaGyan Logo" class="w-10 h-10">
</a>
<span class="text-3xl font-bold text-white">VidyaGyan</span>
</div>
</div>
<!-- Desktop Navigation Links -->
<nav class="hidden md:flex items-center space-x-4 text-base">
<a href="career_paths.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Career Paths</a>
<a href="roadmaps/roadmap.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Roadmaps</a>
<a href="colleges.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Colleges</a>
<a href="exams.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Exams</a>
<a href="resources.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Resources</a>
<a href="study_groups.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Study Groups</a>
<a href="scholarship.html"
class="text-white px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">Scholarships</a>
</nav>
<!-- Action Buttons (Home, Profile, and For You) -->
<div class="hidden md:flex items-center space-x-4">
<a href="home.html"
class="flex items-center space-x-2 text-white hover:text-gray-200 px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">
<!-- Home Icon -->
<img src="assets/home.png" alt="Home" class="w-8 h-8">
</a>
<a href="profile.html"
class="flex items-center space-x-2 text-white hover:text-gray-200 px-3 py-2 rounded-lg hover:bg-gray-800 transition-colors duration-200">
<!-- Profile Icon -->
<img src="assets/profile.jpg" alt="Profile" class="w-8 h-8">
</a>
<a href="foryou.html"
class="text-sm px-6 py-3 rounded-full border-2 border-blue-500 text-blue-500 hover:text-white hover:bg-blue-500 transition-colors duration-300">For You</a>
</div>
</header>
<main class="w-full flex-grow">
<div class="max-w-7xl mx-auto p-4 sm:p-8">
<div class="text-center mb-10">
<h1 class="text-4xl font-extrabold text-slate-800">Entrance Examinations</h1>
<p class="text-lg text-slate-500 mt-2">Explore entrance exams for various educational programs.</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md mb-8 sticky top-4 z-10 flex flex-col gap-4">
<div class="w-full">
<input type="text" id="search-input" placeholder="Search by exam name or course..." class="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="w-full filter-grid">
<select id="background-filter" class="w-full px-4 py-3 rounded-lg border-2 border-gray-200 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">All Backgrounds</option>
</select>
<select id="month-filter" class="w-full px-4 py-3 rounded-lg border-2 border-gray-200 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">All Months</option>
</select>
<select id="course-filter" class="w-full px-4 py-3 rounded-lg border-2 border-gray-200 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">All Courses</option>
</select>
</div>
</div>
<div id="exam-grid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"></div>
<div id="no-results" class="hidden text-center py-16">
<p class="text-xl text-slate-500">No exams found matching your criteria.</p>
</div>
</div>
</main>
<!-- Sidebar Menu (Mobile) -->
<nav id="sidebar" class="sidebar fixed top-0 left-0 h-full bg-white bg-opacity-80 backdrop-filter backdrop-blur-lg z-30 shadow-lg md:hidden">
<div class="p-6">
<h2 class="text-xl font-bold mb-4">Menu</h2>
<ul class="space-y-4">
<li><a href="index.html" class="block p-2 rounded-lg text-gray-800 hover:bg-blue-100 transition-colors duration-200">Home</a></li>
<li><a href="colleges.html" class="block p-2 rounded-lg text-gray-800 hover:bg-blue-100 transition-colors duration-200">College Directory</a></li>
<li><a href="career_paths.html" class="block p-2 rounded-lg text-gray-800 hover:bg-blue-100 transition-colors duration-200">Career Paths</a></li>
<li><a href="roadmaps/roadmap.html" class="block p-2 rounded-lg text-gray-800 hover:bg-blue-100 transition-colors duration-200">Roadmaps</a></li>
<li><a href="study_groups.html" class="block p-2 rounded-lg text-gray-800 hover:bg-blue-100 transition-colors duration-200">Study Groups</a></li>
<li><a href="resources.html" class="block p-2 rounded-lg text-gray-800 hover:bg-blue-100 transition-colors duration-200">Study Materials</a></li>
</ul>
</div>
</nav>
<script>
// Make createGoogleCalendarLink globally accessible
function createGoogleCalendarLink(exam) {
const parseExamDate = (dateStr) => {
if (dateStr.includes("2025")) {
const months = {
"January": "01", "February": "02", "March": "03", "April": "04",
"May": "05", "June": "06", "July": "07", "August": "08",
"September": "09", "October": "10", "November": "11", "December": "12"
};
const match = dateStr.match(/(\d{1,2})\w*\s+(\w+),?\s*2025/);
if (match) {
const day = match[1].padStart(2, '0');
const monthName = match[2];
const month = months[monthName];
if (month) {
return `2025-${month}-${day}`;
}
}
}
return null;
};
const examDate = parseExamDate(exam["Tentative Date"]);
if (!examDate) {
// Using a custom message box instead of alert()
const modal = document.createElement('div');
modal.className = 'fixed inset-0 bg-gray-900 bg-opacity-75 flex items-center justify-center z-[100]';
modal.innerHTML = `
<div class="bg-white p-8 rounded-lg shadow-xl text-center">
<p class="text-lg font-semibold mb-4">Unable to determine exact date for this exam.</p>
<p class="text-sm text-gray-600 mb-6">Please check the exam details and add to your calendar manually.</p>
<button onclick="this.parentNode.parentNode.remove()" class="px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">OK</button>
</div>
`;
document.body.appendChild(modal);
return;
}
const title = encodeURIComponent(`${exam.Examination} - Entrance Exam`);
const details = encodeURIComponent(
`Examination: ${exam.Examination}\n\n` +
`Purpose: ${exam.examination_for}\n\n` +
`Background Required: ${exam.background}\n\n` +
`Marking Scheme: ${exam.marking_scheme}\n\n` +
`Registration: ${exam.exam_registration_link}`
);
const startDateTime = `${examDate}T09:00:00`;
const endDateTime = `${examDate}T12:00:00`;
const googleCalendarUrl = `https://calendar.google.com/calendar/render?action=TEMPLATE&text=${title}&dates=${startDateTime.replace(/[-:]/g, '')}/${endDateTime.replace(/[-:]/g, '')}&details=${details}&location=Exam Center (TBD)&sf=true&output=xml`;
window.open(googleCalendarUrl, '_blank');
}
document.addEventListener('DOMContentLoaded', () => {
const examGrid = document.getElementById('exam-grid');
const searchInput = document.getElementById('search-input');
const noResults = document.getElementById('no-results');
// Filter elements
const filterSelects = {
background: document.getElementById('background-filter'),
month: document.getElementById('month-filter'),
course: document.getElementById('course-filter')
};
const menuBtn = document.getElementById('menu-btn');
const sidebar = document.getElementById('sidebar');
menuBtn.addEventListener('click', () => {
sidebar.classList.toggle('open');
});
let allExams = [];
// Function to extract month from date string
function extractMonth(dateStr) {
const monthMatch = dateStr.match(/\b(January|February|March|April|May|June|July|August|September|October|November|December)\b/i);
return monthMatch ? monthMatch[1] : null;
}
async function fetchExams() {
try {
const response = await fetch('./exams.json');
allExams = await response.json();
populateFilters();
renderExams(allExams);
} catch (error) {
console.error('Failed to fetch exam data:', error);
examGrid.innerHTML = `<p class="text-red-500 col-span-full text-center">Could not load exam data. Please check if exams.json file exists.</p>`;
}
}
function populateFilters() {
const filtersData = {
background: [...new Set(allExams.map(e => e.background))],
month: [...new Set(allExams.map(e => extractMonth(e["Tentative Date"])).filter(month => month !== null))],
course: [...new Set(allExams.map(e => e.examination_for))]
};
// Sort months in chronological order
const monthOrder = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
filtersData.month.sort((a, b) => monthOrder.indexOf(a) - monthOrder.indexOf(b));
for (const key in filtersData) {
filtersData[key].forEach(value => {
const option = document.createElement('option');
option.value = value;
option.textContent = value;
filterSelects[key].appendChild(option);
});
}
}
function parseExamDate(dateStr) {
if (dateStr.includes("2025")) {
const months = {
"January": "01", "February": "02", "March": "03", "April": "04",
"May": "05", "June": "06", "July": "07", "August": "08",
"September": "09", "October": "10", "November": "11", "December": "12"
};
const match = dateStr.match(/(\d{1,2})\w*\s+(\w+),?\s*2025/);
if (match) {
const day = match[1].padStart(2, '0');
const monthName = match[2];
const month = months[monthName];
if (month) {
return `2025-${month}-${day}`;
}
}
}
return null;
}
function renderExams(exams) {
examGrid.innerHTML = '';
noResults.classList.toggle('hidden', exams.length > 0);
exams.forEach(e => {
const card = document.createElement('div');
card.className = 'exam-card bg-white p-6 rounded-xl shadow-sm border border-gray-200 flex flex-col';
const dateColor = e["Tentative Date"].includes("2025") ? "text-green-600" : "text-orange-600";
const hasValidDate = parseExamDate(e["Tentative Date"]) !== null;
card.innerHTML = `
<div class="flex-grow">
<h3 class="text-xl font-bold text-slate-800 mb-2">${e.Examination}</h3>
<p class="text-md font-semibold ${dateColor} mb-4">📅 ${e["Tentative Date"]}</p>
<p class="text-sm text-slate-600 mb-4"><span class="font-semibold">For:</span> ${e.examination_for}</p>
<div class="mb-4">
<p class="text-sm text-slate-700 mb-2"><span class="font-semibold">Background:</span></p>
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm font-medium">${e.background}</span>
</div>
<div class="mb-4">
<p class="text-sm text-slate-700 mb-1"><span class="font-semibold">Marking Scheme:</span></p>
<p class="text-sm text-slate-600">${e.marking_scheme}</p>
</div>
<div class="mb-4">
<p class="text-sm text-slate-700 mb-1"><span class="font-semibold">Marks Distribution:</span></p>
<p class="text-sm text-slate-600">${e.mark_split_up}</p>
</div>
</div>
<div class="mt-6 space-y-3">
<a href="${e.exam_registration_link}" target="_blank" class="block w-full text-center bg-blue-600 text-white font-bold py-3 px-4 rounded-lg hover:bg-blue-700 transition-colors">
Register Now
</a>
${hasValidDate ? `
<button onclick="createGoogleCalendarLink(${JSON.stringify(e).replace(/"/g, '"')})" class="w-full text-center bg-green-600 text-white font-bold py-3 px-4 rounded-lg hover:bg-green-700 transition-colors flex items-center justify-center gap-2">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd"/>
</svg>
Add to Google Calendar
</button>
` : `
<button disabled class="w-full text-center bg-gray-400 text-white font-bold py-3 px-4 rounded-lg cursor-not-allowed flex items-center justify-center gap-2">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd"/>
</svg>
Date TBD
</button>
`}
</div>
`;
examGrid.appendChild(card);
});
}
function applyFilters() {
const searchTerm = searchInput.value.toLowerCase();
const selectedFilters = {
background: filterSelects.background.value,
month: filterSelects.month.value,
course: filterSelects.course.value
};
const filteredExams = allExams.filter(e => {
const matchesSearch = e.Examination.toLowerCase().includes(searchTerm) ||
e.examination_for.toLowerCase().includes(searchTerm) ||
e.background.toLowerCase().includes(searchTerm);
const matchesAllFilters = Object.keys(selectedFilters).every(key => {
if (!selectedFilters[key]) return true;
switch(key) {
case 'background':
return e.background === selectedFilters[key];
case 'month':
return extractMonth(e["Tentative Date"]) === selectedFilters[key];
case 'course':
return e.examination_for === selectedFilters[key];
default:
return true;
}
});
return matchesSearch && matchesAllFilters;
});
renderExams(filteredExams);
}
searchInput.addEventListener('keyup', applyFilters);
Object.values(filterSelects).forEach(select => {
select.addEventListener('change', applyFilters);
});
fetchExams();
});
</script>
<!-- Chatbot Button -->
<a href="chat.html" id="chatbot-button" title="Chat with us!">
<img src="./assets/images/chat.jpeg" alt="Chatbot" />
</a>
<!-- Footer -->
<footer class="bg-gray-900 text-gray-300 p-6 pt-10 mt-16">
<div class="container mx-auto grid grid-cols-1 md:grid-cols-5 gap-8">
<!-- Logo Column (spans full height) -->
<div class="col-span-1 flex justify-center items-center">
<img src="./assets/mainlogo.png" alt="VidyaGyan Logo" class="w-75 h-60">
</div>
<!-- VidyaGyan Info Column -->
<div class="col-span-1 flex flex-col">
<h3 class="text-white font-bold text-xl mb-2">VidyaGyan</h3>
<p class="text-gray-400 text-sm mb-6">Your all-in-one platform for academic and career guidance.</p>
<div class="mb-4">
<h4 class="text-white font-semibold text-lg mb-2">Blastorz</h4>
<div class="flex space-x-2 items-center mb-2">
<svg class="w-4 h-4 text-gray-400" fill="currentColor" viewBox="0 0 24 24">
<path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/>
</svg>
<a href="mailto:team.blastorz@gmail.com" class="text-gray-400 hover:text-white text-sm transition-colors duration-200">
team.blastorz@gmail.com
</a>
</div>
<div class="flex space-x-2 items-center">
<svg class="w-4 h-4 text-gray-400" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
</svg>
<a href="members.html" class="text-gray-400 hover:text-white text-sm transition-colors duration-200">
Team Blastorz Info
</a>
</div>
</div>
</div>
<!-- Navigation Column -->
<div class="col-span-1">
<h4 class="text-white font-semibold text-lg mb-4">Navigation</h4>
<ul class="space-y-3">
<li><a href="home.html" class="text-gray-300 hover:text-white transition-colors duration-200">Home</a></li>
<li><a href="profile.html" class="text-gray-300 hover:text-white transition-colors duration-200">Profile</a></li>
<li><a href="foryou.html" class="text-gray-300 hover:text-white transition-colors duration-200">For You</a></li>
</ul>
</div>
<!-- Resources Column -->
<div class="col-span-1">
<h4 class="text-white font-semibold text-lg mb-4">Resources</h4>
<ul class="space-y-3">
<li><a href="colleges.html" class="text-gray-300 hover:text-white transition-colors duration-200">Colleges</a></li>
<li><a href="career_paths.html" class="text-gray-300 hover:text-white transition-colors duration-200">Career Paths</a></li>
<li><a href="roadmaps/roadmap.html" class="text-gray-300 hover:text-white transition-colors duration-200">Roadmaps</a></li>
<li><a href="exams.html" class="text-gray-300 hover:text-white transition-colors duration-200">Entrance Exams</a></li>
<li><a href="resources.html" class="text-gray-300 hover:text-white transition-colors duration-200">Study Materials</a></li>
<li><a href="scholarship.html" class="text-gray-300 hover:text-white transition-colors duration-200">Scholarships</a></li>
</ul>
</div>
<!-- Community & Account Column -->
<div class="col-span-1">
<h4 class="text-white font-semibold text-lg mb-4">Community & Account</h4>
<ul class="space-y-3">
<li><a href="login.html" class="text-gray-300 hover:text-white transition-colors duration-200">Login</a></li>
<li><a href="signup.html" class="text-gray-300 hover:text-white transition-colors duration-200">Sign Up</a></li>
<li><a href="study_groups.html" class="text-gray-300 hover:text-white transition-colors duration-200">Study Groups</a></li>
</ul>
</div>
</div>
<!-- Copyright -->
<div class="border-t border-gray-700 mt-6 pt-3 text-center">
<p class="text-gray-400 text-sm">
Copyright © 2025 - Team Blastorz 💥
</p>
</div>
</footer>
</body>
</html>