Spaces:
Running

krish95 commited on
Commit
81eb9ea
·
verified ·
1 Parent(s): f9dde6e

Design a modern, stylish, and user-friendly To-Do List web app that uses a light, soft color palette and gives a cool, calm, and intelligent experience. The app should include meaningful advanced features (not gamified XP/streaks), and every interactive element should work. 🧠 ✍️ Core Features (Fully Functional) Task Input Text input field with a soft-bordered “Add Task” button. Optional description and due time (shown on click or hover). When submitted, task appears in the task list. Task Completion Each task has a checkbox or circle button to mark as complete. When ticked: A smooth strike-through animation is triggered. The card dims slightly and shows a ✅ icon. Task stays visible for the rest of the day. Auto Task Management Completed tasks are automatically removed at midnight. Unfinished tasks stay on the list until completed or manually removed. Manual Task Controls Each task has a Delete (🗑) button. Bottom “Clear Completed Tasks” button removes all completed items manually. Download App Button (PWA) A subtle “📥 Download App” button in the top-right corner. Clicking it triggers the PWA install prompt. Tooltip: “Install this app for quick access anytime.” 💎 Extra Features (Useful, Non-Clutter) Task Labels / Tags Allow optional tags like: Work, Personal, Urgent. Tags shown as soft-colored chips beside the task. Light Filtering Allow minimal filters: All, Pending, Completed, Work, Personal. Use horizontal tab-style buttons (not dropdowns) with pastel-colored borders. Reminders (Optional) User can optionally set a reminder time. When due, a subtle pop-up or bell icon alert appears (no audio). Elegant Progress Bar Show a thin, modern progress line at the top: “4 out of 7 tasks completed today” Smooth fill animation, soft color (mint or lavender), minimalistic text. Calendar Peek (Optional) Small icon to open a light modal showing the current week. Shows dots on days with pending tasks. 🎨 UI Design / Color Palette Background: #FAFAFA (soft off-white) Cards: #FFFFFF with #EAEAEA borders and soft shadows Text: #1E1E1E main, #666666 subtext Accent Colors: Sky Pastel Blue: #D4E4ED Mint Green: #CFE3DC Blush Pink: #F4E1E6 Lavender: #E3DFF0 Font: Inter or Satoshi or Poppins, smooth, readable 🧼 UI Styling Rounded cards and buttons (rounded-2xl) Soft shadows (not harsh) Hover transitions: light elevation or color tint Smooth animations for checking, deleting, and adding tasks. and the data should store in user's local storage - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +450 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Silktasks
3
- emoji: 🦀
4
- colorFrom: yellow
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: silktasks
3
+ emoji: 🐳
4
+ colorFrom: purple
5
  colorTo: gray
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,450 @@
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>Serene Tasks | Modern To-Do List</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
9
+ <style>
10
+ @keyframes strike {
11
+ 0% { width: 0; }
12
+ 100% { width: 100%; }
13
+ }
14
+ .strike-animation::after {
15
+ content: "";
16
+ position: absolute;
17
+ top: 50%;
18
+ left: 0;
19
+ width: 0;
20
+ height: 1px;
21
+ background: #666;
22
+ animation: strike 0.3s ease-out forwards;
23
+ }
24
+ .fade-in {
25
+ animation: fadeIn 0.3s ease-in;
26
+ }
27
+ @keyframes fadeIn {
28
+ from { opacity: 0; transform: translateY(10px); }
29
+ to { opacity: 1; transform: translateY(0); }
30
+ }
31
+ .progress-bar {
32
+ transition: width 0.6s ease;
33
+ }
34
+ .calendar-day {
35
+ width: 30px;
36
+ height: 30px;
37
+ }
38
+ .calendar-day.has-tasks::after {
39
+ content: "";
40
+ position: absolute;
41
+ bottom: 2px;
42
+ left: 50%;
43
+ transform: translateX(-50%);
44
+ width: 4px;
45
+ height: 4px;
46
+ border-radius: 50%;
47
+ background: #8B5CF6;
48
+ }
49
+ </style>
50
+ </head>
51
+ <body class="bg-[#FAFAFA] min-h-screen font-['Poppins'] text-[#1E1E1E]">
52
+ <div class="container mx-auto px-4 py-8 max-w-3xl">
53
+ <!-- Header -->
54
+ <header class="flex justify-between items-center mb-8">
55
+ <h1 class="text-3xl font-semibold text-[#1E1E1E]">Serene Tasks</h1>
56
+ <button id="installBtn" class="hidden bg-[#E3DFF0] hover:bg-[#D4D0E8] text-[#5E4B9E] px-4 py-2 rounded-2xl text-sm transition-colors duration-200 flex items-center">
57
+ <span class="mr-2">📥</span> Install App
58
+ </button>
59
+ </header>
60
+
61
+ <!-- Progress Bar -->
62
+ <div class="mb-6">
63
+ <div class="flex justify-between text-sm text-[#666] mb-1">
64
+ <span id="progressText">0 tasks completed</span>
65
+ <span id="totalTasks">0 tasks</span>
66
+ </div>
67
+ <div class="w-full bg-gray-200 rounded-full h-1.5">
68
+ <div id="progressBar" class="progress-bar h-1.5 rounded-full bg-[#8B5CF6]" style="width: 0%"></div>
69
+ </div>
70
+ </div>
71
+
72
+ <!-- Task Input -->
73
+ <div class="bg-white rounded-2xl shadow-sm p-4 mb-6 border border-[#EAEAEA]">
74
+ <div class="flex mb-2">
75
+ <input id="taskInput" type="text" placeholder="What needs to be done?" class="flex-grow px-4 py-2 border border-[#EAEAEA] rounded-2xl focus:outline-none focus:ring-1 focus:ring-[#D4E4ED]">
76
+ <button id="addTaskBtn" class="ml-2 bg-[#D4E4ED] hover:bg-[#C5D9E6] text-[#1E1E1E] px-4 py-2 rounded-2xl transition-colors duration-200">Add</button>
77
+ </div>
78
+ <div id="extraFields" class="hidden mt-3">
79
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
80
+ <input id="taskDesc" type="text" placeholder="Description (optional)" class="px-4 py-2 border border-[#EAEAEA] rounded-2xl focus:outline-none focus:ring-1 focus:ring-[#D4E4ED]">
81
+ <input id="taskDue" type="datetime-local" class="px-4 py-2 border border-[#EAEAEA] rounded-2xl focus:outline-none focus:ring-1 focus:ring-[#D4E4ED]">
82
+ </div>
83
+ <div class="mt-3 flex flex-wrap gap-2">
84
+ <span class="text-sm text-[#666] mr-2">Tags:</span>
85
+ <button data-tag="work" class="tag-btn px-3 py-1 text-xs rounded-full bg-[#D4E4ED] border border-[#D4E4ED] hover:border-[#A3C4D9]">Work</button>
86
+ <button data-tag="personal" class="tag-btn px-3 py-1 text-xs rounded-full bg-[#F4E1E6] border border-[#F4E1E6] hover:border-[#E8C6CD]">Personal</button>
87
+ <button data-tag="urgent" class="tag-btn px-3 py-1 text-xs rounded-full bg-[#CFE3DC] border border-[#CFE3DC] hover:border-[#B2D3C9]">Urgent</button>
88
+ </div>
89
+ </div>
90
+ <button id="toggleExtraBtn" class="mt-2 text-sm text-[#666] hover:text-[#1E1E1E] transition-colors duration-200">+ More options</button>
91
+ </div>
92
+
93
+ <!-- Filters -->
94
+ <div class="flex overflow-x-auto pb-2 mb-4 scrollbar-hide">
95
+ <button data-filter="all" class="filter-btn active-filter px-4 py-2 mr-2 text-sm rounded-2xl border border-[#EAEAEA] bg-white">All</button>
96
+ <button data-filter="pending" class="filter-btn px-4 py-2 mr-2 text-sm rounded-2xl border border-[#EAEAEA] bg-white">Pending</button>
97
+ <button data-filter="completed" class="filter-btn px-4 py-2 mr-2 text-sm rounded-2xl border border-[#EAEAEA] bg-white">Completed</button>
98
+ <button data-filter="work" class="filter-btn px-4 py-2 mr-2 text-sm rounded-2xl border border-[#D4E4ED] bg-white">Work</button>
99
+ <button data-filter="personal" class="filter-btn px-4 py-2 mr-2 text-sm rounded-2xl border border-[#F4E1E6] bg-white">Personal</button>
100
+ <button data-filter="urgent" class="filter-btn px-4 py-2 text-sm rounded-2xl border border-[#CFE3DC] bg-white">Urgent</button>
101
+ </div>
102
+
103
+ <!-- Task List -->
104
+ <div id="taskList" class="space-y-3 mb-6">
105
+ <!-- Tasks will be added here dynamically -->
106
+ </div>
107
+
108
+ <!-- Calendar Button -->
109
+ <div class="flex justify-center mb-6">
110
+ <button id="calendarBtn" class="flex items-center text-[#666] hover:text-[#1E1E1E] transition-colors duration-200">
111
+ <span class="mr-2">📅</span> View Week
112
+ </button>
113
+ </div>
114
+
115
+ <!-- Clear Completed -->
116
+ <div class="flex justify-center">
117
+ <button id="clearCompletedBtn" class="px-4 py-2 text-sm rounded-2xl border border-[#EAEAEA] bg-white hover:bg-[#FAFAFA] transition-colors duration-200">Clear Completed Tasks</button>
118
+ </div>
119
+
120
+ <!-- Calendar Modal -->
121
+ <div id="calendarModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
122
+ <div class="bg-white rounded-2xl p-6 w-full max-w-sm">
123
+ <div class="flex justify-between items-center mb-4">
124
+ <h3 class="text-lg font-medium">This Week</h3>
125
+ <button id="closeCalendarBtn" class="text-[#666] hover:text-[#1E1E1E]">✕</button>
126
+ </div>
127
+ <div id="calendarWeek" class="grid grid-cols-7 gap-1 text-center">
128
+ <!-- Calendar days will be added here dynamically -->
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+
134
+ <script>
135
+ // DOM Elements
136
+ const taskInput = document.getElementById('taskInput');
137
+ const addTaskBtn = document.getElementById('addTaskBtn');
138
+ const taskList = document.getElementById('taskList');
139
+ const clearCompletedBtn = document.getElementById('clearCompletedBtn');
140
+ const toggleExtraBtn = document.getElementById('toggleExtraBtn');
141
+ const extraFields = document.getElementById('extraFields');
142
+ const taskDesc = document.getElementById('taskDesc');
143
+ const taskDue = document.getElementById('taskDue');
144
+ const filterBtns = document.querySelectorAll('.filter-btn');
145
+ const tagBtns = document.querySelectorAll('.tag-btn');
146
+ const progressBar = document.getElementById('progressBar');
147
+ const progressText = document.getElementById('progressText');
148
+ const totalTasks = document.getElementById('totalTasks');
149
+ const calendarBtn = document.getElementById('calendarBtn');
150
+ const calendarModal = document.getElementById('calendarModal');
151
+ const closeCalendarBtn = document.getElementById('closeCalendarBtn');
152
+ const calendarWeek = document.getElementById('calendarWeek');
153
+ const installBtn = document.getElementById('installBtn');
154
+
155
+ // State
156
+ let tasks = JSON.parse(localStorage.getItem('tasks')) || [];
157
+ let currentFilter = 'all';
158
+ let selectedTag = null;
159
+ let deferredPrompt;
160
+
161
+ // Initialize
162
+ document.addEventListener('DOMContentLoaded', () => {
163
+ renderTasks();
164
+ updateProgress();
165
+ setupCalendar();
166
+ checkMidnight();
167
+
168
+ // Set up PWA installation prompt
169
+ window.addEventListener('beforeinstallprompt', (e) => {
170
+ e.preventDefault();
171
+ deferredPrompt = e;
172
+ installBtn.classList.remove('hidden');
173
+ });
174
+ });
175
+
176
+ // Event Listeners
177
+ addTaskBtn.addEventListener('click', addTask);
178
+ taskInput.addEventListener('keypress', (e) => {
179
+ if (e.key === 'Enter') addTask();
180
+ });
181
+ clearCompletedBtn.addEventListener('click', clearCompletedTasks);
182
+ toggleExtraBtn.addEventListener('click', toggleExtraFields);
183
+ filterBtns.forEach(btn => btn.addEventListener('click', applyFilter));
184
+ tagBtns.forEach(btn => btn.addEventListener('click', selectTag));
185
+ calendarBtn.addEventListener('click', () => calendarModal.classList.remove('hidden'));
186
+ closeCalendarBtn.addEventListener('click', () => calendarModal.classList.add('hidden'));
187
+ installBtn.addEventListener('click', installPWA);
188
+
189
+ // Functions
190
+ function addTask() {
191
+ const title = taskInput.value.trim();
192
+ if (!title) return;
193
+
194
+ const description = taskDesc.value.trim();
195
+ const dueDate = taskDue.value;
196
+ const tag = selectedTag;
197
+
198
+ const newTask = {
199
+ id: Date.now(),
200
+ title,
201
+ description,
202
+ dueDate,
203
+ tag,
204
+ completed: false,
205
+ createdAt: new Date().toISOString()
206
+ };
207
+
208
+ tasks.push(newTask);
209
+ saveTasks();
210
+ renderTasks();
211
+ updateProgress();
212
+
213
+ // Reset form
214
+ taskInput.value = '';
215
+ taskDesc.value = '';
216
+ taskDue.value = '';
217
+ selectedTag = null;
218
+ tagBtns.forEach(btn => btn.classList.remove('border-[#1E1E1E]'));
219
+ extraFields.classList.add('hidden');
220
+ toggleExtraBtn.textContent = '+ More options';
221
+ }
222
+
223
+ function renderTasks() {
224
+ taskList.innerHTML = '';
225
+
226
+ let filteredTasks = [...tasks];
227
+
228
+ // Apply filter
229
+ if (currentFilter === 'pending') {
230
+ filteredTasks = filteredTasks.filter(task => !task.completed);
231
+ } else if (currentFilter === 'completed') {
232
+ filteredTasks = filteredTasks.filter(task => task.completed);
233
+ } else if (['work', 'personal', 'urgent'].includes(currentFilter)) {
234
+ filteredTasks = filteredTasks.filter(task => task.tag === currentFilter);
235
+ }
236
+
237
+ if (filteredTasks.length === 0) {
238
+ taskList.innerHTML = '<p class="text-center text-[#666] py-4">No tasks found</p>';
239
+ return;
240
+ }
241
+
242
+ filteredTasks.forEach(task => {
243
+ const taskElement = document.createElement('div');
244
+ taskElement.className = `bg-white rounded-2xl shadow-sm p-4 border border-[#EAEAEA] fade-in ${task.completed ? 'opacity-80' : ''}`;
245
+ taskElement.dataset.id = task.id;
246
+
247
+ // Tag color mapping
248
+ const tagColors = {
249
+ work: ['bg-[#D4E4ED]', 'text-[#1E1E1E]'],
250
+ personal: ['bg-[#F4E1E6]', 'text-[#1E1E1E]'],
251
+ urgent: ['bg-[#CFE3DC]', 'text-[#1E1E1E]']
252
+ };
253
+
254
+ const tagClass = task.tag ? tagColors[task.tag][0] : 'hidden';
255
+ const tagTextClass = task.tag ? tagColors[task.tag][1] : 'hidden';
256
+
257
+ taskElement.innerHTML = `
258
+ <div class="flex items-start">
259
+ <button class="complete-btn mr-3 mt-1 flex-shrink-0 w-5 h-5 rounded-full border border-[#EAEAEA] flex items-center justify-center ${task.completed ? 'bg-[#8B5CF6] border-[#8B5CF6]' : ''}">
260
+ ${task.completed ? '✓' : ''}
261
+ </button>
262
+ <div class="flex-grow">
263
+ <div class="flex items-center">
264
+ <h3 class="${task.completed ? 'strike-animation relative' : ''}">${task.title}</h3>
265
+ ${task.tag ? `<span class="text-xs px-2 py-1 rounded-full ml-2 ${tagClass} ${tagTextClass}">${task.tag.charAt(0).toUpperCase() + task.tag.slice(1)}</span>` : ''}
266
+ </div>
267
+ ${task.description ? `<p class="text-sm text-[#666] mt-1">${task.description}</p>` : ''}
268
+ ${task.dueDate ? `<p class="text-xs text-[#666] mt-1">⏰ ${formatDueDate(task.dueDate)}</p>` : ''}
269
+ </div>
270
+ <button class="delete-btn ml-2 text-[#666] hover:text-[#1E1E1E] transition-colors duration-200">🗑</button>
271
+ </div>
272
+ `;
273
+
274
+ taskList.appendChild(taskElement);
275
+ });
276
+
277
+ // Add event listeners to new elements
278
+ document.querySelectorAll('.complete-btn').forEach(btn => {
279
+ btn.addEventListener('click', toggleTaskComplete);
280
+ });
281
+
282
+ document.querySelectorAll('.delete-btn').forEach(btn => {
283
+ btn.addEventListener('click', deleteTask);
284
+ });
285
+ }
286
+
287
+ function toggleTaskComplete(e) {
288
+ const taskId = parseInt(e.target.closest('[data-id]').dataset.id);
289
+ const taskIndex = tasks.findIndex(task => task.id === taskId);
290
+
291
+ if (taskIndex !== -1) {
292
+ tasks[taskIndex].completed = !tasks[taskIndex].completed;
293
+ saveTasks();
294
+ renderTasks();
295
+ updateProgress();
296
+ }
297
+ }
298
+
299
+ function deleteTask(e) {
300
+ const taskId = parseInt(e.target.closest('[data-id]').dataset.id);
301
+ tasks = tasks.filter(task => task.id !== taskId);
302
+ saveTasks();
303
+ renderTasks();
304
+ updateProgress();
305
+ }
306
+
307
+ function clearCompletedTasks() {
308
+ tasks = tasks.filter(task => !task.completed);
309
+ saveTasks();
310
+ renderTasks();
311
+ updateProgress();
312
+ }
313
+
314
+ function saveTasks() {
315
+ localStorage.setItem('tasks', JSON.stringify(tasks));
316
+ }
317
+
318
+ function toggleExtraFields() {
319
+ if (extraFields.classList.contains('hidden')) {
320
+ extraFields.classList.remove('hidden');
321
+ toggleExtraBtn.textContent = '- Fewer options';
322
+ } else {
323
+ extraFields.classList.add('hidden');
324
+ toggleExtraBtn.textContent = '+ More options';
325
+ }
326
+ }
327
+
328
+ function applyFilter(e) {
329
+ currentFilter = e.target.dataset.filter;
330
+
331
+ // Update active filter button
332
+ filterBtns.forEach(btn => {
333
+ btn.classList.remove('active-filter', 'border-[#8B5CF6]', 'text-[#8B5CF6]');
334
+ });
335
+ e.target.classList.add('active-filter');
336
+
337
+ // Add color to the active filter
338
+ if (currentFilter === 'work') {
339
+ e.target.classList.add('border-[#D4E4ED]', 'text-[#5E7A8C]');
340
+ } else if (currentFilter === 'personal') {
341
+ e.target.classList.add('border-[#F4E1E6]', 'text-[#9E6D7B]');
342
+ } else if (currentFilter === 'urgent') {
343
+ e.target.classList.add('border-[#CFE3DC]', 'text-[#5E8C7D]');
344
+ } else {
345
+ e.target.classList.add('border-[#8B5CF6]', 'text-[#8B5CF6]');
346
+ }
347
+
348
+ renderTasks();
349
+ }
350
+
351
+ function selectTag(e) {
352
+ selectedTag = e.target.dataset.tag;
353
+ tagBtns.forEach(btn => btn.classList.remove('border-[#1E1E1E]'));
354
+ e.target.classList.add('border-[#1E1E1E]');
355
+ }
356
+
357
+ function updateProgress() {
358
+ const total = tasks.length;
359
+ const completed = tasks.filter(task => task.completed).length;
360
+ const percentage = total > 0 ? Math.round((completed / total) * 100) : 0;
361
+
362
+ progressBar.style.width = `${percentage}%`;
363
+ progressText.textContent = `${completed} ${completed === 1 ? 'task' : 'tasks'} completed`;
364
+ totalTasks.textContent = `${total} ${total === 1 ? 'task' : 'tasks'}`;
365
+ }
366
+
367
+ function formatDueDate(dateString) {
368
+ const date = new Date(dateString);
369
+ return date.toLocaleString([], {
370
+ month: 'short',
371
+ day: 'numeric',
372
+ hour: '2-digit',
373
+ minute: '2-digit'
374
+ });
375
+ }
376
+
377
+ function setupCalendar() {
378
+ calendarWeek.innerHTML = '';
379
+ const today = new Date();
380
+ const currentDay = today.getDay(); // 0 (Sunday) to 6 (Saturday)
381
+
382
+ // Start from Sunday
383
+ const startDate = new Date(today);
384
+ startDate.setDate(today.getDate() - currentDay);
385
+
386
+ for (let i = 0; i < 7; i++) {
387
+ const dayDate = new Date(startDate);
388
+ dayDate.setDate(startDate.getDate() + i);
389
+
390
+ const dayElement = document.createElement('div');
391
+ dayElement.className = 'calendar-day relative flex flex-col items-center';
392
+
393
+ const dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][i];
394
+ const dayNum = dayDate.getDate();
395
+
396
+ // Check if there are tasks for this day
397
+ const hasTasks = tasks.some(task => {
398
+ if (task.completed) return false;
399
+ const taskDate = new Date(task.dueDate || task.createdAt);
400
+ return taskDate.toDateString() === dayDate.toDateString();
401
+ });
402
+
403
+ dayElement.innerHTML = `
404
+ <span class="text-xs text-[#666]">${dayName}</span>
405
+ <span class="${dayDate.toDateString() === today.toDateString() ? 'bg-[#8B5CF6] text-white rounded-full w-6 h-6 flex items-center justify-center' : ''}">${dayNum}</span>
406
+ `;
407
+
408
+ if (hasTasks) {
409
+ dayElement.classList.add('has-tasks');
410
+ }
411
+
412
+ calendarWeek.appendChild(dayElement);
413
+ }
414
+ }
415
+
416
+ function checkMidnight() {
417
+ const now = new Date();
418
+ const midnight = new Date();
419
+ midnight.setHours(24, 0, 0, 0);
420
+
421
+ const timeUntilMidnight = midnight - now;
422
+
423
+ setTimeout(() => {
424
+ // Remove completed tasks
425
+ tasks = tasks.filter(task => !task.completed);
426
+ saveTasks();
427
+ renderTasks();
428
+ updateProgress();
429
+
430
+ // Check again in 24 hours
431
+ checkMidnight();
432
+ }, timeUntilMidnight);
433
+ }
434
+
435
+ function installPWA() {
436
+ if (deferredPrompt) {
437
+ deferredPrompt.prompt();
438
+ deferredPrompt.userChoice.then((choiceResult) => {
439
+ if (choiceResult.outcome === 'accepted') {
440
+ console.log('User accepted the install prompt');
441
+ } else {
442
+ console.log('User dismissed the install prompt');
443
+ }
444
+ deferredPrompt = null;
445
+ });
446
+ }
447
+ }
448
+ </script>
449
+ <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=krish95/silktasks" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
450
+ </html>