-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimetable.ejs
131 lines (116 loc) · 3.5 KB
/
timetable.ejs
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Timetable</title>
<style>
/* General Styles */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 100vh;
}
h1 {
color: #333;
margin-bottom: 20px;
}
table {
border-collapse: collapse;
width: 100%;
margin-bottom: 20px;
background-color: #fff;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}
table, th, td {
border: 1px solid #ccc;
}
th, td {
padding: 10px;
text-align: left;
font-size: 16px;
}
th {
background-color: #f8f8f8;
}
.toggle-btn {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border-radius: 5px;
font-size: 16px;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.toggle-btn:hover {
background-color: #45a049;
}
.hidden {
display: none;
}
/* Responsive Design */
@media screen and (max-width: 768px) {
table, th, td {
font-size: 14px;
}
.toggle-btn {
font-size: 14px;
}
}
</style>
</head>
<body>
<h1>Timetable</h1>
<!-- Toggle button -->
<button class="toggle-btn" id="toggleButton">Hide Timetable</button>
<!-- Timetable -->
<div id="timetable">
<table>
<thead>
<tr>
<th>Batch</th>
<th>Teacher</th>
<th>Classroom</th>
<th>Day</th>
<th>Start Time</th>
<th>End Time</th>
</tr>
</thead>
<tbody>
<% timetable.forEach(row => { %>
<tr>
<td><%= row.batch %></td>
<td><%= row.teacher %></td>
<td><%= row.classroom %></td>
<td><%= row.day %></td>
<td><%= row.startTime %>:00</td>
<td><%= row.endTime %>:00</td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<!-- Back to Home Button -->
<a href="/" class="toggle-btn">Back to Home</a>
<script>
const toggleButton = document.getElementById('toggleButton');
const timetableDiv = document.getElementById('timetable');
toggleButton.addEventListener('click', function() {
if (timetableDiv.classList.contains('hidden')) {
timetableDiv.classList.remove('hidden');
toggleButton.textContent = 'Hide Timetable';
} else {
timetableDiv.classList.add('hidden');
toggleButton.textContent = 'Show Timetable';
}
});
</script>
</body>
</html>