tsbetterworkpmo commited on
Commit
9eb3f47
·
verified ·
1 Parent(s): 569d085

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +1073 -19
  3. prompts.txt +5 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Project
3
- emoji: 📉
4
- colorFrom: blue
5
- colorTo: gray
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: project
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,1073 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </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>Academic Calendar - Dark Mode</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
11
+
12
+ body {
13
+ font-family: 'Inter', sans-serif;
14
+ background-color: #0f172a;
15
+ color: #e2e8f0;
16
+ }
17
+
18
+ .calendar-day {
19
+ transition: all 0.2s ease;
20
+ }
21
+
22
+ .calendar-day:hover {
23
+ background-color: #1e293b;
24
+ }
25
+
26
+ .calendar-day.today {
27
+ border: 2px solid #3b82f6;
28
+ }
29
+
30
+ .calendar-day.has-events::after {
31
+ content: '';
32
+ position: absolute;
33
+ bottom: 8px;
34
+ left: 50%;
35
+ transform: translateX(-50%);
36
+ width: 6px;
37
+ height: 6px;
38
+ border-radius: 50%;
39
+ background-color: #3b82f6;
40
+ }
41
+
42
+ .assignment-card {
43
+ transition: all 0.2s ease;
44
+ border-left: 4px solid;
45
+ }
46
+
47
+ .assignment-card:hover {
48
+ transform: translateY(-2px);
49
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
50
+ }
51
+
52
+ .assignment-card.urgent {
53
+ border-left-color: #ef4444;
54
+ }
55
+
56
+ .assignment-card.upcoming {
57
+ border-left-color: #f59e0b;
58
+ }
59
+
60
+ .assignment-card.completed {
61
+ opacity: 0.7;
62
+ border-left-color: #10b981;
63
+ }
64
+
65
+ .checkbox-container input:checked ~ .checkmark {
66
+ background-color: #3b82f6;
67
+ border-color: #3b82f6;
68
+ }
69
+
70
+ .checkbox-container input:checked ~ .checkmark:after {
71
+ display: block;
72
+ }
73
+
74
+ .checkbox-container .checkmark:after {
75
+ left: 6px;
76
+ top: 2px;
77
+ width: 5px;
78
+ height: 10px;
79
+ border: solid white;
80
+ border-width: 0 2px 2px 0;
81
+ transform: rotate(45deg);
82
+ }
83
+
84
+ .flatpickr-input {
85
+ background-color: #1e293b !important;
86
+ color: #e2e8f0 !important;
87
+ border-color: #334155 !important;
88
+ }
89
+
90
+ .flatpickr-day.selected {
91
+ background-color: #3b82f6 !important;
92
+ border-color: #3b82f6 !important;
93
+ }
94
+
95
+ .flatpickr-calendar {
96
+ background-color: #1e293b !important;
97
+ border-color: #334155 !important;
98
+ }
99
+
100
+ .flatpickr-day {
101
+ color: #e2e8f0 !important;
102
+ }
103
+
104
+ .flatpickr-day:hover {
105
+ background-color: #334155 !important;
106
+ }
107
+
108
+ .flatpickr-day.today {
109
+ border-color: #3b82f6 !important;
110
+ }
111
+
112
+ .flatpickr-time input {
113
+ color: #e2e8f0 !important;
114
+ }
115
+
116
+ .color-option {
117
+ transition: transform 0.2s ease;
118
+ }
119
+
120
+ .color-option:hover {
121
+ transform: scale(1.1);
122
+ }
123
+
124
+ .color-option.selected {
125
+ transform: scale(1.1);
126
+ box-shadow: 0 0 0 2px #3b82f6;
127
+ }
128
+ </style>
129
+ </head>
130
+ <body class="min-h-screen">
131
+ <div class="container mx-auto px-4 py-8">
132
+ <div class="flex flex-col lg:flex-row gap-6">
133
+ <!-- Sidebar -->
134
+ <div class="w-full lg:w-64 bg-slate-800 rounded-xl p-4 h-fit">
135
+ <h1 class="text-2xl font-bold mb-6 flex items-center">
136
+ <i class="fas fa-calendar-days mr-2 text-blue-400"></i>
137
+ Academic Calendar
138
+ </h1>
139
+
140
+ <div class="mb-6">
141
+ <button id="add-assignment-btn" class="w-full flex items-center justify-center py-2 px-4 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition">
142
+ <i class="fas fa-plus mr-2"></i> Add Assignment
143
+ </button>
144
+ </div>
145
+
146
+ <div class="mb-6">
147
+ <h3 class="font-medium text-slate-300 mb-2">Classes</h3>
148
+ <div id="classes-list" class="space-y-2">
149
+ <!-- Classes will be added here -->
150
+ </div>
151
+ <button id="add-class-btn" class="mt-3 text-sm text-blue-400 hover:text-blue-300 flex items-center">
152
+ <i class="fas fa-plus mr-1"></i> Add Class
153
+ </button>
154
+ </div>
155
+
156
+ <div class="mb-6">
157
+ <h3 class="font-medium text-slate-300 mb-2">Filters</h3>
158
+ <div class="space-y-1">
159
+ <button id="filter-all" class="w-full text-left px-3 py-1 text-sm bg-blue-600 text-white rounded-lg">All Assignments</button>
160
+ <button id="filter-upcoming" class="w-full text-left px-3 py-1 text-sm bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg">Upcoming</button>
161
+ <button id="filter-urgent" class="w-full text-left px-3 py-1 text-sm bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg">Due Soon</button>
162
+ <button id="filter-completed" class="w-full text-left px-3 py-1 text-sm bg-slate-700 hover:bg-slate-600 text-slate-200 rounded-lg">Completed</button>
163
+ </div>
164
+ </div>
165
+
166
+ <div class="pt-4 border-t border-slate-700">
167
+ <div class="flex items-center space-x-3">
168
+ <div class="w-8 h-8 rounded-full bg-blue-900 flex items-center justify-center text-blue-400">
169
+ <i class="fas fa-user"></i>
170
+ </div>
171
+ <div>
172
+ <div class="font-medium" id="username">Student</div>
173
+ <div class="text-xs text-slate-400">Viewing Calendar</div>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ </div>
178
+
179
+ <!-- Main Content -->
180
+ <div class="flex-1">
181
+ <!-- Calendar Header -->
182
+ <div class="bg-slate-800 rounded-xl p-4 mb-6 flex flex-col sm:flex-row justify-between items-center">
183
+ <div class="flex items-center mb-4 sm:mb-0">
184
+ <h2 id="current-month-year" class="text-xl font-semibold mr-4">Month Year</h2>
185
+ <div class="flex space-x-2">
186
+ <button id="prev-month" class="p-2 rounded-lg bg-slate-700 hover:bg-slate-600">
187
+ <i class="fas fa-chevron-left"></i>
188
+ </button>
189
+ <button id="today" class="px-3 py-2 rounded-lg bg-slate-700 hover:bg-slate-600 text-sm">
190
+ Today
191
+ </button>
192
+ <button id="next-month" class="p-2 rounded-lg bg-slate-700 hover:bg-slate-600">
193
+ <i class="fas fa-chevron-right"></i>
194
+ </button>
195
+ </div>
196
+ </div>
197
+
198
+ <div class="flex items-center space-x-2">
199
+ <div class="relative">
200
+ <input type="text" id="search-assignments" placeholder="Search assignments..." class="pl-10 pr-4 py-2 bg-slate-700 border border-slate-600 rounded-lg focus:ring-blue-500 focus:border-blue-500 w-full sm:w-64">
201
+ <i class="fas fa-search absolute left-3 top-3 text-slate-400"></i>
202
+ </div>
203
+ <button id="view-toggle" class="p-2 rounded-lg bg-slate-700 hover:bg-slate-600">
204
+ <i class="fas fa-list" id="view-icon"></i>
205
+ </button>
206
+ </div>
207
+ </div>
208
+
209
+ <!-- Calendar View -->
210
+ <div id="calendar-view">
211
+ <!-- Weekday Headers -->
212
+ <div class="grid grid-cols-7 gap-1 mb-2">
213
+ <div class="text-center font-medium text-slate-400 py-2">Sun</div>
214
+ <div class="text-center font-medium text-slate-400 py-2">Mon</div>
215
+ <div class="text-center font-medium text-slate-400 py-2">Tue</div>
216
+ <div class="text-center font-medium text-slate-400 py-2">Wed</div>
217
+ <div class="text-center font-medium text-slate-400 py-2">Thu</div>
218
+ <div class="text-center font-medium text-slate-400 py-2">Fri</div>
219
+ <div class="text-center font-medium text-slate-400 py-2">Sat</div>
220
+ </div>
221
+
222
+ <!-- Calendar Grid -->
223
+ <div id="calendar-grid" class="grid grid-cols-7 gap-1">
224
+ <!-- Days will be populated by JavaScript -->
225
+ </div>
226
+ </div>
227
+
228
+ <!-- List View (Hidden by default) -->
229
+ <div id="list-view" class="hidden">
230
+ <div class="bg-slate-800 rounded-xl p-4 mb-4">
231
+ <h3 class="text-lg font-semibold mb-4">Assignments</h3>
232
+
233
+ <div id="assignments-container" class="space-y-3">
234
+ <!-- Assignments will be added here -->
235
+ </div>
236
+
237
+ <div id="no-assignments" class="text-center py-12">
238
+ <i class="fas fa-tasks text-4xl text-slate-600 mb-3"></i>
239
+ <h4 class="text-lg font-medium text-slate-400">No assignments yet</h4>
240
+ <p class="text-slate-500 mt-1">Add your first assignment by clicking the "Add Assignment" button</p>
241
+ </div>
242
+ </div>
243
+ </div>
244
+
245
+ <!-- Day View (Hidden by default) -->
246
+ <div id="day-view" class="hidden">
247
+ <div class="bg-slate-800 rounded-xl p-4">
248
+ <div class="flex justify-between items-center mb-4">
249
+ <h3 id="day-view-date" class="text-lg font-semibold">Day, Month Date</h3>
250
+ <button id="close-day-view" class="p-2 rounded-lg bg-slate-700 hover:bg-slate-600">
251
+ <i class="fas fa-times"></i>
252
+ </button>
253
+ </div>
254
+
255
+ <div id="day-assignments" class="space-y-3">
256
+ <!-- Day-specific assignments will be added here -->
257
+ </div>
258
+
259
+ <div id="no-day-assignments" class="text-center py-12">
260
+ <i class="fas fa-calendar-day text-4xl text-slate-600 mb-3"></i>
261
+ <h4 class="text-lg font-medium text-slate-400">No assignments this day</h4>
262
+ </div>
263
+ </div>
264
+ </div>
265
+ </div>
266
+ </div>
267
+ </div>
268
+
269
+ <!-- Add Class Modal -->
270
+ <div id="add-class-modal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 hidden">
271
+ <div class="bg-slate-800 rounded-xl shadow-xl w-full max-w-md">
272
+ <div class="p-4 border-b border-slate-700 flex justify-between items-center">
273
+ <h3 class="text-lg font-semibold">Add New Class</h3>
274
+ <button id="close-class-modal" class="text-slate-400 hover:text-slate-300">
275
+ <i class="fas fa-times"></i>
276
+ </button>
277
+ </div>
278
+ <div class="p-6">
279
+ <div class="mb-4">
280
+ <label for="class-name" class="block text-sm font-medium text-slate-300 mb-1">Class Name</label>
281
+ <input type="text" id="class-name" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg focus:ring-blue-500 focus:border-blue-500" placeholder="e.g. Math 101">
282
+ </div>
283
+ <div class="mb-4">
284
+ <label for="class-color" class="block text-sm font-medium text-slate-300 mb-2">Color Theme</label>
285
+ <div class="flex flex-wrap gap-3">
286
+ <div class="color-option w-8 h-8 rounded-full bg-red-500 cursor-pointer" data-color="red"></div>
287
+ <div class="color-option w-8 h-8 rounded-full bg-blue-500 cursor-pointer" data-color="blue"></div>
288
+ <div class="color-option w-8 h-8 rounded-full bg-green-500 cursor-pointer" data-color="green"></div>
289
+ <div class="color-option w-8 h-8 rounded-full bg-yellow-500 cursor-pointer" data-color="yellow"></div>
290
+ <div class="color-option w-8 h-8 rounded-full bg-purple-500 cursor-pointer" data-color="purple"></div>
291
+ <div class="color-option w-8 h-8 rounded-full bg-pink-500 cursor-pointer" data-color="pink"></div>
292
+ <div class="color-option w-8 h-8 rounded-full bg-indigo-500 cursor-pointer" data-color="indigo"></div>
293
+ <div class="color-option w-8 h-8 rounded-full bg-teal-500 cursor-pointer" data-color="teal"></div>
294
+ </div>
295
+ </div>
296
+ </div>
297
+ <div class="p-4 border-t border-slate-700 flex justify-end space-x-3">
298
+ <button id="cancel-class" class="px-4 py-2 border border-slate-600 text-slate-300 rounded-lg hover:bg-slate-700">Cancel</button>
299
+ <button id="save-class" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg">Save Class</button>
300
+ </div>
301
+ </div>
302
+ </div>
303
+
304
+ <!-- Add Assignment Modal -->
305
+ <div id="add-assignment-modal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 hidden">
306
+ <div class="bg-slate-800 rounded-xl shadow-xl w-full max-w-md">
307
+ <div class="p-4 border-b border-slate-700 flex justify-between items-center">
308
+ <h3 class="text-lg font-semibold">Add New Assignment</h3>
309
+ <button id="close-assignment-modal" class="text-slate-400 hover:text-slate-300">
310
+ <i class="fas fa-times"></i>
311
+ </button>
312
+ </div>
313
+ <div class="p-6">
314
+ <div class="mb-4">
315
+ <label for="assignment-title" class="block text-sm font-medium text-slate-300 mb-1">Title</label>
316
+ <input type="text" id="assignment-title" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg focus:ring-blue-500 focus:border-blue-500" placeholder="e.g. Chapter 5 Homework">
317
+ </div>
318
+ <div class="mb-4">
319
+ <label for="assignment-class" class="block text-sm font-medium text-slate-300 mb-1">Class</label>
320
+ <select id="assignment-class" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg focus:ring-blue-500 focus:border-blue-500">
321
+ <!-- Classes will be populated here -->
322
+ </select>
323
+ </div>
324
+ <div class="mb-4">
325
+ <label for="assignment-due-date" class="block text-sm font-medium text-slate-300 mb-1">Due Date</label>
326
+ <input type="text" id="assignment-due-date" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg focus:ring-blue-500 focus:border-blue-500 flatpickr-input" placeholder="Select date">
327
+ </div>
328
+ <div class="mb-4">
329
+ <label for="assignment-description" class="block text-sm font-medium text-slate-300 mb-1">Description</label>
330
+ <textarea id="assignment-description" rows="3" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg focus:ring-blue-500 focus:border-blue-500" placeholder="Add details about the assignment..."></textarea>
331
+ </div>
332
+ </div>
333
+ <div class="p-4 border-t border-slate-700 flex justify-end space-x-3">
334
+ <button id="cancel-assignment" class="px-4 py-2 border border-slate-600 text-slate-300 rounded-lg hover:bg-slate-700">Cancel</button>
335
+ <button id="save-assignment" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg">Save Assignment</button>
336
+ </div>
337
+ </div>
338
+ </div>
339
+
340
+ <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
341
+ <script>
342
+ // Data storage
343
+ let classes = [];
344
+ let assignments = [];
345
+ let currentDate = new Date();
346
+ let currentView = 'calendar'; // 'calendar', 'list', or 'day'
347
+ let selectedDay = null;
348
+ let selectedColor = 'blue';
349
+ let currentFilter = 'all';
350
+
351
+ // DOM elements
352
+ const classesList = document.getElementById('classes-list');
353
+ const currentMonthYear = document.getElementById('current-month-year');
354
+ const calendarGrid = document.getElementById('calendar-grid');
355
+ const assignmentsContainer = document.getElementById('assignments-container');
356
+ const noAssignments = document.getElementById('no-assignments');
357
+ const dayAssignments = document.getElementById('day-assignments');
358
+ const noDayAssignments = document.getElementById('no-day-assignments');
359
+ const dayViewDate = document.getElementById('day-view-date');
360
+ const addClassBtn = document.getElementById('add-class-btn');
361
+ const addAssignmentBtn = document.getElementById('add-assignment-btn');
362
+ const prevMonthBtn = document.getElementById('prev-month');
363
+ const nextMonthBtn = document.getElementById('next-month');
364
+ const todayBtn = document.getElementById('today');
365
+ const viewToggleBtn = document.getElementById('view-toggle');
366
+ const viewIcon = document.getElementById('view-icon');
367
+ const calendarView = document.getElementById('calendar-view');
368
+ const listView = document.getElementById('list-view');
369
+ const dayView = document.getElementById('day-view');
370
+ const closeDayViewBtn = document.getElementById('close-day-view');
371
+ const searchAssignments = document.getElementById('search-assignments');
372
+ const filterAll = document.getElementById('filter-all');
373
+ const filterUpcoming = document.getElementById('filter-upcoming');
374
+ const filterUrgent = document.getElementById('filter-urgent');
375
+ const filterCompleted = document.getElementById('filter-completed');
376
+ const addClassModal = document.getElementById('add-class-modal');
377
+ const addAssignmentModal = document.getElementById('add-assignment-modal');
378
+ const closeClassModal = document.getElementById('close-class-modal');
379
+ const closeAssignmentModal = document.getElementById('close-assignment-modal');
380
+ const cancelClass = document.getElementById('cancel-class');
381
+ const cancelAssignment = document.getElementById('cancel-assignment');
382
+ const saveClass = document.getElementById('save-class');
383
+ const saveAssignment = document.getElementById('save-assignment');
384
+ const classNameInput = document.getElementById('class-name');
385
+ const assignmentTitleInput = document.getElementById('assignment-title');
386
+ const assignmentClassInput = document.getElementById('assignment-class');
387
+ const assignmentDueDateInput = document.getElementById('assignment-due-date');
388
+ const assignmentDescriptionInput = document.getElementById('assignment-description');
389
+ const colorOptions = document.querySelectorAll('.color-option');
390
+
391
+ // Initialize date picker
392
+ flatpickr("#assignment-due-date", {
393
+ enableTime: false,
394
+ dateFormat: "Y-m-d",
395
+ minDate: "today"
396
+ });
397
+
398
+ // Event listeners
399
+ document.addEventListener('DOMContentLoaded', () => {
400
+ loadFromLocalStorage();
401
+ renderCalendar();
402
+ renderClasses();
403
+ updateView();
404
+
405
+ // Set default color selection
406
+ document.querySelector('.color-option[data-color="blue"]').classList.add('selected');
407
+ });
408
+
409
+ addClassBtn.addEventListener('click', () => {
410
+ addClassModal.classList.remove('hidden');
411
+ classNameInput.focus();
412
+ });
413
+
414
+ addAssignmentBtn.addEventListener('click', () => {
415
+ if (classes.length === 0) {
416
+ alert('Please add at least one class first.');
417
+ addClassModal.classList.remove('hidden');
418
+ return;
419
+ }
420
+ addAssignmentModal.classList.remove('hidden');
421
+ assignmentTitleInput.focus();
422
+ populateClassDropdown();
423
+ });
424
+
425
+ prevMonthBtn.addEventListener('click', () => {
426
+ currentDate.setMonth(currentDate.getMonth() - 1);
427
+ renderCalendar();
428
+ });
429
+
430
+ nextMonthBtn.addEventListener('click', () => {
431
+ currentDate.setMonth(currentDate.getMonth() + 1);
432
+ renderCalendar();
433
+ });
434
+
435
+ todayBtn.addEventListener('click', () => {
436
+ currentDate = new Date();
437
+ renderCalendar();
438
+ });
439
+
440
+ viewToggleBtn.addEventListener('click', () => {
441
+ if (currentView === 'calendar') {
442
+ currentView = 'list';
443
+ viewIcon.classList.remove('fa-list');
444
+ viewIcon.classList.add('fa-calendar');
445
+ } else {
446
+ currentView = 'calendar';
447
+ viewIcon.classList.remove('fa-calendar');
448
+ viewIcon.classList.add('fa-list');
449
+ }
450
+ updateView();
451
+ });
452
+
453
+ closeDayViewBtn.addEventListener('click', () => {
454
+ currentView = 'calendar';
455
+ updateView();
456
+ });
457
+
458
+ closeClassModal.addEventListener('click', () => {
459
+ addClassModal.classList.add('hidden');
460
+ });
461
+
462
+ closeAssignmentModal.addEventListener('click', () => {
463
+ addAssignmentModal.classList.add('hidden');
464
+ });
465
+
466
+ cancelClass.addEventListener('click', () => {
467
+ addClassModal.classList.add('hidden');
468
+ });
469
+
470
+ cancelAssignment.addEventListener('click', () => {
471
+ addAssignmentModal.classList.add('hidden');
472
+ });
473
+
474
+ saveClass.addEventListener('click', () => {
475
+ const name = classNameInput.value.trim();
476
+ if (name) {
477
+ addClass(name, selectedColor);
478
+ classNameInput.value = '';
479
+ addClassModal.classList.add('hidden');
480
+ }
481
+ });
482
+
483
+ saveAssignment.addEventListener('click', () => {
484
+ const title = assignmentTitleInput.value.trim();
485
+ const classId = assignmentClassInput.value;
486
+ const dueDate = assignmentDueDateInput.value;
487
+ const description = assignmentDescriptionInput.value.trim();
488
+
489
+ if (title && dueDate && classId) {
490
+ addAssignment(classId, title, dueDate, description);
491
+ assignmentTitleInput.value = '';
492
+ assignmentDueDateInput.value = '';
493
+ assignmentDescriptionInput.value = '';
494
+ addAssignmentModal.classList.add('hidden');
495
+
496
+ // If we're in day view and the assignment is for a different day, stay in calendar view
497
+ if (currentView === 'day') {
498
+ const assignmentDate = new Date(dueDate);
499
+ if (assignmentDate.toDateString() !== selectedDay.toDateString()) {
500
+ currentView = 'calendar';
501
+ updateView();
502
+ }
503
+ }
504
+
505
+ renderCalendar();
506
+ }
507
+ });
508
+
509
+ colorOptions.forEach(option => {
510
+ option.addEventListener('click', () => {
511
+ colorOptions.forEach(opt => opt.classList.remove('selected'));
512
+ option.classList.add('selected');
513
+ selectedColor = option.dataset.color;
514
+ });
515
+ });
516
+
517
+ searchAssignments.addEventListener('input', () => {
518
+ if (currentView === 'list') {
519
+ renderAssignments();
520
+ } else if (currentView === 'day') {
521
+ renderDayAssignments(selectedDay);
522
+ }
523
+ });
524
+
525
+ filterAll.addEventListener('click', () => {
526
+ currentFilter = 'all';
527
+ updateFilterButtons();
528
+ if (currentView === 'list') {
529
+ renderAssignments();
530
+ } else if (currentView === 'day') {
531
+ renderDayAssignments(selectedDay);
532
+ }
533
+ });
534
+
535
+ filterUpcoming.addEventListener('click', () => {
536
+ currentFilter = 'upcoming';
537
+ updateFilterButtons();
538
+ if (currentView === 'list') {
539
+ renderAssignments();
540
+ } else if (currentView === 'day') {
541
+ renderDayAssignments(selectedDay);
542
+ }
543
+ });
544
+
545
+ filterUrgent.addEventListener('click', () => {
546
+ currentFilter = 'urgent';
547
+ updateFilterButtons();
548
+ if (currentView === 'list') {
549
+ renderAssignments();
550
+ } else if (currentView === 'day') {
551
+ renderDayAssignments(selectedDay);
552
+ }
553
+ });
554
+
555
+ filterCompleted.addEventListener('click', () => {
556
+ currentFilter = 'completed';
557
+ updateFilterButtons();
558
+ if (currentView === 'list') {
559
+ renderAssignments();
560
+ } else if (currentView === 'day') {
561
+ renderDayAssignments(selectedDay);
562
+ }
563
+ });
564
+
565
+ // Functions
566
+ function addClass(name, color) {
567
+ const id = Date.now().toString();
568
+ const newClass = { id, name, color };
569
+ classes.push(newClass);
570
+ saveToLocalStorage();
571
+ renderClasses();
572
+ }
573
+
574
+ function addAssignment(classId, title, dueDate, description) {
575
+ const id = Date.now().toString();
576
+ const newAssignment = {
577
+ id,
578
+ classId,
579
+ title,
580
+ dueDate,
581
+ description,
582
+ completed: false,
583
+ createdAt: new Date().toISOString()
584
+ };
585
+ assignments.push(newAssignment);
586
+ saveToLocalStorage();
587
+
588
+ if (currentView === 'list') {
589
+ renderAssignments();
590
+ } else if (currentView === 'day') {
591
+ renderDayAssignments(selectedDay);
592
+ }
593
+
594
+ renderCalendar();
595
+ }
596
+
597
+ function toggleAssignmentCompletion(assignmentId) {
598
+ const assignment = assignments.find(a => a.id === assignmentId);
599
+ if (assignment) {
600
+ assignment.completed = !assignment.completed;
601
+ saveToLocalStorage();
602
+
603
+ if (currentView === 'list') {
604
+ renderAssignments();
605
+ } else if (currentView === 'day') {
606
+ renderDayAssignments(selectedDay);
607
+ }
608
+
609
+ renderCalendar();
610
+ }
611
+ }
612
+
613
+ function deleteAssignment(assignmentId) {
614
+ if (confirm('Are you sure you want to delete this assignment?')) {
615
+ assignments = assignments.filter(a => a.id !== assignmentId);
616
+ saveToLocalStorage();
617
+
618
+ if (currentView === 'list') {
619
+ renderAssignments();
620
+ } else if (currentView === 'day') {
621
+ renderDayAssignments(selectedDay);
622
+ }
623
+
624
+ renderCalendar();
625
+ }
626
+ }
627
+
628
+ function renderCalendar() {
629
+ const year = currentDate.getFullYear();
630
+ const month = currentDate.getMonth();
631
+
632
+ currentMonthYear.textContent = `${getMonthName(month)} ${year}`;
633
+
634
+ // Get first day of month and last date of month
635
+ const firstDay = new Date(year, month, 1);
636
+ const lastDay = new Date(year, month + 1, 0);
637
+
638
+ // Get days from previous month to show
639
+ const prevMonthDays = firstDay.getDay(); // 0 = Sunday, 6 = Saturday
640
+
641
+ // Get days from next month to show
642
+ const nextMonthDays = 6 - lastDay.getDay();
643
+
644
+ // Calculate total days to show (always 6 weeks)
645
+ const totalDays = prevMonthDays + lastDay.getDate() + nextMonthDays;
646
+
647
+ calendarGrid.innerHTML = '';
648
+
649
+ // Previous month days
650
+ const prevMonthLastDay = new Date(year, month, 0).getDate();
651
+ for (let i = prevMonthDays - 1; i >= 0; i--) {
652
+ const day = prevMonthLastDay - i;
653
+ const date = new Date(year, month - 1, day);
654
+ renderCalendarDay(date, true);
655
+ }
656
+
657
+ // Current month days
658
+ for (let day = 1; day <= lastDay.getDate(); day++) {
659
+ const date = new Date(year, month, day);
660
+ renderCalendarDay(date, false);
661
+ }
662
+
663
+ // Next month days
664
+ for (let day = 1; day <= nextMonthDays; day++) {
665
+ const date = new Date(year, month + 1, day);
666
+ renderCalendarDay(date, true);
667
+ }
668
+ }
669
+
670
+ function renderCalendarDay(date, isOtherMonth) {
671
+ const day = date.getDate();
672
+ const month = date.getMonth();
673
+ const year = date.getFullYear();
674
+ const today = new Date();
675
+
676
+ const dayElement = document.createElement('div');
677
+ dayElement.className = `calendar-day relative bg-slate-800 rounded-lg p-2 h-24 overflow-y-auto ${isOtherMonth ? 'opacity-50' : ''} ${date.toDateString() === today.toDateString() ? 'today' : ''}`;
678
+
679
+ // Check if this day has any assignments
680
+ const dayAssignments = assignments.filter(a => {
681
+ const dueDate = new Date(a.dueDate);
682
+ return dueDate.getDate() === day &&
683
+ dueDate.getMonth() === month &&
684
+ dueDate.getFullYear() === year;
685
+ });
686
+
687
+ if (dayAssignments.length > 0) {
688
+ dayElement.classList.add('has-events');
689
+
690
+ // Add color indicators for each class with assignments
691
+ const classColors = {};
692
+ dayAssignments.forEach(a => {
693
+ const cls = classes.find(c => c.id === a.classId);
694
+ if (cls) {
695
+ classColors[cls.color] = true;
696
+ }
697
+ });
698
+
699
+ const colorsContainer = document.createElement('div');
700
+ colorsContainer.className = 'flex space-x-1 absolute top-2 right-2';
701
+
702
+ Object.keys(classColors).forEach(color => {
703
+ const colorDot = document.createElement('div');
704
+ colorDot.className = `w-2 h-2 rounded-full bg-${color}-500`;
705
+ colorsContainer.appendChild(colorDot);
706
+ });
707
+
708
+ dayElement.appendChild(colorsContainer);
709
+ }
710
+
711
+ dayElement.innerHTML += `
712
+ <div class="text-right font-medium mb-1">${day}</div>
713
+ `;
714
+
715
+ // Add click event to show day view
716
+ dayElement.addEventListener('click', () => {
717
+ selectedDay = date;
718
+ currentView = 'day';
719
+ updateView();
720
+ renderDayAssignments(date);
721
+ });
722
+
723
+ calendarGrid.appendChild(dayElement);
724
+ }
725
+
726
+ function renderClasses() {
727
+ classesList.innerHTML = '';
728
+
729
+ if (classes.length === 0) {
730
+ classesList.innerHTML = `
731
+ <div class="text-center py-2 text-slate-400 text-sm">
732
+ <p>No classes yet</p>
733
+ </div>
734
+ `;
735
+ return;
736
+ }
737
+
738
+ classes.forEach(cls => {
739
+ const classItem = document.createElement('div');
740
+ classItem.className = 'flex items-center p-2 rounded-lg hover:bg-slate-700 cursor-pointer';
741
+
742
+ classItem.innerHTML = `
743
+ <div class="w-3 h-3 rounded-full bg-${cls.color}-500 mr-2"></div>
744
+ <div class="font-medium text-slate-200 truncate flex-1">${cls.name}</div>
745
+ <div class="text-xs text-slate-400">${getAssignmentCount(cls.id)}</div>
746
+ `;
747
+
748
+ classesList.appendChild(classItem);
749
+ });
750
+ }
751
+
752
+ function renderAssignments() {
753
+ const searchTerm = searchAssignments.value.toLowerCase();
754
+ let filteredAssignments = [...assignments];
755
+
756
+ // Apply search filter
757
+ if (searchTerm) {
758
+ filteredAssignments = filteredAssignments.filter(a =>
759
+ a.title.toLowerCase().includes(searchTerm) ||
760
+ (a.description && a.description.toLowerCase().includes(searchTerm))
761
+ );
762
+ }
763
+
764
+ // Apply status filter
765
+ if (currentFilter === 'upcoming') {
766
+ filteredAssignments = filteredAssignments.filter(a => !a.completed && !isDueSoon(a.dueDate));
767
+ } else if (currentFilter === 'urgent') {
768
+ filteredAssignments = filteredAssignments.filter(a => !a.completed && isDueSoon(a.dueDate));
769
+ } else if (currentFilter === 'completed') {
770
+ filteredAssignments = filteredAssignments.filter(a => a.completed);
771
+ }
772
+
773
+ // Sort by due date (soonest first) and then by creation date (newest first)
774
+ filteredAssignments.sort((a, b) => {
775
+ if (a.completed !== b.completed) {
776
+ return a.completed ? 1 : -1;
777
+ }
778
+
779
+ const dateA = new Date(a.dueDate);
780
+ const dateB = new Date(b.dueDate);
781
+
782
+ if (dateA < dateB) return -1;
783
+ if (dateA > dateB) return 1;
784
+
785
+ const createdA = new Date(a.createdAt);
786
+ const createdB = new Date(b.createdAt);
787
+ return createdB - createdA;
788
+ });
789
+
790
+ assignmentsContainer.innerHTML = '';
791
+
792
+ if (filteredAssignments.length === 0) {
793
+ noAssignments.classList.remove('hidden');
794
+ return;
795
+ }
796
+
797
+ noAssignments.classList.add('hidden');
798
+
799
+ filteredAssignments.forEach(assignment => {
800
+ const dueDate = new Date(assignment.dueDate);
801
+ const today = new Date();
802
+ const timeDiff = dueDate.getTime() - today.getTime();
803
+ const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
804
+
805
+ let statusClass = '';
806
+ let statusText = '';
807
+
808
+ if (assignment.completed) {
809
+ statusClass = 'completed';
810
+ statusText = 'Completed';
811
+ } else if (daysDiff <= 3) {
812
+ statusClass = 'urgent';
813
+ statusText = `Due in ${daysDiff} day${daysDiff !== 1 ? 's' : ''}`;
814
+ } else {
815
+ statusClass = 'upcoming';
816
+ statusText = `Due in ${daysDiff} day${daysDiff !== 1 ? 's' : ''}`;
817
+ }
818
+
819
+ const classInfo = classes.find(c => c.id === assignment.classId);
820
+ const classColor = classInfo ? classInfo.color : 'blue';
821
+
822
+ const assignmentCard = document.createElement('div');
823
+ assignmentCard.className = `assignment-card ${statusClass} bg-slate-700 p-4 rounded-lg shadow-sm border-l-${classColor}-500`;
824
+
825
+ assignmentCard.innerHTML = `
826
+ <div class="flex items-start justify-between">
827
+ <div class="flex items-start space-x-3">
828
+ <label class="checkbox-container relative block cursor-pointer">
829
+ <input type="checkbox" ${assignment.completed ? 'checked' : ''} class="absolute opacity-0 h-0 w-0">
830
+ <span class="checkmark absolute top-0 left-0 h-5 w-5 border border-slate-500 rounded"></span>
831
+ </label>
832
+ <div class="flex-1">
833
+ <div class="flex items-center">
834
+ <div class="w-3 h-3 rounded-full bg-${classColor}-500 mr-2"></div>
835
+ <h4 class="font-medium ${assignment.completed ? 'line-through text-slate-400' : 'text-slate-200'}">${assignment.title}</h4>
836
+ </div>
837
+ ${assignment.description ? `<p class="text-sm text-slate-400 mt-1">${assignment.description}</p>` : ''}
838
+ <div class="flex items-center mt-2 text-sm">
839
+ <i class="far fa-calendar-alt text-slate-500 mr-1"></i>
840
+ <span class="text-slate-400">${formatDate(assignment.dueDate)}</span>
841
+ <span class="ml-3 px-2 py-0.5 text-xs rounded-full ${statusClass === 'urgent' ? 'bg-red-900 text-red-300' : statusClass === 'completed' ? 'bg-green-900 text-green-300' : 'bg-blue-900 text-blue-300'}">${statusText}</span>
842
+ </div>
843
+ </div>
844
+ </div>
845
+ <button class="delete-assignment text-slate-500 hover:text-red-400">
846
+ <i class="far fa-trash-alt"></i>
847
+ </button>
848
+ </div>
849
+ `;
850
+
851
+ const checkbox = assignmentCard.querySelector('input[type="checkbox"]');
852
+ checkbox.addEventListener('change', () => toggleAssignmentCompletion(assignment.id));
853
+
854
+ const deleteBtn = assignmentCard.querySelector('.delete-assignment');
855
+ deleteBtn.addEventListener('click', (e) => {
856
+ e.stopPropagation();
857
+ deleteAssignment(assignment.id);
858
+ });
859
+
860
+ assignmentsContainer.appendChild(assignmentCard);
861
+ });
862
+ }
863
+
864
+ function renderDayAssignments(date) {
865
+ const day = date.getDate();
866
+ const month = date.getMonth();
867
+ const year = date.getFullYear();
868
+
869
+ dayViewDate.textContent = date.toLocaleDateString(undefined, { weekday: 'long', month: 'long', day: 'numeric' });
870
+
871
+ let dayAssignmentsList = assignments.filter(a => {
872
+ const dueDate = new Date(a.dueDate);
873
+ return dueDate.getDate() === day &&
874
+ dueDate.getMonth() === month &&
875
+ dueDate.getFullYear() === year;
876
+ });
877
+
878
+ // Apply search filter
879
+ const searchTerm = searchAssignments.value.toLowerCase();
880
+ if (searchTerm) {
881
+ dayAssignmentsList = dayAssignmentsList.filter(a =>
882
+ a.title.toLowerCase().includes(searchTerm) ||
883
+ (a.description && a.description.toLowerCase().includes(searchTerm))
884
+ );
885
+ }
886
+
887
+ // Apply status filter
888
+ if (currentFilter === 'upcoming') {
889
+ dayAssignmentsList = dayAssignmentsList.filter(a => !a.completed && !isDueSoon(a.dueDate));
890
+ } else if (currentFilter === 'urgent') {
891
+ dayAssignmentsList = dayAssignmentsList.filter(a => !a.completed && isDueSoon(a.dueDate));
892
+ } else if (currentFilter === 'completed') {
893
+ dayAssignmentsList = dayAssignmentsList.filter(a => a.completed);
894
+ }
895
+
896
+ // Sort by completion status and then by creation date
897
+ dayAssignmentsList.sort((a, b) => {
898
+ if (a.completed !== b.completed) {
899
+ return a.completed ? 1 : -1;
900
+ }
901
+
902
+ const createdA = new Date(a.createdAt);
903
+ const createdB = new Date(b.createdAt);
904
+ return createdA - createdB;
905
+ });
906
+
907
+ dayAssignments.innerHTML = '';
908
+
909
+ if (dayAssignmentsList.length === 0) {
910
+ noDayAssignments.classList.remove('hidden');
911
+ return;
912
+ }
913
+
914
+ noDayAssignments.classList.add('hidden');
915
+
916
+ dayAssignmentsList.forEach(assignment => {
917
+ const classInfo = classes.find(c => c.id === assignment.classId);
918
+ const classColor = classInfo ? classInfo.color : 'blue';
919
+ const className = classInfo ? classInfo.name : 'Unknown Class';
920
+
921
+ const assignmentCard = document.createElement('div');
922
+ assignmentCard.className = `assignment-card ${assignment.completed ? 'completed' : 'upcoming'} bg-slate-700 p-4 rounded-lg shadow-sm border-l-${classColor}-500 mb-3`;
923
+
924
+ assignmentCard.innerHTML = `
925
+ <div class="flex items-start justify-between">
926
+ <div class="flex items-start space-x-3">
927
+ <label class="checkbox-container relative block cursor-pointer">
928
+ <input type="checkbox" ${assignment.completed ? 'checked' : ''} class="absolute opacity-0 h-0 w-0">
929
+ <span class="checkmark absolute top-0 left-0 h-5 w-5 border border-slate-500 rounded"></span>
930
+ </label>
931
+ <div class="flex-1">
932
+ <div class="flex items-center">
933
+ <div class="w-3 h-3 rounded-full bg-${classColor}-500 mr-2"></div>
934
+ <h4 class="font-medium ${assignment.completed ? 'line-through text-slate-400' : 'text-slate-200'}">${assignment.title}</h4>
935
+ </div>
936
+ <div class="text-xs text-slate-400 mt-1">${className}</div>
937
+ ${assignment.description ? `<p class="text-sm text-slate-400 mt-2">${assignment.description}</p>` : ''}
938
+ <div class="flex items-center mt-3 text-sm">
939
+ <i class="far fa-clock text-slate-500 mr-1"></i>
940
+ <span class="text-slate-400">Due: ${formatTime(new Date(assignment.dueDate))}</span>
941
+ </div>
942
+ </div>
943
+ </div>
944
+ <button class="delete-assignment text-slate-500 hover:text-red-400">
945
+ <i class="far fa-trash-alt"></i>
946
+ </button>
947
+ </div>
948
+ `;
949
+
950
+ const checkbox = assignmentCard.querySelector('input[type="checkbox"]');
951
+ checkbox.addEventListener('change', () => toggleAssignmentCompletion(assignment.id));
952
+
953
+ const deleteBtn = assignmentCard.querySelector('.delete-assignment');
954
+ deleteBtn.addEventListener('click', (e) => {
955
+ e.stopPropagation();
956
+ deleteAssignment(assignment.id);
957
+ });
958
+
959
+ dayAssignments.appendChild(assignmentCard);
960
+ });
961
+ }
962
+
963
+ function populateClassDropdown() {
964
+ assignmentClassInput.innerHTML = '';
965
+
966
+ if (classes.length === 0) {
967
+ assignmentClassInput.innerHTML = '<option value="">No classes available</option>';
968
+ return;
969
+ }
970
+
971
+ classes.forEach(cls => {
972
+ const option = document.createElement('option');
973
+ option.value = cls.id;
974
+ option.textContent = cls.name;
975
+ assignmentClassInput.appendChild(option);
976
+ });
977
+ }
978
+
979
+ function updateView() {
980
+ if (currentView === 'calendar') {
981
+ calendarView.classList.remove('hidden');
982
+ listView.classList.add('hidden');
983
+ dayView.classList.add('hidden');
984
+ viewIcon.classList.remove('fa-calendar');
985
+ viewIcon.classList.add('fa-list');
986
+ } else if (currentView === 'list') {
987
+ calendarView.classList.add('hidden');
988
+ listView.classList.remove('hidden');
989
+ dayView.classList.add('hidden');
990
+ viewIcon.classList.remove('fa-list');
991
+ viewIcon.classList.add('fa-calendar');
992
+ renderAssignments();
993
+ } else if (currentView === 'day') {
994
+ calendarView.classList.add('hidden');
995
+ listView.classList.add('hidden');
996
+ dayView.classList.remove('hidden');
997
+ viewIcon.classList.remove('fa-list');
998
+ viewIcon.classList.add('fa-calendar');
999
+ }
1000
+ }
1001
+
1002
+ function updateFilterButtons() {
1003
+ filterAll.classList.remove('bg-blue-600', 'text-white');
1004
+ filterUpcoming.classList.remove('bg-blue-600', 'text-white');
1005
+ filterUrgent.classList.remove('bg-blue-600', 'text-white');
1006
+ filterCompleted.classList.remove('bg-blue-600', 'text-white');
1007
+
1008
+ filterAll.classList.add('bg-slate-700', 'text-slate-200');
1009
+ filterUpcoming.classList.add('bg-slate-700', 'text-slate-200');
1010
+ filterUrgent.classList.add('bg-slate-700', 'text-slate-200');
1011
+ filterCompleted.classList.add('bg-slate-700', 'text-slate-200');
1012
+
1013
+ if (currentFilter === 'all') {
1014
+ filterAll.classList.remove('bg-slate-700', 'text-slate-200');
1015
+ filterAll.classList.add('bg-blue-600', 'text-white');
1016
+ } else if (currentFilter === 'upcoming') {
1017
+ filterUpcoming.classList.remove('bg-slate-700', 'text-slate-200');
1018
+ filterUpcoming.classList.add('bg-blue-600', 'text-white');
1019
+ } else if (currentFilter === 'urgent') {
1020
+ filterUrgent.classList.remove('bg-slate-700', 'text-slate-200');
1021
+ filterUrgent.classList.add('bg-blue-600', 'text-white');
1022
+ } else if (currentFilter === 'completed') {
1023
+ filterCompleted.classList.remove('bg-slate-700', 'text-slate-200');
1024
+ filterCompleted.classList.add('bg-blue-600', 'text-white');
1025
+ }
1026
+ }
1027
+
1028
+ function getAssignmentCount(classId) {
1029
+ return assignments.filter(a => a.classId === classId).length;
1030
+ }
1031
+
1032
+ function isDueSoon(dueDate) {
1033
+ const date = new Date(dueDate);
1034
+ const today = new Date();
1035
+ const timeDiff = date.getTime() - today.getTime();
1036
+ const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
1037
+ return daysDiff <= 3;
1038
+ }
1039
+
1040
+ function formatDate(dateString) {
1041
+ const options = { year: 'numeric', month: 'short', day: 'numeric' };
1042
+ return new Date(dateString).toLocaleDateString(undefined, options);
1043
+ }
1044
+
1045
+ function formatTime(date) {
1046
+ return date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' });
1047
+ }
1048
+
1049
+ function getMonthName(monthIndex) {
1050
+ const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
1051
+ return months[monthIndex];
1052
+ }
1053
+
1054
+ function saveToLocalStorage() {
1055
+ localStorage.setItem('classes', JSON.stringify(classes));
1056
+ localStorage.setItem('assignments', JSON.stringify(assignments));
1057
+ }
1058
+
1059
+ function loadFromLocalStorage() {
1060
+ const savedClasses = localStorage.getItem('classes');
1061
+ const savedAssignments = localStorage.getItem('assignments');
1062
+
1063
+ if (savedClasses) {
1064
+ classes = JSON.parse(savedClasses);
1065
+ }
1066
+
1067
+ if (savedAssignments) {
1068
+ assignments = JSON.parse(savedAssignments);
1069
+ }
1070
+ }
1071
+ </script>
1072
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=tsbetterworkpmo/project" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1073
+ </html>
prompts.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ build a lightweight GPA calculator for high schoolers that you can add as many classes as you want
2
+ make it so that theres + and - letters. also make is beautiful
3
+ build a website that allows the user to play various mini games that you make
4
+ create a website that allows me to organize the work I have to do for each of my classes. Let me create classes and add assignments with titles, descriptions, and due dates, make it very sleek and convenient
5
+ create a website where there is a calendar that I can add class assignments to. Allow for me to set due dates and descriptions. Let me theme the assignments so I can tell what classes they are for. Also make it in dark mode so I can look at it easier. Make this actually functional btw