Neurolingua
commited on
Commit
•
88db748
1
Parent(s):
fb08a60
Update templates/index.html
Browse files- templates/index.html +277 -272
templates/index.html
CHANGED
@@ -1,273 +1,278 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Smart-Learn</title>
|
7 |
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
|
8 |
-
<style>
|
9 |
-
body, html {
|
10 |
-
margin: 0;
|
11 |
-
padding: 0;
|
12 |
-
height: 100%;
|
13 |
-
font-family: 'Roboto', sans-serif;
|
14 |
-
color: #fff;
|
15 |
-
overflow: hidden;
|
16 |
-
}
|
17 |
-
.video-container {
|
18 |
-
position: fixed;
|
19 |
-
top: 0;
|
20 |
-
left: 0;
|
21 |
-
width: 100%;
|
22 |
-
height: 100%;
|
23 |
-
z-index: -1;
|
24 |
-
overflow: hidden;
|
25 |
-
}
|
26 |
-
#background-video {
|
27 |
-
min-width: 100%;
|
28 |
-
min-height: 100%;
|
29 |
-
width: auto;
|
30 |
-
height: auto;
|
31 |
-
position: absolute;
|
32 |
-
top: 50%;
|
33 |
-
left: 50%;
|
34 |
-
transform: translate(-50%, -50%);
|
35 |
-
}
|
36 |
-
.content {
|
37 |
-
position: relative;
|
38 |
-
z-index: 1;
|
39 |
-
text-align: center;
|
40 |
-
padding: 20px;
|
41 |
-
background: rgba(0, 0, 0, 0.5);
|
42 |
-
min-height: 100vh;
|
43 |
-
display: flex;
|
44 |
-
flex-direction: column;
|
45 |
-
justify-content: space-between;
|
46 |
-
}
|
47 |
-
.header {
|
48 |
-
padding: 20px 0;
|
49 |
-
}
|
50 |
-
.logo-circle {
|
51 |
-
width: 150px;
|
52 |
-
height: 150px;
|
53 |
-
border-radius: 50%;
|
54 |
-
overflow: hidden;
|
55 |
-
margin: 0 auto;
|
56 |
-
box-shadow: 0 4px 8px rgba(0,0,0,0.3);
|
57 |
-
}
|
58 |
-
.logo-circle img {
|
59 |
-
width: 100%;
|
60 |
-
height: 100%;
|
61 |
-
object-fit: cover;
|
62 |
-
}
|
63 |
-
.school-name {
|
64 |
-
font-size: 2.5em;
|
65 |
-
margin-top: 20px;
|
66 |
-
color: #ffffff;
|
67 |
-
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
|
68 |
-
}
|
69 |
-
.login-text {
|
70 |
-
font-size: 1.2em;
|
71 |
-
margin-top: 20px;
|
72 |
-
margin-bottom: 10px;
|
73 |
-
}
|
74 |
-
.login-buttons {
|
75 |
-
margin-top: 10px;
|
76 |
-
}
|
77 |
-
.login-button {
|
78 |
-
background-color: rgba(52, 152, 219, 0.8);
|
79 |
-
border: none;
|
80 |
-
color: white;
|
81 |
-
padding: 12px 24px;
|
82 |
-
text-align: center;
|
83 |
-
text-decoration: none;
|
84 |
-
display: inline-block;
|
85 |
-
font-size: 16px;
|
86 |
-
margin: 4px 10px;
|
87 |
-
cursor: pointer;
|
88 |
-
border-radius: 25px;
|
89 |
-
transition: background-color 0.3s, transform 0.3s;
|
90 |
-
}
|
91 |
-
.login-button:hover {
|
92 |
-
background-color: rgba(41, 128, 185, 0.9);
|
93 |
-
transform: translateY(-2px);
|
94 |
-
}
|
95 |
-
.modal {
|
96 |
-
display: none;
|
97 |
-
position: fixed;
|
98 |
-
z-index: 2;
|
99 |
-
left: 0;
|
100 |
-
top: 0;
|
101 |
-
width: 100%;
|
102 |
-
height: 100%;
|
103 |
-
overflow: auto;
|
104 |
-
background-color: rgba(0,0,0,0.8);
|
105 |
-
}
|
106 |
-
.modal-content {
|
107 |
-
background-color: #fefefe;
|
108 |
-
margin: 10% auto;
|
109 |
-
padding: 30px;
|
110 |
-
border: 1px solid #888;
|
111 |
-
width: 300px;
|
112 |
-
border-radius: 8px;
|
113 |
-
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
114 |
-
}
|
115 |
-
.close {
|
116 |
-
color: #aaa;
|
117 |
-
float: right;
|
118 |
-
font-size: 28px;
|
119 |
-
font-weight: bold;
|
120 |
-
}
|
121 |
-
.close:hover,
|
122 |
-
.close:focus {
|
123 |
-
color: black;
|
124 |
-
text-decoration: none;
|
125 |
-
cursor: pointer;
|
126 |
-
}
|
127 |
-
#login-form input {
|
128 |
-
width: 100%;
|
129 |
-
padding: 10px;
|
130 |
-
margin: 10px 0;
|
131 |
-
border: 1px solid #ddd;
|
132 |
-
border-radius: 4px;
|
133 |
-
}
|
134 |
-
#login-form button {
|
135 |
-
width: 100%;
|
136 |
-
padding: 10px;
|
137 |
-
background-color: #2ecc71;
|
138 |
-
color: white;
|
139 |
-
border: none;
|
140 |
-
border-radius: 4px;
|
141 |
-
cursor: pointer;
|
142 |
-
transition: background-color 0.3s;
|
143 |
-
}
|
144 |
-
#login-form button:hover {
|
145 |
-
background-color: #27ae60;
|
146 |
-
}
|
147 |
-
.info-section {
|
148 |
-
width: 100% ;
|
149 |
-
color: #ecf0f1;
|
150 |
-
padding: 20px 0;
|
151 |
-
text-align: center;
|
152 |
-
}
|
153 |
-
.contact-info {
|
154 |
-
max-width: 600px;
|
155 |
-
margin: 0 auto;
|
156 |
-
}
|
157 |
-
#login-title {
|
158 |
-
color: #333;
|
159 |
-
margin-bottom: 15px;
|
160 |
-
}
|
161 |
-
#login-instructions {
|
162 |
-
color: #666;
|
163 |
-
margin-bottom: 20px;
|
164 |
-
}
|
165 |
-
</style>
|
166 |
-
</head>
|
167 |
-
|
168 |
-
<body>
|
169 |
-
<div class="video-container">
|
170 |
-
<video autoplay muted loop
|
171 |
-
<source src="../static/background.mp4" type="video/mp4">
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
</
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
<
|
186 |
-
|
187 |
-
<button class="login-button" onclick="showLogin('
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
<
|
196 |
-
<p><strong>
|
197 |
-
<p><strong>
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
<
|
207 |
-
<
|
208 |
-
<
|
209 |
-
|
210 |
-
<input type="
|
211 |
-
<
|
212 |
-
|
213 |
-
|
214 |
-
<p id="login-error" style="color: red; display: none;">Invalid username or password. Please try again.</p>
|
215 |
-
</div>
|
216 |
-
</div>
|
217 |
-
|
218 |
-
<script>
|
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 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Smart-Learn</title>
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
body, html {
|
10 |
+
margin: 0;
|
11 |
+
padding: 0;
|
12 |
+
height: 100%;
|
13 |
+
font-family: 'Roboto', sans-serif;
|
14 |
+
color: #fff;
|
15 |
+
overflow: hidden;
|
16 |
+
}
|
17 |
+
.video-container {
|
18 |
+
position: fixed;
|
19 |
+
top: 0;
|
20 |
+
left: 0;
|
21 |
+
width: 100%;
|
22 |
+
height: 100%;
|
23 |
+
z-index: -1;
|
24 |
+
overflow: hidden;
|
25 |
+
}
|
26 |
+
#background-video {
|
27 |
+
min-width: 100%;
|
28 |
+
min-height: 100%;
|
29 |
+
width: auto;
|
30 |
+
height: auto;
|
31 |
+
position: absolute;
|
32 |
+
top: 50%;
|
33 |
+
left: 50%;
|
34 |
+
transform: translate(-50%, -50%);
|
35 |
+
}
|
36 |
+
.content {
|
37 |
+
position: relative;
|
38 |
+
z-index: 1;
|
39 |
+
text-align: center;
|
40 |
+
padding: 20px;
|
41 |
+
background: rgba(0, 0, 0, 0.5);
|
42 |
+
min-height: 100vh;
|
43 |
+
display: flex;
|
44 |
+
flex-direction: column;
|
45 |
+
justify-content: space-between;
|
46 |
+
}
|
47 |
+
.header {
|
48 |
+
padding: 20px 0;
|
49 |
+
}
|
50 |
+
.logo-circle {
|
51 |
+
width: 150px;
|
52 |
+
height: 150px;
|
53 |
+
border-radius: 50%;
|
54 |
+
overflow: hidden;
|
55 |
+
margin: 0 auto;
|
56 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.3);
|
57 |
+
}
|
58 |
+
.logo-circle img {
|
59 |
+
width: 100%;
|
60 |
+
height: 100%;
|
61 |
+
object-fit: cover;
|
62 |
+
}
|
63 |
+
.school-name {
|
64 |
+
font-size: 2.5em;
|
65 |
+
margin-top: 20px;
|
66 |
+
color: #ffffff;
|
67 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
|
68 |
+
}
|
69 |
+
.login-text {
|
70 |
+
font-size: 1.2em;
|
71 |
+
margin-top: 20px;
|
72 |
+
margin-bottom: 10px;
|
73 |
+
}
|
74 |
+
.login-buttons {
|
75 |
+
margin-top: 10px;
|
76 |
+
}
|
77 |
+
.login-button {
|
78 |
+
background-color: rgba(52, 152, 219, 0.8);
|
79 |
+
border: none;
|
80 |
+
color: white;
|
81 |
+
padding: 12px 24px;
|
82 |
+
text-align: center;
|
83 |
+
text-decoration: none;
|
84 |
+
display: inline-block;
|
85 |
+
font-size: 16px;
|
86 |
+
margin: 4px 10px;
|
87 |
+
cursor: pointer;
|
88 |
+
border-radius: 25px;
|
89 |
+
transition: background-color 0.3s, transform 0.3s;
|
90 |
+
}
|
91 |
+
.login-button:hover {
|
92 |
+
background-color: rgba(41, 128, 185, 0.9);
|
93 |
+
transform: translateY(-2px);
|
94 |
+
}
|
95 |
+
.modal {
|
96 |
+
display: none;
|
97 |
+
position: fixed;
|
98 |
+
z-index: 2;
|
99 |
+
left: 0;
|
100 |
+
top: 0;
|
101 |
+
width: 100%;
|
102 |
+
height: 100%;
|
103 |
+
overflow: auto;
|
104 |
+
background-color: rgba(0,0,0,0.8);
|
105 |
+
}
|
106 |
+
.modal-content {
|
107 |
+
background-color: #fefefe;
|
108 |
+
margin: 10% auto;
|
109 |
+
padding: 30px;
|
110 |
+
border: 1px solid #888;
|
111 |
+
width: 300px;
|
112 |
+
border-radius: 8px;
|
113 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
114 |
+
}
|
115 |
+
.close {
|
116 |
+
color: #aaa;
|
117 |
+
float: right;
|
118 |
+
font-size: 28px;
|
119 |
+
font-weight: bold;
|
120 |
+
}
|
121 |
+
.close:hover,
|
122 |
+
.close:focus {
|
123 |
+
color: black;
|
124 |
+
text-decoration: none;
|
125 |
+
cursor: pointer;
|
126 |
+
}
|
127 |
+
#login-form input {
|
128 |
+
width: 100%;
|
129 |
+
padding: 10px;
|
130 |
+
margin: 10px 0;
|
131 |
+
border: 1px solid #ddd;
|
132 |
+
border-radius: 4px;
|
133 |
+
}
|
134 |
+
#login-form button {
|
135 |
+
width: 100%;
|
136 |
+
padding: 10px;
|
137 |
+
background-color: #2ecc71;
|
138 |
+
color: white;
|
139 |
+
border: none;
|
140 |
+
border-radius: 4px;
|
141 |
+
cursor: pointer;
|
142 |
+
transition: background-color 0.3s;
|
143 |
+
}
|
144 |
+
#login-form button:hover {
|
145 |
+
background-color: #27ae60;
|
146 |
+
}
|
147 |
+
.info-section {
|
148 |
+
width: 100% ;
|
149 |
+
color: #ecf0f1;
|
150 |
+
padding: 20px 0;
|
151 |
+
text-align: center;
|
152 |
+
}
|
153 |
+
.contact-info {
|
154 |
+
max-width: 600px;
|
155 |
+
margin: 0 auto;
|
156 |
+
}
|
157 |
+
#login-title {
|
158 |
+
color: #333;
|
159 |
+
margin-bottom: 15px;
|
160 |
+
}
|
161 |
+
#login-instructions {
|
162 |
+
color: #666;
|
163 |
+
margin-bottom: 20px;
|
164 |
+
}
|
165 |
+
</style>
|
166 |
+
</head>
|
167 |
+
|
168 |
+
<body>
|
169 |
+
<div class="video-container">
|
170 |
+
<video autoplay muted loop id="background-video">
|
171 |
+
<source src="../static/background.mp4" type="video/mp4">
|
172 |
+
Your browser does not support the video tag.
|
173 |
+
</video>
|
174 |
+
</div>
|
175 |
+
|
176 |
+
<div class="content" id="main-content">
|
177 |
+
<div class="header">
|
178 |
+
<div class="logo-circle">
|
179 |
+
<img src="../static/smart-learn.jpeg" alt="Smart Learn Logo">
|
180 |
+
</div>
|
181 |
+
<h1 class="school-name">Smart-Learn</h1>
|
182 |
+
|
183 |
+
<!-- Login Text and Buttons -->
|
184 |
+
<p class="login-text">Login whether you are a student or teacher</p>
|
185 |
+
<div class="login-buttons">
|
186 |
+
<button class="login-button" onclick="showLogin('student')">Student Portal</button>
|
187 |
+
<button class="login-button" onclick="showLogin('teacher')">Teacher Portal</button>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
|
191 |
+
<!-- Contact Information Section -->
|
192 |
+
<div class="info-section">
|
193 |
+
<div class="contact-info">
|
194 |
+
<h2>Contact Information</h2>
|
195 |
+
<p><strong>Email:</strong> [email protected]</p>
|
196 |
+
<p><strong>Phone:</strong> (123) 456-7890</p>
|
197 |
+
<p><strong>Address:</strong> 123 Education Street, Knowledge City, ST 12345</p>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<!-- Login Modal -->
|
203 |
+
<div id="login-modal" class="modal">
|
204 |
+
<div class="modal-content">
|
205 |
+
<span class="close" onclick="closeLogin()">×</span>
|
206 |
+
<h2 id="login-title"></h2>
|
207 |
+
<p id="login-instructions">Enter your details:</p>
|
208 |
+
<form id="login-form">
|
209 |
+
<input type="text" id="username" name="username" placeholder="Username" required>
|
210 |
+
<input type="password" id="password" name="password" placeholder="Password" required>
|
211 |
+
<button type="submit">Login</button>
|
212 |
+
</form>
|
213 |
+
<p id="login-hint" style="color: #666; font-size: 0.9em; margin-top: 10px;"></p>
|
214 |
+
<p id="login-error" style="color: red; display: none;">Invalid username or password. Please try again.</p>
|
215 |
+
</div>
|
216 |
+
</div>
|
217 |
+
|
218 |
+
<script>
|
219 |
+
let currentLoginType = '';
|
220 |
+
|
221 |
+
function showLogin(type) {
|
222 |
+
currentLoginType = type;
|
223 |
+
document.getElementById('main-content').style.display = 'none';
|
224 |
+
document.getElementById('login-modal').style.display = 'block';
|
225 |
+
document.getElementById('login-title').innerText = type.charAt(0).toUpperCase() + type.slice(1) + ' Login';
|
226 |
+
document.getElementById('login-error').style.display = 'none';
|
227 |
+
|
228 |
+
// Set placeholders and hint based on login type
|
229 |
+
if (type === 'student') {
|
230 |
+
document.getElementById('username').placeholder = "Student ID (e.g., 'Alice Johnson')";
|
231 |
+
document.getElementById('password').placeholder = "Password (e.g., '12345')";
|
232 |
+
document.getElementById('login-hint').innerText = "Hint: Use your student ID as 'Alice Johnson' and default password is '12345'";
|
233 |
+
} else {
|
234 |
+
document.getElementById('username').placeholder = "Teacher ID (e.g., 'John Doe')";
|
235 |
+
document.getElementById('password').placeholder = "Password (e.g., '12345')";
|
236 |
+
document.getElementById('login-hint').innerText = "Hint: Use your Teacher ID as 'John Doe' and default password is '12345'";
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
function closeLogin() {
|
241 |
+
document.getElementById('login-modal').style.display = 'none';
|
242 |
+
document.getElementById('main-content').style.display = 'flex';
|
243 |
+
}
|
244 |
+
|
245 |
+
document.getElementById('login-form').addEventListener('submit', function(event) {
|
246 |
+
event.preventDefault();
|
247 |
+
const username = document.getElementById('username').value;
|
248 |
+
const password = document.getElementById('password').value;
|
249 |
+
|
250 |
+
fetch('/' + currentLoginType + '_login', {
|
251 |
+
method: 'POST',
|
252 |
+
headers: {
|
253 |
+
'Content-Type': 'application/json',
|
254 |
+
},
|
255 |
+
body: JSON.stringify({ name: username, password: password }),
|
256 |
+
})
|
257 |
+
.then(response => response.json())
|
258 |
+
.then(data => {
|
259 |
+
if (data.success) {
|
260 |
+
window.location.href = '/' + currentLoginType;
|
261 |
+
} else {
|
262 |
+
document.getElementById('login-error').style.display = 'block';
|
263 |
+
}
|
264 |
+
})
|
265 |
+
.catch(error => {
|
266 |
+
console.error('Error:', error);
|
267 |
+
});
|
268 |
+
});
|
269 |
+
|
270 |
+
// Close the modal if clicked outside
|
271 |
+
window.onclick = function(event) {
|
272 |
+
if (event.target == document.getElementById('login-modal')) {
|
273 |
+
closeLogin();
|
274 |
+
}
|
275 |
+
}
|
276 |
+
</script>
|
277 |
+
</body>
|
278 |
</html>
|