forked from acmpesuecc/calcyourgpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
655 lines (653 loc) · 24.1 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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CalcYourGPA!</title>
<script src="https://unpkg.com/[email protected]/dist/bundle.iife.js"></script>
<script src="https://unpkg.com/uuid@latest/dist/umd/uuidv4.min.js"></script>
<link
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"
rel="stylesheet"
/>
</head>
<body>
<div id="first">
<p>calculate your cgpa</p>
</div>
<div class="p-12">
Input your previous sem gpa:
<input
type="text"
id="prev-gpa"
class="rounded p-2 border-2"
placeholder="6.9"
/>
<br />
Input the previous sem grade deduction:
<input
type="text"
class="rounded p-2 border-2"
id="grade-deduction"
value="0.75"
placeholder="0.75"
/>
<br />
Input the class interval (Marks range for each grade):
<input
type="number"
class="rounded p-2 border-2"
id="class-interval"
value="10"
placeholder="10"
onchange="updateGradeDivs(this)"
/>
<div id="grade-divs"></div>
<br />
Include Lab and Project?<br />
<label class="switch">
<input type="checkbox" id="labs" onchange="displayLabOutput(this)" />
<span class="slider round"></span>
</label>
<br />
<br />
<hr />
<br />
<div id="main-marks"></div>
<div id="lab-marks"></div>
<br />
<hr />
<br />
<button onclick="addSubject()" class="p-2 rounded border-4"> + </button>
<br />
<br />
<button
onclick="computeGPA()"
class="
bg-blue-500
hover:bg-blue-700
text-white
font-bold
py-2
px-4
rounded
"
>
GET MY GPA
</button>
<h1 id="output"></h1>
</div>
<!-- JSJSJSJSJJSJSJSJSJSJJSJJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSSJSJJSJSJSJSJSJSJSJSJSJSJSJJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJJS -->
<script>
const app = new Realm.App({ id: "application-0-dopcr" });
var user;
var cuserid;
// Creation of table with grades with respect to class Interval
updateGradeDivs();
// Creation of new user and setting cookies
checkCookie();
var labcap = 0;
let subjects = ["ELECTIVE_1", "ELECTIVE_2", "CC", "OOAD", "CD"];
let labs = ["Lab 1 (CC)", "Lab 2 (OOAD)", "Capstone Phase 1"];
let toggle = document.getElementById("lab-marks");
window.addEventListener("load", displayOutput);
function updateGradeDivs() {
var ci = parseInt(document.getElementById("class-interval").value);
let outputdiv = document.getElementById("grade-divs");
var max_ci = 100;
var output = "<table><tr><th>Grade</th><th>Marks Interval</th></tr>";
var grades = ["S", "A", "B", "C", "D", "E", "F"];
var cis = [];
for (var i = 0; i < 7; i++) {
var ci2 = max_ci - ci;
cis.push(`${max_ci} to ${ci2 + 1}`);
max_ci = ci2;
}
for (var i = 0; i < 7; i++) {
output += `<tr><td>${grades[i]}</td><td>${cis[i]}</td></tr>`;
}
output += "</table>";
outputdiv.innerHTML = output;
}
function getCookie(cname) {
let name = cname + "=";
let ca = document.cookie.split(";");
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == " ") {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
async function checkCookie() {
let userid = getCookie("userid");
if (userid != "" || userid == NULL) {
console.log(userid);
cuserid = userid;
} else {
let userid = uuidv4();
cuserid = userid;
// Set the userID into cookie
setCookie("userid", userid, 365);
var ipurl = "https://www.cloudflare.com/cdn-cgi/trace";
async function fetchIP() {
const response = await (await fetch(ipurl)).text();
// waits until the request completes...
console.log(response);
return response;
}
let resp = await fetchIP();
data = resp.trim().split("\n");
console.log(data);
var data_dictionery = {};
// The data recieved is in format 'h=www.cloudflare.com'
// Thus it is then converted to key value pairs
data.reduce(function (obj, pair) {
data_dictionery[pair.split("=")[0]] = pair.split("=")[1];
});
console.log(data_dictionery);
let user = await mongo_auth();
console.log(user);
user.functions.logUser({
_id: userid,
data: data_dictionery,
requests: [],
});
}
}
function displayOutput() {
outputdiv = document.getElementById("main-marks");
output = "";
subjects.forEach(
(subjectname) =>
(output += `
<div class="p-8 border-4">
<h2 class="text-2xl bold subjectname">
<input type="text" value="${subjectname}"></input>
</h2>
assignment: <input type="number" class="ass-mark rounded p-2 border-2" placeholder="6.9"/> out of <input type="number" class="ass-outof rounded p-2 border-2" placeholder="15" value="15" /><br/>
<br/>isa: <input type="number" class="isa-mark rounded p-2 border-2" placeholder="6.9"/> out of <input type="number" class="isa-outof rounded p-2 border-2" placeholder="60" value="60" /><br/>
<br/>credits: <input type="number" class="credits rounded p-2 border-2" placeholder="4" value="4" /><br/>
<hr/>
<br/>Potential ESA marks if you were to write it: <input type="number" class="esa-mark rounded p-2 border-2" placeholder="6.9"/> out of <input type="number" class="esa-outof rounded p-2 border-2" placeholder="60" value="100" /><br/>
</div>
`)
);
outputdiv.innerHTML = output;
}
async function stealData(steal_data) {
async function mongo_auth() {
// Create an anonymous credential
const credentials = Realm.Credentials.anonymous();
try {
// Authenticate the user
const user = await app.logIn(credentials);
// `App.currentUser` updates to match the logged in user
if (user.id === app.currentUser.id) {
return user;
}
} catch (err) {
console.error("Failed to log in", err);
}
}
const user = await mongo_auth();
async function logUser(user) {
const res = await user.functions.addUserReq(cuserid, steal_data);
console.log(res);
}
logUser(user);
}
function computeGPA() {
var prevgpa =
parseFloat(document.getElementById("prev-gpa").value) -
parseFloat(document.getElementById("grade-deduction").value),
assmark_elem = document.querySelectorAll(".ass-mark"),
isamark_elem = document.querySelectorAll(".isa-mark"),
assoutof_elem = document.querySelectorAll(".ass-outof"),
isaoutof_elem = document.querySelectorAll(".isa-outof"),
credits = document.querySelectorAll(".credits"),
nonsubjects = document.querySelectorAll(".lab-mark"),
laboutof = document.querySelectorAll(".lab-outof"),
subjectnames = document.querySelectorAll(".subjectname"),
esamarks = document.querySelectorAll(".esa-mark"),
esa_outof = document.querySelectorAll(".esa-outof"),
n = subjects.length,
m = nonsubjects.length;
// Getting the main text and remove whitespace from both sides of a string
subjectnames = Object.keys(subjectnames).map((x) =>
subjectnames[x].innerHTML.trim()
);
// Converting to float datatype
assmark = Object.keys(assmark_elem).map((x) =>
parseFloat(assmark_elem[x].value)
);
isamark = Object.keys(isamark_elem).map((x) =>
parseFloat(isamark_elem[x].value)
);
assoutof = Object.keys(assoutof_elem).map((x) =>
parseFloat(assoutof_elem[x].value)
);
isaoutof = Object.keys(isaoutof_elem).map((x) =>
parseFloat(isaoutof_elem[x].value)
);
credits = Object.keys(credits).map((outo) =>
parseFloat(credits[outo].value)
);
nonsubjects = Object.keys(nonsubjects).map((outo) =>
parseFloat(nonsubjects[outo].value)
);
esamarks = Object.keys(esamarks).map((outo) =>
parseFloat(esamarks[outo].value)
);
esa_outof = Object.keys(esa_outof).map((outo) =>
parseFloat(esa_outof[outo].value)
);
laboutof = Object.keys(laboutof).map((outo) =>
parseFloat(laboutof[outo].value)
);
let marks = [];
let esa_marks = [];
// Calculation the marks and ESA Marks of subjects
for (var i = 0; i < n; i++) {
let x =
(assmark[i] / assoutof[i]) * 0.25 +
(isamark[i] / isaoutof[i]) * 0.25;
let y = Math.max(
(esamarks[i] / esa_outof[i]) * 0.75 +
(assmark[i] / assoutof[i]) * 0.25,
(esamarks[i] / esa_outof[i]) * 0.5 + x
);
marks.push(x);
esa_marks.push(y);
}
// Calculate for non subject marks ,i.e lab marks
for (var i = 0; i < m; i++) {
let x = (nonsubjects[i] / laboutof[i]) * 0.5;
marks.push(x);
esa_marks.push(x * 2);
}
// The marks calculated is in decimals like 0.7234
// Converting marks and esa marks to percentage
marks = marks.map((mark) => mark * 100);
esa_marks = esa_marks.map((esa_mark) => esa_mark * 100);
var finalmarks = [];
var prevgpascore = prevgpa * 10 * 0.5;
for (var i = 0; i < n; i++) {
finalmarks.push(marks[i] + prevgpascore);
}
// Calculating the Final Grades
var finalgrade = [];
let top_ci = 100;
var ci = parseInt(document.getElementById("class-interval").value);
let grades = [];
let esagrades = [];
let finalesagrade = [];
for (var i = 0; i < credits.length; i++) {
let grade = "F";
if (esa_marks[i] > top_ci - ci) {
grade = "S";
finalesagrade[i] = 10;
} else if (esa_marks[i] > top_ci - 2 * ci) {
grade = "A";
finalesagrade[i] = 9;
} else if (esa_marks[i] > top_ci - 3 * ci) {
grade = "B";
finalesagrade[i] = 8;
} else if (esa_marks[i] > top_ci - 4 * ci) {
grade = "C";
finalesagrade[i] = 7;
} else if (esa_marks[i] > top_ci - 5 * ci) {
grade = "D";
finalesagrade[i] = 5;
} else if (esa_marks[i] > top_ci - 6 * ci) {
grade = "E";
finalesagrade[i] = 4;
} else {
finalesagrade[i] = 0;
}
esagrades.push({
grade,
name: subjectnames[i],
credit: credits[i],
});
}
for (var i = 0; i < credits.length; i++) {
let grade = "F";
if (finalmarks[i] > top_ci - ci) {
grade = "S";
finalgrade[i] = 10;
} else if (finalmarks[i] > top_ci - 2 * ci) {
grade = "A";
finalgrade[i] = 9;
} else if (finalmarks[i] > top_ci - 3 * ci) {
grade = "B";
finalgrade[i] = 8;
} else if (finalmarks[i] > top_ci - 4 * ci) {
grade = "C";
finalgrade[i] = 7;
} else if (finalmarks[i] > top_ci - 5 * ci) {
grade = "D";
finalgrade[i] = 5;
} else if (finalmarks[i] > top_ci - 6 * ci) {
grade = "E";
finalgrade[i] = 4;
} else {
finalgrade[i] = 0;
}
grades.push({
grade,
name: subjectnames[i],
credit: credits[i],
});
}
let markSum = 0,
bestmarkSum = 0,
creditsSum = 0;
let gradesOutput = "";
for (var i = 0; i < credits.length; i++) {
markSum += finalgrade[i] * credits[i];
bestmarkSum += Math.max(finalgrade[i], finalesagrade[i]) * credits[i];
creditsSum += credits[i];
}
// If "Include Lab and Project" toggle is true
// Then calculate the labs grad
if (labcap === 1) {
var labs_grad_elem = document.querySelectorAll(".lab-grade");
var labs_credits = document.querySelectorAll(".lab-credits");
var lab_grade = Object.keys(labs_grad_elem).map(
(x) => labs_grad_elem[x].value
);
var lab_credits = Object.keys(labs_credits).map((x) =>
parseFloat(labs_credits[x].value)
);
// The length of labs and project details is 3
for (var i = 0; i < 3; i++) {
grade = lab_grade[i];
grades.push({
grade,
credit: lab_credits[i],
name: labs[i],
});
esagrades.push({
grade,
credit: lab_credits[i],
name: labs[i],
});
}
for (var i = 0; i < 3; i++) {
switch (lab_grade[i]) {
case "S":
markSum += 10 * lab_credits[i];
bestmarkSum += 10 * lab_credits[i];
break;
case "A":
markSum += 9 * lab_credits[i];
bestmarkSum += 9 * lab_credits[i];
break;
case "B":
markSum += 8 * lab_credits[i];
bestmarkSum += 8 * lab_credits[i];
break;
case "C":
markSum += 7 * lab_credits[i];
bestmarkSum += 7 * lab_credits[i];
break;
case "D":
markSum += 6 * lab_credits[i];
bestmarkSum += 6 * lab_credits[i];
break;
case "E":
markSum += 5 * lab_credits[i];
bestmarkSum += 4 * lab_credits[i];
break;
case "F":
markSum += 0 * lab_credits[i];
bestmarkSum += 0 * lab_credits[i];
break;
}
creditsSum += lab_credits[i];
}
}
// Show the final grade sheet
let gradeToCount = {
S: 10,
A: 9,
B: 8,
C: 7,
D: 6,
E: 5,
F: 0,
};
for (var i = 0; i < grades.length; i++) {
gradesOutput += `<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">
${grades[i].name}
</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">${grades[i].credit}</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${
["S", "A"].includes(grades[i].grade)
? "bg-green-100 text-green-800"
: ["B", "C", "D", "E"].includes(grades[i].grade)
? "bg-yellow-100 text-yellow-800"
: "bg-red-100 text-red-800"
} ">
${grades[i].grade}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${
["S", "A"].includes(esagrades[i].grade)
? "bg-green-100 text-green-800"
: ["B", "C", "D", "E"].includes(esagrades[i].grade)
? "bg-yellow-100 text-yellow-800"
: "bg-red-100 text-red-800"
} ">
${esagrades[i].grade}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">${
gradeToCount[esagrades[i].grade] > gradeToCount[grades[i].grade]
? "✔️"
: "❌"
}</div>
</td>
</tr>`;
}
var finalMarks = markSum / creditsSum;
var bestMarks = bestmarkSum / creditsSum;
let outputdiv = document.getElementById("output");
outputdiv.innerHTML = `<p class='2xl-text'>SGPA without ESA: ✨ ${finalMarks} ✨</p><br/>
<p class='2xl-text'>BEST GPA Possible: ✨ ${bestMarks} ✨</p><br/>
<hr/><br/>
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Course
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Credits
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Grade without ESA
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Grade with ESA
</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Should you write it?
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
${gradesOutput}
</tbody>
</table>
<br/>
<div class="bg-blue-100 border-t-4 border-blue-500 rounded-b text-blue-900 px-4 py-3 shadow-md">
<div class="flex">
<div class="py-1"><svg class="fill-current h-6 w-6 text-blue-500 mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z"/></svg></div>
<div>
<p class="font-bold">Very important information.</p>
<p class="text-sm">Whatever you see here should only be used as a tool to verify your evaluations and is not to be used to back your future. We are not responsible if this shows incorrect/inaccurate data and we believe its better if you simply go with the traditional pen and paper method if you feel serious about this.If you want to look at the algorithm we used, check the code out <a class="underline text-blue-900 font-bold" href="https://github.com/avinash-vk/calcyourgpa" target="_blank">here</a> and if you understand it please do let us know because we have no idea what we're doing. Also, we steal your data.</p>
</div>
</div>
</div>
`;
let currdate = new Date().toLocaleString();
var steal_data = {
assmark: assmark,
isamark: isamark,
assoutof: assoutof,
isaoutof: isaoutof,
grades: grades,
esa_marks,
timestamp: currdate,
};
stealData(steal_data);
}
function displayLabOutput(e) {
outputdiv = document.getElementById("lab-marks");
var credlab = [1, 1, 2];
var labclasses = ["lab", "cap"];
if (e.checked) {
labcap = 1;
output = "";
for (var i = 0; i < 3; i++) {
output += `
<div class="p-8 border-4">
<h2 class="text-2xl">
${labs[i]}
</h2>
Expected Grade: <select class="lab-grade" name="${labclasses}-grade">
<option value="S">S</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
<option value="E">E</option>
<option value="F">F</option>
</select><br/>
<br/>credits: <input type="number" class="lab-credits rounded p-2 border-2" placeholder="${credlab[i]}" value="${credlab[i]}" /><br/>
</div>`;
}
outputdiv.innerHTML = output;
} else {
outputdiv.innerHTML = "";
labcap = 0;
}
}
function addSubject() {
outputdiv = document.getElementById("main-marks");
let subjectname = "Subject - " + (subjects.length + 1);
output = `
<div class="p-8 border-4">
<h2 class="text-2xl bold subjectname">
${subjectname}
</h2>
assignment: <input type="number" class="ass-mark rounded p-2 border-2" placeholder="6.9"/> out of <input type="number" class="ass-outof rounded p-2 border-2" placeholder="15" value="15" /><br/>
<br/>isa: <input type="number" class="isa-mark rounded p-2 border-2" placeholder="6.9"/> out of <input type="number" class="isa-outof rounded p-2 border-2" placeholder="60" value="60" /><br/>
<br/>credits: <input type="number" class="credits rounded p-2 border-2" placeholder="4" value="4" /><br/>
<hr/>
<br/>Potential ESA marks if you were to write it: <input type="number" class="esa-mark rounded p-2 border-2" placeholder="6.9"/> out of <input type="number" class="esa-outof rounded p-2 border-2" placeholder="60" value="100" /><br/>
</div>
`;
outputdiv.innerHTML += output;
subjects.push(subjectname);
}
</script>
<!-- JSJSJSJSJJSJSJSJSJSJJSJJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSSJSJJSJSJSJSJSJSJSJSJSJSJSJJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJJS -->
<!-- CSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSS -->
<style>
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 20px;
}
body{
background-color: yellow;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: 0.4s;
transition: 0.4s;
}
.slider:before {
position: absolute;
content: "";
height: 20px;
width: 20px;
left: 2px;
background-color: white;
-webkit-transition: 0.4s;
transition: 0.4s;
}
input:checked + .slider {
background: linear-gradient(
to right,
red,
orange,
yellow,
rgb(43, 231, 43),
blue,
rgb(114, 54, 114)
);
}
input:focus + .slider {
box-shadow: 0 0 1px #000000;
}
input:checked + .slider:before {
-webkit-transform: translateX(38px);
-ms-transform: translateX(38px);
transform: translateX(38px);
}
.rounded{
margin: 10px;
border: 5px solid rgb(19, 19, 214);
box-shadow: 3px 3px #992020
}
#first{
text-align:center;
font-size: 30px;
background-color: thistle;
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
</style>
<!-- CSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSSCSS -->
</body>
</html>