-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path404.html
137 lines (118 loc) · 3.26 KB
/
404.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Year Selector</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 20;
background-color: #f0f0f0;
}
.button-container {
display: flex;
flex-direction: column-reverse;
align-items: center;
}
.button {
background-color: black;
color: white;
padding: 10px 20px;
margin: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
display: none;
justify-content: center;
align-items: center;
z-index: 9999;
}
.loader {
border: 4px solid #f3f3f3;
border-radius: 50%;
border-top: 4px solid #3498db;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
}
.desc{
color: #808080;
font-size: 8px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<center><b>Please Select the Year</b></center><br>
<div class="button-container">
<button class="button" id="btn2018">2018</button>
<button class="button" id="btn2019">2019</button>
<button class="button" id="btn2022">2022</button>
<button class="button" id="btn2023">2023</button>
</div><br><br>
<div class="desc">
<center>Due to Coronavirus outbreak, 2020 and 2021 were online and had Open Book Examinations with question paper of extreme difficulty. Hence, we have omitted those years.</center>
</div>
<div class="loading-overlay" id="loadingOverlay">
<div class="loader"></div>
</div>
<script>
document.getElementById("btn2018").addEventListener("click", function() {
showLoadingIndicator();
redirectToYear(2018);
});
document.getElementById("btn2019").addEventListener("click", function() {
showLoadingIndicator();
redirectToYear(2019);
});
document.getElementById("btn2022").addEventListener("click", function() {
showLoadingIndicator();
redirectToYear(2022);
});
document.getElementById("btn2023").addEventListener("click", function() {
showLoadingIndicator();
redirectToYear(2023);
});
function showLoadingIndicator() {
document.getElementById("loadingOverlay").style.display = "flex";
}
function hideLoadingIndicator() {
document.getElementById("loadingOverlay").style.display = "none";
}
function redirectToYear(year) {
var currentURL = window.location.href;
var newURL;
// Check if the current URL already ends with .pdf
if (currentURL.endsWith(".pdf")) {
// If yes, replace the existing filename with the new year
var index = currentURL.lastIndexOf("/");
newURL = currentURL.substring(0, index + 1) + year + ".pdf";
} else {
// If not, append the year to the current URL
newURL = "https://docs.google.com/gview?embedded=true&url=" + currentURL + year + ".pdf";
}
window.location.href = newURL;
setTimeout(function() {
// Redirect to the new URL
window.location.href = newURL;
}, 5000);
}
</script>
</body>
</html>