-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcgpaccalculator.html
More file actions
306 lines (262 loc) · 9.88 KB
/
Copy pathcgpaccalculator.html
File metadata and controls
306 lines (262 loc) · 9.88 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CGPA Calculator | IITM BSYATRA</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet" />
<style>
@import url("https://fonts.googleapis.com/css2?family=Inter&display=swap");
/* --- Styles from your navbar and footer preserved --- */
.nav-3d {
background: #000;
border-radius: 1rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.9), inset 0 0 10px #4db8ff, 0 0 15px #4db8ff;
transition: box-shadow 0.3s ease;
perspective: 800px;
transform-style: preserve-3d;
}
.nav-3d a {
text-shadow: 0 0 5px #4db8ff, 0 0 10px #4db8ff;
transition: transform 0.3s ease, text-shadow 0.3s ease;
display: inline-block;
transform-style: preserve-3d;
will-change: transform;
cursor: pointer;
}
.nav-3d a:hover {
text-shadow: 0 0 15px #4db8ff, 0 0 25px #4db8ff, 0 0 35px #1a8cff;
transform: translateZ(15px) scale(1.1);
}
.nav-3d a.login-btn {
background: linear-gradient(145deg, #4db8ff, #1a8cff);
box-shadow: 0 5px 15px #4db8ff, inset 0 0 8px #1a8cff;
color: black;
text-shadow: none;
}
.nav-3d a.login-btn:hover {
background: linear-gradient(145deg, #1a8cff, #4db8ff);
box-shadow: 0 7px 20px #1a8cff, inset 0 0 10px #4db8ff;
transform: translateZ(20px) scale(1.1);
}
.icon-3d {
position: relative;
width: 40px;
height: 40px;
border-radius: 0.75rem;
background: linear-gradient(135deg, #4f46e5, #7c3aed);
box-shadow: 0 0 10px #7c3aed, 0 0 20px #8b5cf6, 0 0 30px #a78bfa, inset 0 0 10px #c4b5fd;
display: flex;
align-items: center;
justify-content: center;
filter: drop-shadow(0 0 10px #7c3aed);
transform-style: preserve-3d;
transform: rotateX(15deg) rotateY(15deg);
transition: transform 0.3s ease;
}
.icon-3d:hover {
transform: rotateX(0deg) rotateY(0deg) scale(1.05);
}
.shine {
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(120deg,
rgba(255, 255, 255, 0) 30%,
rgba(255, 255, 255, 0.3) 50%,
rgba(255, 255, 255, 0) 70%);
transform: rotate(25deg);
animation: shineMove 3s infinite;
pointer-events: none;
border-radius: 1rem;
mix-blend-mode: screen;
}
@keyframes shineMove {
0% {
transform: translateX(-100%) rotate(25deg);
}
100% {
transform: translateX(100%) rotate(25deg);
}
}
.footer {
background: #0f172a;
color: #ffffff;
font-family: 'Inter', sans-serif;
padding: 4rem 2rem;
}
.footer-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 2.5rem;
max-width: 1280px;
margin: 0 auto;
}
.footer-logo,
.footer-socials,
.footer-section,
.footer-contact {
margin-bottom: 1.5rem;
}
.footer-bottom {
border-top: 1px solid #334155;
margin-top: 3rem;
padding-top: 1.5rem;
font-size: 0.8rem;
text-align: center;
color: #64748b;
}
.footer-bottom div a {
margin: 0 1rem;
color: #64748b;
}
.footer-bottom div a:hover {
color: #60a5fa;
}
</style>
</head>
<body class="bg-black text-white font-['Inter']">
<!-- NAVBAR -->
<nav class="max-w-7xl mx-auto my-4 px-6 py-3 flex items-center justify-between nav-3d">
<div class="flex items-center space-x-4">
<div class="icon-3d relative">
<img alt="Logo" src="https://storage.googleapis.com/a1aa/image/9d9826d9-ba7e-4744-b31c-55af136d1872.jpg"
width="40" height="40" />
<div class="shine"></div>
</div>
<div class="leading-tight select-none">
<h1 class="text-white text-lg font-bold tracking-wide">IITM</h1>
<h2 class="text-white text-sm tracking-widest">BSYATRA</h2>
</div>
</div>
<div class="flex space-x-8">
<a class="text-white text-lg font-normal font-['Inter']" href="index.html">Home</a>
<a class="text-white text-lg font-normal font-['Inter']" href="#">Quiz </a>
<a class="text-white text-lg font-normal font-['Inter']" href="resources.html">Resources</a>
<a class="text-white text-lg font-normal font-['Inter']" href="tool.html">Tools</a>
<a class="text-white text-lg font-normal font-['Inter']" href="#">About Us</a>
</div>
<a class="text-lg font-semibold rounded-lg px-6 py-2 login-btn" href="#">Log In</a>
</nav>
<!-- MAIN SECTION: CGPA CALCULATOR -->
<main class="max-w-3xl mx-auto px-6 py-10 bg-gray-900 rounded-xl shadow-xl mt-10 mb-16">
<h2 class="text-3xl font-bold mb-6 text-center text-blue-400">CGPA Calculator</h2>
<p class="text-gray-300 mb-4">Enter your academic details below to calculate your total CGPA.</p>
<form id="cgpaForm" class="space-y-5">
<div>
<label class="block text-gray-300">Previous Term CGPA (0 if none):</label>
<input type="number" step="0.01" id="lastCgpa" placeholder="e.g., 8.23"
class="w-full p-2 rounded bg-gray-800 text-white border border-blue-500" required />
</div>
<div>
<label class="block text-gray-300">Total Subjects Completed till Last Term:</label>
<input type="number" id="completedSubjects" placeholder="e.g., 8"
class="w-full p-2 rounded bg-gray-800 text-white border border-blue-500" required />
</div>
<div>
<label class="block text-gray-300">Grades this Term (comma-separated, e.g., A,B,C):</label>
<input type="text" id="grades" placeholder="S, A, B, C etc."
class="w-full p-2 rounded bg-gray-800 text-white border border-blue-500" required />
</div>
<div>
<label class="block text-gray-300">Number of Subjects in Current Term:</label>
<input type="number" id="currentSubjects" placeholder="e.g., 4"
class="w-full p-2 rounded bg-gray-800 text-white border border-blue-500" required />
</div>
<button type="submit"
class="w-full py-2 bg-blue-600 hover:bg-blue-700 rounded text-white font-bold transition">Calculate</button>
</form>
<h3 class="mt-6 text-xl font-semibold text-center">Your Total CGPA: <span id="result" class="text-blue-400">-</span>
</h3>
</main>
<!-- SCRIPT -->
<script>
const gradePoints = {
'S': 10, 'A': 9, 'B': 8, 'C': 7, 'D': 6, 'E': 5, 'F': 0
};
document.getElementById('cgpaForm').addEventListener('submit', function (e) {
e.preventDefault();
const lastCgpa = parseFloat(document.getElementById('lastCgpa').value);
const completedSubjects = parseInt(document.getElementById('completedSubjects').value);
const gradesInput = document.getElementById('grades').value.trim().toUpperCase();
const currentSubjects = parseInt(document.getElementById('currentSubjects').value);
const grades = gradesInput.split(',').map(g => g.trim());
if (grades.length !== currentSubjects) {
alert("Number of grades and subjects must match!");
return;
}
let totalPoints = lastCgpa * completedSubjects;
for (let grade of grades) {
if (!gradePoints.hasOwnProperty(grade)) {
alert("Invalid grade: " + grade);
return;
}
totalPoints += gradePoints[grade];
}
const totalSubjects = completedSubjects + currentSubjects;
const cgpa = (totalPoints / totalSubjects).toFixed(2);
document.getElementById('result').innerText = cgpa;
});
</script>
</body>
<footer class="footer">
<div class="footer-container">
<!-- LOGO Section -->
<div class="footer-brand">
<div class="footer-logo">
<img alt="Logo" src="https://storage.googleapis.com/a1aa/image/9d9826d9-ba7e-4744-b31c-55af136d1872.jpg" />
<h2>IITM BSYATRA</h2>
</div>
<p>A platform by IITM BS students to help you <span>learn smarter</span>.</p>
</div>
<!-- Socials -->
<div class="footer-socials">
<a href="#"><i class="fab fa-linkedin"></i> LinkedIn</a>
<a href="#"><i class="fab fa-youtube"></i> YouTube</a>
</div>
<!-- Sections -->
<div class="footer-section">
<h3>Quiz Prep</h3>
<ul>
<li><a href="#">Quiz Simulator</a></li>
<li><a href="#">Previous Year Papers</a></li>
</ul>
</div>
<div class="footer-section">
<h3>Resources</h3>
<ul>
<li><a href="#">Lectures</a></li>
<li><a href="#">Notes</a></li>
</ul>
</div>
<div class="footer-section">
<h3>DS Documents</h3>
<ul>
<li><a href="IITM BS Degree Programme - Student Handbook (Updated 08052025) - Student version.html">DS
Handbook</a></li>
<li><a href="BS-DS_ May 2025 Grading document (Student).html">DS Grading doc</a></li>
</ul>
</div>
<div class="footer-section">
<h3>Tools</h3>
<ul>
<li><a href="#">Grade Predictor</a></li>
<li><a href="#">Grade Calculator</a></li>
</ul>
</div>
<div class="footer-contact">
<h3>Contact</h3>
<p>Email: <a href="mailto:founder@bsyatra.in">founder@bsyatra.in</a></p>
</div>
</div> <!-- 👈 this was missing -->
<!-- Bottom Bar -->
<div class="footer-bottom">
<div>
© 2025 IITM BS Yatra. All rights reserved.| Built with <span class="text-red-500">❤</span> by IITM BS Students(Arpit Verma)
</div>
</div>
</footer>
</html>