-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
509 lines (449 loc) · 21.6 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
<!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>TT VIT Chennai</title>
<style>
body {
display: block;
}
p {
margin: auto;
text-align: center;
}
h1 {
margin: auto;
text-align: center;
}
nav {
display: flex;
justify-content: flex-end;
}
.github {
background-color: #21262d;
border: none;
color: white;
padding: 1rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1rem;
margin: 0.9rem 0.9rem 0rem 0rem;
border-radius: 12px;
}
.wrap {
position: relative;
padding: 1% 1% 0% 1%;
margin: auto 0;
}
.box {
border: 1px solid #3c8dbc;
text-align: center;
vertical-align: middle;
padding: 3px;
width: 0;
height: 0.5rem;
}
.slot {
border: 1px solid #3c8dbc;
text-align: center;
vertical-align: middle;
padding: 3px;
width: 50px;
height: 25px;
}
/* .slot:hover {
background-color: #CCFF33;
} */
</style>
</head>
<body>
<header>
<nav>
<a class="github" href="https://github.com/lem0n4id/vitc-timetable-example">Open in GitHub
</a>
</nav>
<h1>VIT Chennai's time table</h1>
</header>
<main>
<textarea type="text" placeholder="Paste your timetable here" id="uname" style="width: 1120px; height: 222px;"> </textarea>
<br>
<input type="button"value="submit" onclick="fillTable()" />
<div class="wrap">
<table id="timeTableStyle"
style="border: 2px solid #3c8dbc; text-align: center; font-size: 0.84rem; margin-bottom: 20px;width:100%;">
<tbody>
<!-- theory timings start -->
<tr>
<td rowspan="2" bgcolor="#e2e2e2" class="box">THEORY</td>
<td bgcolor="#e2e2e2" class="box">Start</td>
<td class="box" bgcolor="#CCCCFF">08:00</td>
<td class="box" bgcolor="#CCCCFF">08:55</td>
<td class="box" bgcolor="#CCCCFF">09:50</td>
<td class="box" bgcolor="#CCCCFF">10:45</td>
<td class="box" bgcolor="#CCCCFF">11:40</td>
<td class="box" bgcolor="#CCCCFF">12:35</td>
<td bgcolor="#CCCCFF" class="box">Lunch</td>
<td class="box" bgcolor="#CCCCFF">02:00</td>
<td class="box" bgcolor="#CCCCFF">02:55</td>
<td class="box" bgcolor="#CCCCFF">03:50</td>
<td class="box" bgcolor="#CCCCFF">04:45</td>
<td class="box" bgcolor="#CCCCFF">05:40</td>
<td class="box" bgcolor="#CCCCFF">06:35</td>
</tr>
<!-- theory timings end -->
<tr>
<td bgcolor="#e2e2e2" class="box">End</td>
<td class="box" bgcolor="#CCCCFF">08:50</td>
<td class="box" bgcolor="#CCCCFF">09:45</td>
<td class="box" bgcolor="#CCCCFF">10:40</td>
<td class="box" bgcolor="#CCCCFF">11:35</td>
<td class="box" bgcolor="#CCCCFF">12:30</td>
<td class="box" bgcolor="#CCCCFF">01:25</td>
<td bgcolor="#CCCCFF" class="box">Lunch</td>
<td class="box" bgcolor="#CCCCFF">02:50</td>
<td class="box" bgcolor="#CCCCFF">03:45</td>
<td class="box" bgcolor="#CCCCFF">04:40</td>
<td class="box" bgcolor="#CCCCFF">05:35</td>
<td class="box" bgcolor="#CCCCFF">06:30</td>
<td class="box" bgcolor="#CCCCFF">07:25</td>
</tr>
<!-- lab timings start -->
<tr>
<td rowspan="2" bgcolor="#e2e2e2" class="box">LAB</td>
<td bgcolor="#e2e2e2" class="box">Start</td>
<td class="box" bgcolor="#99CCFF">08:00</td>
<td class="box" bgcolor="#99CCFF">08:50</td>
<td class="box" bgcolor="#99CCFF">09:50</td>
<td class="box" bgcolor="#99CCFF">10:40</td>
<td class="box" bgcolor="#99CCFF">11:40</td>
<td class="box" bgcolor="#99CCFF">12:30</td>
<td bgcolor="#99CCFF" class="box">Lunch</td>
<td class="box" bgcolor="#99CCFF">02:00</td>
<td class="box" bgcolor="#99CCFF">02:50</td>
<td class="box" bgcolor="#99CCFF">03:50</td>
<td class="box" bgcolor="#99CCFF">04:40</td>
<td class="box" bgcolor="#99CCFF">05:40</td>
<td class="box" bgcolor="#99CCFF">06:30</td>
</tr>
<!-- lab timings end -->
<tr>
<td bgcolor="#e2e2e2" class="box">End</td>
<td class="box" bgcolor="#99CCFF">08:50</td>
<td class="box" bgcolor="#99CCFF">09:40</td>
<td class="box" bgcolor="#99CCFF">10:40</td>
<td class="box" bgcolor="#99CCFF">11:30</td>
<td class="box" bgcolor="#99CCFF">12:30</td>
<td class="box" bgcolor="#99CCFF">01:20</td>
<td bgcolor="#99CCFF" class="box">Lunch</td>
<td class="box" bgcolor="#99CCFF">02:50</td>
<td class="box" bgcolor="#99CCFF">03:40</td>
<td class="box" bgcolor="#99CCFF">04:40</td>
<td class="box" bgcolor="#99CCFF">05:30</td>
<td class="box" bgcolor="#99CCFF">06:30</td>
<td class="box" bgcolor="#99CCFF">07:20</td>
</tr>
<!-- monday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">MON</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot A1">A1</td>
<td class="slot F1">F1</td>
<td class="slot D1">D1</td>
<td class="slot TB1">TB1</td>
<td class="slot TG1">TG1</td>
<td class="slot S11">S11</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot A2">A2</td>
<td class="slot F2">F2</td>
<td class="slot D2">D2</td>
<td class="slot TB2">TB2</td>
<td class="slot TG2">TG2</td>
<td class="slot S3">S3</td>
</tr>
<!-- monday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L1" bgcolor="#f9efa4">L1</td>
<td class="slot L2" bgcolor="#f9efa4">L2</td>
<td class="slot L3" bgcolor="#f9efa4">L3</td>
<td class="slot L4" bgcolor="#f9efa4">L4</td>
<td class="slot L5" bgcolor="#f9efa4">L5</td>
<td class="slot L6" bgcolor="#f9efa4">L6</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L31" bgcolor="#f9efa4">L31</td>
<td class="slot L32" bgcolor="#f9efa4">L32</td>
<td class="slot L33" bgcolor="#f9efa4">L33</td>
<td class="slot L34" bgcolor="#f9efa4">L34</td>
<td class="slot L35" bgcolor="#f9efa4">L35</td>
<td class="slot L36" bgcolor="#f9efa4">L36</td>
</tr>
<!-- tuesday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">TUE</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot B1">B1</td>
<td class="slot G1">G1</td>
<td class="slot E1">E1</td>
<td class="slot TC1">TC1</td>
<td class="slot TAA1">TAA1</td>
<td class="slot">-</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot B2">B2</td>
<td class="slot G2">G2</td>
<td class="slot E2">E2</td>
<td class="slot TC2">TC2</td>
<td class="slot TAA2">TAA2</td>
<td class="slot S1">S1</td>
</tr>
<!-- tuesday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L7" bgcolor="#f9efa4">L7</td>
<td class="slot L8" bgcolor="#f9efa4">L8</td>
<td class="slot L9" bgcolor="#f9efa4">L9</td>
<td class="slot L10" bgcolor="#f9efa4">L10</td>
<td class="slot L11" bgcolor="#f9efa4">L11</td>
<td class="slot L12" bgcolor="#f9efa4">L12</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L37" bgcolor="#f9efa4">L37</td>
<td class="slot L38" bgcolor="#f9efa4">L38</td>
<td class="slot L39" bgcolor="#f9efa4">L39</td>
<td class="slot L40" bgcolor="#f9efa4">L40</td>
<td class="slot L41" bgcolor="#f9efa4">L41</td>
<td class="slot L42" bgcolor="#f9efa4">L42</td>
</tr>
<!-- wednesday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">WED</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot C1">C1</td>
<td class="slot A1">A1</td>
<td class="slot F1">F1</td>
<td class="slot TD1">TD1</td>
<td class="slot TBB1">TBB1</td>
<td class="slot">-</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot C2">C2</td>
<td class="slot A2">A2</td>
<td class="slot F2">F2</td>
<td class="slot TD2">TD2</td>
<td class="slot TBB2">TBB2</td>
<td class="slot S4">S4</td>
</tr>
<!-- wednesday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L13" bgcolor="#f9efa4">L13</td>
<td class="slot L14" bgcolor="#f9efa4">L14</td>
<td class="slot L15" bgcolor="#f9efa4">L15</td>
<td class="slot L16" bgcolor="#f9efa4">L16</td>
<td class="slot L17" bgcolor="#f9efa4">L17</td>
<td class="slot L18" bgcolor="#f9efa4">L18</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L43" bgcolor="#f9efa4">L43</td>
<td class="slot L44" bgcolor="#f9efa4">L44</td>
<td class="slot L45" bgcolor="#f9efa4">L45</td>
<td class="slot L46" bgcolor="#f9efa4">L46</td>
<td class="slot L47" bgcolor="#f9efa4">L47</td>
<td class="slot L48" bgcolor="#f9efa4">L48</td>
</tr>
<!-- thursday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">THU</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot D1">D1</td>
<td class="slot B1">B1</td>
<td class="slot G1">G1</td>
<td class="slot TE1">TE1</td>
<td class="slot TCC1">TCC1</td>
<td class="slot">-</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot D2">D2</td>
<td class="slot B2">B2</td>
<td class="slot G2">G2</td>
<td class="slot TE2">TE2</td>
<td class="slot TCC2">TCC2</td>
<td class="slot S2">S2</td>
</tr>
<!-- thursday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L19" bgcolor="#f9efa4">L19</td>
<td class="slot L20" bgcolor="#f9efa4">L20</td>
<td class="slot L21" bgcolor="#f9efa4">L21</td>
<td class="slot L22" bgcolor="#f9efa4">L22</td>
<td class="slot L23" bgcolor="#f9efa4">L23</td>
<td class="slot L24" bgcolor="#f9efa4">L24</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L49" bgcolor="#f9efa4">L49</td>
<td class="slot L50" bgcolor="#f9efa4">L50</td>
<td class="slot L51" bgcolor="#f9efa4">L51</td>
<td class="slot L52" bgcolor="#f9efa4">L52</td>
<td class="slot L53" bgcolor="#f9efa4">L53</td>
<td class="slot L54" bgcolor="#f9efa4">L54</td>
</tr>
<!-- friday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">FRI</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot E1">E1</td>
<td class="slot C1">C1</td>
<td class="slot TA1">TA1</td>
<td class="slot TF1">TF1</td>
<td class="slot TDD1">TDD1</td>
<td class="slot S15">S15</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot E2">E2</td>
<td class="slot C2">C2</td>
<td class="slot TA2">TA2</td>
<td class="slot TF2">TF2</td>
<td class="slot TDD2">TDD2</td>
<td class="slot">-</td>
</tr>
<!-- friday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L25" bgcolor="#f9efa4">L25</td>
<td class="slot L26" bgcolor="#f9efa4">L26</td>
<td class="slot L27" bgcolor="#f9efa4">L27</td>
<td class="slot L28" bgcolor="#f9efa4">L28</td>
<td class="slot L29" bgcolor="#f9efa4">L29</td>
<td class="slot L30" bgcolor="#f9efa4">L30</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L55" bgcolor="#f9efa4">L55</td>
<td class="slot L56" bgcolor="#f9efa4">L56</td>
<td class="slot L57" bgcolor="#f9efa4">L57</td>
<td class="slot L58" bgcolor="#f9efa4">L58</td>
<td class="slot L59" bgcolor="#f9efa4">L59</td>
<td class="slot L60" bgcolor="#f9efa4">L60</td>
</tr>
<!-- saturday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">SAT</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot X11">X11</td>
<td class="slot X12">X12</td>
<td class="slot Y11">Y11</td>
<td class="slot Y12">Y12</td>
<td class="slot S8">S8</td>
<td class="slot">-</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot X21">X21</td>
<td class="slot Z21">Z21</td>
<td class="slot Y21">Y21</td>
<td class="slot W21">W21</td>
<td class="slot W22">W22</td>
<td class="slot">-</td>
</tr>
<!-- saturday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L71" bgcolor="#f9efa4">L71</td>
<td class="slot L72" bgcolor="#f9efa4">L72</td>
<td class="slot L73" bgcolor="#f9efa4">L73</td>
<td class="slot L74" bgcolor="#f9efa4">L74</td>
<td class="slot L75" bgcolor="#f9efa4">L75</td>
<td class="slot L76" bgcolor="#f9efa4">L76</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L77" bgcolor="#f9efa4">L77</td>
<td class="slot L78" bgcolor="#f9efa4">L78</td>
<td class="slot L79" bgcolor="#f9efa4">L79</td>
<td class="slot L80" bgcolor="#f9efa4">L80</td>
<td class="slot L81" bgcolor="#f9efa4">L81</td>
<td class="slot L82" bgcolor="#f9efa4">L82</td>
</tr>
<!-- sunday theory -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box" rowspan="2">SUN</td>
<td bgcolor="#e2e2e2" class="box">
THEORY</td>
<td class="slot Y11">Y11</td>
<td class="slot Y12">Y12</td>
<td class="slot X11">X11</td>
<td class="slot X12">X12</td>
<td class="slot S10">S10</td>
<td class="slot">-</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot Y21">Y21</td>
<td class="slot Z21">Z21</td>
<td class="slot X21">X21</td>
<td class="slot W21">W21</td>
<td class="slot W22">W22</td>
<td class="slot">-</td>
</tr>
<!-- sunday lab -->
<tr style="background-color: #FFFFCC;">
<td bgcolor="#e2e2e2" class="box">
LAB</td>
<td class="slot L83" bgcolor="#f9efa4">L83</td>
<td class="slot L84" bgcolor="#f9efa4">L84</td>
<td class="slot L85" bgcolor="#f9efa4">L85</td>
<td class="slot L86" bgcolor="#f9efa4">L86</td>
<td class="slot L87" bgcolor="#f9efa4">L87</td>
<td class="slot L88" bgcolor="#f9efa4">L88</td>
<td class="box" bgcolor="#e2e2e2">Lunch</td>
<td class="slot L89" bgcolor="#f9efa4">L89</td>
<td class="slot L90" bgcolor="#f9efa4">L90</td>
<td class="slot L91" bgcolor="#f9efa4">L91</td>
<td class="slot L92" bgcolor="#f9efa4">L92</td>
<td class="slot L93" bgcolor="#f9efa4">L93</td>
<td class="slot L94" bgcolor="#f9efa4">L94</td>
</tr>
</tbody>
</table>
</div>
</main>
<footer><strong>Made with <3</strong></footer>
<script>
function clearMain() {
var e = document.querySelector("main");
e.innerHTML = "";
}
function fillTable() {
let uname = document.querySelector("#uname");
let text = uname.value;
if (!text) return
uname.value = "";
regexp= /((([A-Z]{2,3})|[A-Z])\d{1,2})(-)([BM])([A-Z]{3})(\d{3,4})([A-Z])(-)(TH|LO|ELA|ETH)(-)(AB1)(-)((\d{3})(L)|(\d{3}))(-)(ALL)/g ;
let result = text.match(regexp);
// console.log(result)
if (!result) return
result.forEach(element => {
// console.log(element)
const slotDetails = element.split("-");
// Slot
var slot = slotDetails[0];
let x = document.getElementsByClassName(slot);
for (let index = 0; index < x.length; index++) {
x[index].setAttribute("bgcolor", "#CCFF33");
x[index].innerHTML = element;
}
});
return
}
// if site is open from phone
if (window.screen.width < 800) {
clearMain()
const para1 = document.createElement("p");
const node = document.createTextNode("This website currently doesn't support mobie view. Please use desktop.");
para1.appendChild(node);
document.body.appendChild(para1);
}
</script>
</body>
</html>