-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
355 lines (334 loc) · 17.6 KB
/
index.html
File metadata and controls
355 lines (334 loc) · 17.6 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cleanwarts</title>
<link rel="icon" type="image/png" href="assets/logo.svg">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>
<link rel="stylesheet" href="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css" />
<link href="https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap" rel="stylesheet">
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<script src="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-firestore-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-storage-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.8.0/firebase-database-compat.js"></script>
<style>
.firebase-emulator-warning {
display: none !important;
}
/* Music Player Styles */
#music-controls {
position: fixed;
bottom: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.6);
border-radius: 50%;
width: 50px;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
z-index: 1000;
transition: all 0.3s ease;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
#music-controls:hover {
transform: scale(1.1);
background: rgba(0, 0, 0, 0.8);
}
#music-controls svg {
width: 24px;
height: 24px;
fill: white;
}
#music-controls.muted .sound-on {
display: none;
}
#music-controls:not(.muted) .sound-off {
display: none;
}
</style>
</head>
<body>
<!-- Background Music Player -->
<audio id="bg-music" loop preload="auto">
<source src="assets/audio/harry-potter-theme.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<!-- Music Control Button -->
<div id="music-controls">
<svg class="sound-on" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M14.016 3.234Q16.125 3.234 17.648 4.758Q19.172 6.281 19.172 8.39V15.844Q19.172 17.953 17.648 19.477Q16.125 21 14.016 21H6.563Q4.453 21 2.93 19.477Q1.406 17.953 1.406 15.844V8.39Q1.406 6.281 2.93 4.758Q4.453 3.234 6.563 3.234H14.016ZM10.289 8.859Q9.844 8.578 9.352 8.742Q8.859 8.906 8.859 9.422V14.813Q8.859 15.328 9.352 15.492Q9.844 15.656 10.289 15.375L14.477 12.68Q14.836 12.445 14.836 12.117Q14.836 11.789 14.477 11.555L10.289 8.859Z"/>
</svg>
<svg class="sound-off" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/>
</svg>
</div>
<div id="app-container">
<!-- Auth screens -->
<div id="auth-container" class="container">
<div class="auth-form" id="login-form">
<h2>Welcome to Cleanwarts</h2>
<div class="form-group">
<label for="login-email">Email</label>
<input type="email" id="login-email" required>
</div>
<div class="form-group">
<label for="login-password">Password</label>
<input type="password" id="login-password" required>
</div>
<button id="login-button" class="primary-button">Login</button>
<p>Don't have an account? <a href="#" id="show-register">Register</a></p>
</div>
<div class="auth-form hidden" id="register-form">
<h2>Join Cleanwarts</h2>
<div class="form-group">
<label for="register-name">Full Name</label>
<input type="text" id="register-name" required>
</div>
<div class="form-group">
<label for="register-email">Email</label>
<input type="email" id="register-email" required>
</div>
<div class="form-group">
<label for="register-mobile">Mobile Number</label>
<input type="tel" id="register-mobile" required>
</div>
<div class="form-group">
<label for="register-password">Password</label>
<input type="password" id="register-password" required>
</div>
<div class="form-group">
<label>Select Your House</label>
<div class="house-selection">
<div class="house-option" data-house="gryffindor">
<img src="assets/gryffindor.png" alt="Gryffindor">
<span>Gryffindor</span>
</div>
<div class="house-option" data-house="hufflepuff">
<img src="assets/hufflepuff.png" alt="Hufflepuff">
<span>Hufflepuff</span>
</div>
<div class="house-option" data-house="ravenclaw">
<img src="assets/ravenclaw.png" alt="Ravenclaw">
<span>Ravenclaw</span>
</div>
<div class="house-option" data-house="slytherin">
<img src="assets/slytherin.png" alt="Slytherin">
<span>Slytherin</span>
</div>
</div>
</div>
<button id="register-button" class="primary-button">Register</button>
<p>Already have an account? <a href="#" id="show-login">Login</a></p>
</div>
</div>
<!-- Main Dashboard - Hidden until logged in -->
<div id="dashboard-container" class="container hidden">
<header>
<div class="logo">
<img src="assets/logo.svg" alt="Cleanwarts Logo">
<h1>Cleanwarts</h1>
</div>
<div class="user-info">
<span id="user-name"></span>
<span id="user-house" class="house-badge"></span>
<button id="logout-button">Logout</button>
</div>
</header>
<nav>
<ul>
<li data-page="home" class="active">Dashboard</li>
<li data-page="map">Campus Map</li>
<li data-page="chat">House Chat</li>
<li data-page="leaderboard">Leaderboards</li>
<li data-page="my-tasks">My Tasks</li>
</ul>
</nav>
<main>
<!-- Home Dashboard -->
<section id="home-page" class="page">
<div class="welcome-banner">
<h2>Welcome, <span id="welcome-name"></span>!</h2>
<div class="house-info">
<img id="house-crest" alt="House Crest">
<div>
<h3 id="house-name"></h3>
<p>House Points: <span id="house-points"></span></p>
</div>
</div>
<button id="refresh-dashboard" class="refresh-button" title="Refresh Dashboard Data">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2"/>
</svg>
</button>
</div>
<div class="quick-stats">
<div class="stat-card">
<h3>Your Tasks</h3>
<p id="user-task-count">0</p>
</div>
<div class="stat-card">
<h3>Your Points</h3>
<p id="user-points">0</p>
</div>
<div class="stat-card">
<h3>House Rank</h3>
<p id="house-rank">-</p>
</div>
<div class="stat-card">
<h3>Platform Tasks</h3>
<p id="total-tasks">0</p>
</div>
</div>
<div class="quick-actions">
<button class="action-button" data-action="map">View Map</button>
<button class="action-button" data-action="chat">House Chat</button>
<button class="action-button" data-action="leaderboard">Leaderboards</button>
</div>
</section>
<!-- Campus Map -->
<section id="map-page" class="page hidden">
<h2>Campus Map</h2>
<div id="campus-map"></div>
<button id="request-cleaning" class="primary-button">Request Cleaning</button>
<!-- Task Submission Modal -->
<div id="task-submission-modal" class="modal hidden">
<div class="modal-content">
<span class="close-modal">×</span>
<h3>Submit Cleaning Task</h3>
<p class="modal-instructions">Please upload before and after photos of your cleaning work for verification:</p>
<form id="task-submission-form">
<div class="form-group">
<label for="task-title">Title</label>
<input type="text" id="task-title" required>
</div>
<div class="form-group">
<label for="task-description">Description</label>
<textarea id="task-description" required placeholder="Describe what you cleaned and how you did it..."></textarea>
</div>
<div class="form-group">
<label>Before Image <span class="required-label">(Required)</span></label>
<p class="input-help">Take a photo of the area before you start cleaning</p>
<input type="file" id="before-image" accept="image/*" required>
<div id="before-preview" class="image-preview"></div>
</div>
<div class="form-group">
<label>After Image <span class="required-label">(Required)</span></label>
<p class="input-help">Take a photo of the same area after you've cleaned it</p>
<input type="file" id="after-image" accept="image/*" required>
<div id="after-preview" class="image-preview"></div>
</div>
<button type="submit" class="primary-button">Submit Task</button>
</form>
</div>
</div>
<!-- Request Cleaning Modal -->
<div id="request-cleaning-modal" class="modal hidden">
<div class="modal-content">
<span class="close-modal">×</span>
<h3>Request Cleaning</h3>
<p class="modal-instructions">Mark an area that needs cleaning for others to find and clean:</p>
<form id="request-cleaning-form">
<div class="form-group">
<label for="request-title">Title</label>
<input type="text" id="request-title" required placeholder="E.g., Trash near library">
</div>
<div class="form-group">
<label for="request-description">Description</label>
<textarea id="request-description" required placeholder="Describe what needs to be cleaned..."></textarea>
</div>
<div class="form-group">
<label>Selected Location</label>
<p class="input-help">Draw on the map or click a location to mark the area</p>
<div id="selected-location" class="location-display">No location selected</div>
</div>
<button type="submit" class="primary-button">Submit Request</button>
</form>
</div>
</div>
</section>
<!-- House Chat -->
<section id="chat-page" class="page hidden">
<h2>House Chat</h2>
<div class="chat-container">
<div id="chat-messages" class="messages-container"></div>
<div class="message-input">
<input type="text" id="message-input" placeholder="Type your message...">
<button id="send-message">Send</button>
</div>
</div>
</section>
<!-- Leaderboards -->
<section id="leaderboard-page" class="page hidden">
<h2>Leaderboards</h2>
<div class="leaderboard-tabs">
<button class="tab-button active" data-tab="houses">Houses</button>
<button class="tab-button" data-tab="individuals">House Members</button>
</div>
<div id="houses-leaderboard" class="leaderboard-table">
<div class="leaderboard-header">
<span>Rank</span>
<span>House</span>
<span>Points</span>
</div>
<div id="houses-rankings"></div>
</div>
<div id="individuals-leaderboard" class="leaderboard-table hidden">
<div class="leaderboard-header">
<span>Rank</span>
<span>Name</span>
<span>Points</span>
</div>
<div id="individuals-rankings"></div>
</div>
</section>
<!-- My Tasks -->
<section id="my-tasks-page" class="page hidden">
<h2>My Tasks</h2>
<div id="tasks-container"></div>
</section>
</main>
</div>
<!-- Admin Panel - Hidden unless user is admin -->
<div id="admin-container" class="container hidden">
<header>
<div class="logo">
<img src="assets/logo.svg" alt="Cleanwarts Logo">
<h1>Cleanwarts Admin</h1>
</div>
<div class="user-info">
<span id="admin-name"></span>
<button id="admin-logout-button">Logout</button>
</div>
</header>
<main>
<section id="task-verification">
<h2>Task Verification</h2>
<div id="pending-tasks"></div>
</section>
<!-- Admin Actions Container (for house management and other admin functions) -->
<section id="admin-actions">
<h2>Admin Actions</h2>
<div id="admin-actions-container"></div>
</section>
</main>
</div>
</div>
<!-- Scripts -->
<script src="js/config.js"></script>
<script src="js/auth.js"></script>
<script src="js/map.js"></script>
<script src="js/chat.js"></script>
<script src="js/leaderboard.js"></script>
<script src="js/tasks.js"></script>
<script src="js/admin.js"></script>
<script src="js/music.js"></script>
<script src="js/app.js"></script>
</body>
</html>