This repository has been archived by the owner on Jun 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
rulebook.html
178 lines (147 loc) · 6.48 KB
/
rulebook.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-150093374-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-150093374-1');
</script>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous">
</script>
<script>
$(function(){
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script>
<meta charset="UTF-8">
<title>GC Rulebook</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#D02451" />
<meta name="description" content="Official Website of Technology Students Gymkhana, IIT Kharagpur" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.gymkhana.iitkgp.ac.in" />
<meta property="og:title" content="Technology Students' Gymkhana, Indian Institute of Technology Kharagpur" />
<meta property="og:description" content="Official Website of Technology Students Gymkhana, IIT Kharagpur" />
<meta property="og:image" content="favicon.png" />
<!-- Twitter -->
<meta property="twitter:card" content="website" />
<meta property="twitter:url" content="http://www.gymkhana.iitkgp.ac.in" />
<meta property="twitter:title" content="Technology Students' Gymkhana, Indian Institute of Technology Kharagpur" />
<meta property="twitter:description" content="Official Website of Technology Students Gymkhana, IIT Kharagpur" />
<meta property="twitter:image" content="favicon.png" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700|Playfair+Display|Roboto+Slab:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
tr th{background-color: #6c7ae0;color: white;font-family: "Roboto Light";}
td{font-family: Roboto;}
table{overflow-x: scroll;position: relative; margin: auto; width: 96%;}
.content{border: solid red;display: none;z-index: 2;position: absolute;margin: 0;}
ul.content li{display: table-cell;border-radius: 0;background-color: white;}
li#drop1:hover ul.content#opts1{display: block;}
li#drop2:hover ul.content#opts2{display: block;}
li#drop3:hover ul.content#opts3{display: block;}
tbody tr td:first-of-type{font-size: 40px; font-family: Roboto;}
@media only screen and (max-width: 1100px) {
#header {
position: absolute;
left: 0px;
}
#mob-nav {
display: block;
}
#not-on-mob {
display: none;
visibility: hidden;
}
}
</style>
</head>
<body>
<div class="container page z-depth-5">
<div id="header"></div>
<br></br>
<h3 style="text-align: center">Rulebook</h3>
<table id="event" class="table table-responsive table-bordered table-fixed">
<tr>
<th> Event </th>
<th> Cup </th>
<th> Date </th>
<th> Rules PDF </th>
</tr>
</thead>
<tbody id="ruleBody">
<tr>
<td> To Be Updated</td>
</tr>
</tbody>
</table>
</div>
<div id="footer"></div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="materialize/js/bin/materialize.min.js"></script>
<script type="text/javascript" src="js/blogpost.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.modal').modal();
$('.sidenav').sidenav();
});
</script>
<!-- <script src="fetchdata.js"></script> -->
<script type='text/javascript'>
function fetchEventsData() {
let output = "";
document.getElementById('ruleBody').innerHTML = `<img src="gif/loader.gif">`;
fetch('http://gymk-back.herokuapp.com/rule_book') // url here
.then(response => {
if(!response.ok)
throw Error(response.statusText)
return response;
})
.then (response => response.json())
.then( events => {
if(events == []) {
document.getElementById('ruleBody').innerHTML = `<tr><td colspan=7><h1 style="text-align:center;">To Be Updated</h1></td></td>`;
return;
}
events = JSON.parse(events);
events.map(row => {
let indiv_row = `
<tr>
<td>${row['nameoftheevent']}</td>
<td>${row['cup']}</td>
<td>${row['date']}</td>
<td><a href="${row['rulelink']}" target="_blank">Attachment</a></td>
</tr>
`
if (indiv_row != undefined)
{
output += indiv_row;
}
});
})
.then(() => {
console.log(output);
console.log("here");
document.getElementById('ruleBody').innerHTML = output;
})
.catch(err => {
document.getElementById('ruleBody').innerHTML = `<tr><td colspan=7><h1 style="text-align:center;">To Be Updated</h1></td></td>`;
console.log('Error is ',err);
return;
});
}
fetchEventsData()
</script>
</body>
</html>