-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
115 lines (111 loc) · 4.25 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SGPA Calci 📲</title>
<link rel="icon" href="logo-bgn.png" type="image/x-icon">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
overflow-x: hidden;
background-color: #f4f4f4;
}
.container {
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.logo {
width: 200px;
height: 200px;
}
#calculateBtn {
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 3px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
#calculateBtn:hover {
background-color: #45a049;
}
/* /* mobile scalable */
@media only screen and (max-width: 600px) {
#sai {
font-size: 18px;
}
#calculateBtn {
padding: 8px 16px;
font-size: 14px;
}
}
.footer {
margin-top: 20px;
padding: 10px;
background-color: #4CAF50;
color: white;
text-align: center;
position: absolute;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<img src="logo-bgn.png" alt="Logo" class="logo">
<h1 id="sai">Click the button below to calculate your SGPA</h1>
<br>
<button id="calculateBtn">Calculate my CGPA</button>
<script>
alert("Oh, a visitor hmm");
alert("So you clicked on the link");
alert("Hmm.. reason maybe you are..");
alert("A dumb KLEF student like me 🥹");
alert("So you don't know how to calculate your SGPA..");
alert("Don't worry, I got you 😉");
document.getElementById('calculateBtn').addEventListener('click', function() {
var numSubjects = prompt('Enter the number of subjects (DO NOT CLICK CANCEL)');
if (numSubjects === null) {
alert('Enti bro idhi cancel kottodhu annaga malli button nokku 😒');
}
else if(numSubjects >50){
alert('Bane veshalu esthunnavuga musukoni ennivunte anni enter chey...');
}else {
var regex = /^[0-9]+$/;
if (!regex.test(numSubjects)) {
alert('Enti athi telivi chupisthunnav musukoni enni subjects vunnayo nokkochuga.');
// console.log(numSubjects);
} else {
numSubjects = parseFloat(numSubjects); // Parse as float to handle decimal inputs
if (isNaN(numSubjects) || numSubjects <= 0) {
alert('bro are u seriously dumb...');
} else {
if (numSubjects % 1 !== 0) {
alert('Bruh nuvvu subjects ni points lo enduku istahv aagu dhaanni round off chesi istha ');
numSubjects = Math.floor(numSubjects);
}
if (numSubjects >= 20) {
window.location.href = 'form.html?numSubjects=' + numSubjects;
alert('Enti anni subjects unnaya');
}
window.location.href = 'form.html?numSubjects=' + numSubjects;
}
}
}
});
</script>
</div>
<div class="footer">
<a style="color: black; text-decoration: none;" href="https://www.linkedin.com/in/bejawada-sai-mahendra-b18289212/" target="_blank">© Coded by Sai ||2024.</a>
</div>
</body>
</html>