mkami2828 commited on
Commit
e2e1885
·
verified ·
1 Parent(s): d43b42a

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +6 -4
  2. index.html +261 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Smart To Do Generator
3
- emoji: 🌍
4
  colorFrom: pink
5
- colorTo: purple
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: smart-to-do-generator
3
+ emoji: 🐳
4
  colorFrom: pink
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,261 @@
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>Smart To-Do Generator</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
+ .fade-in {
11
+ animation: fadeIn 0.5s ease-in-out;
12
+ }
13
+ @keyframes fadeIn {
14
+ from { opacity: 0; transform: translateY(10px); }
15
+ to { opacity: 1; transform: translateY(0); }
16
+ }
17
+ .todo-item:hover .delete-btn {
18
+ opacity: 1;
19
+ }
20
+ .checkmark {
21
+ transition: all 0.3s ease;
22
+ }
23
+ input:checked + .checkmark {
24
+ background-color: #4f46e5;
25
+ border-color: #4f46e5;
26
+ }
27
+ </style>
28
+ </head>
29
+ <body class="bg-gradient-to-br from-indigo-50 to-purple-50 min-h-screen">
30
+ <div class="container mx-auto px-4 py-12 max-w-3xl">
31
+ <div class="text-center mb-12">
32
+ <h1 class="text-4xl font-bold text-indigo-900 mb-3">Smart To-Do Generator</h1>
33
+ <p class="text-lg text-indigo-700">Describe what you need to do, and we'll break it down into actionable steps</p>
34
+ </div>
35
+
36
+ <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
37
+ <div class="flex items-center mb-4">
38
+ <div class="flex-1 relative">
39
+ <input
40
+ type="text"
41
+ id="todoInput"
42
+ placeholder="E.g., 'Plan a birthday party', 'Write a research paper', 'Organize my workspace'..."
43
+ class="w-full px-5 py-4 pr-12 rounded-lg border-2 border-indigo-100 focus:border-indigo-300 focus:outline-none transition-all"
44
+ >
45
+ <i class="fas fa-lightbulb absolute right-4 top-4 text-indigo-300"></i>
46
+ </div>
47
+ <button
48
+ id="generateBtn"
49
+ class="ml-4 px-6 py-4 bg-gradient-to-r from-indigo-500 to-purple-600 text-white rounded-lg font-semibold hover:from-indigo-600 hover:to-purple-700 transition-all flex items-center"
50
+ >
51
+ <i class="fas fa-magic mr-2"></i> Generate
52
+ </button>
53
+ </div>
54
+
55
+ <div class="text-sm text-gray-500 flex items-center">
56
+ <i class="fas fa-info-circle mr-2 text-indigo-400"></i>
57
+ Try something like "prepare for job interview" or "spring cleaning"
58
+ </div>
59
+ </div>
60
+
61
+ <div id="todoContainer" class="space-y-3">
62
+ <!-- To-do items will appear here -->
63
+ <div class="text-center py-10 text-gray-400" id="emptyState">
64
+ <i class="fas fa-tasks text-5xl mb-4"></i>
65
+ <p class="text-xl">Your generated to-dos will appear here</p>
66
+ </div>
67
+ </div>
68
+
69
+ <div class="mt-8 text-center text-gray-500 text-sm">
70
+ <p>AI-generated to-dos are suggestions. Feel free to edit or delete them.</p>
71
+ </div>
72
+ </div>
73
+
74
+ <script>
75
+ document.addEventListener('DOMContentLoaded', function() {
76
+ const generateBtn = document.getElementById('generateBtn');
77
+ const todoInput = document.getElementById('todoInput');
78
+ const todoContainer = document.getElementById('todoContainer');
79
+ const emptyState = document.getElementById('emptyState');
80
+
81
+ // Sample AI responses for different inputs
82
+ const aiResponses = {
83
+ 'plan a birthday party': [
84
+ 'Choose a theme for the party',
85
+ 'Create guest list and send invitations',
86
+ 'Order cake and decorations',
87
+ 'Plan party games and activities',
88
+ 'Prepare party favors',
89
+ 'Buy food and drinks'
90
+ ],
91
+ 'write a research paper': [
92
+ 'Choose research topic',
93
+ 'Conduct preliminary research',
94
+ 'Create outline and thesis statement',
95
+ 'Write first draft',
96
+ 'Edit and revise content',
97
+ 'Format citations and references',
98
+ 'Proofread final version'
99
+ ],
100
+ 'organize my workspace': [
101
+ 'Declutter desk surface',
102
+ 'Organize cables and wires',
103
+ 'Set up storage solutions',
104
+ 'Create filing system for documents',
105
+ 'Add personal touches (plants, photos)',
106
+ 'Establish daily cleaning routine'
107
+ ],
108
+ 'prepare for job interview': [
109
+ 'Research the company',
110
+ 'Review job description',
111
+ 'Prepare answers to common questions',
112
+ 'Plan professional outfit',
113
+ 'Print copies of resume',
114
+ 'Prepare questions to ask interviewer',
115
+ 'Practice with mock interview'
116
+ ],
117
+ 'spring cleaning': [
118
+ 'Declutter room by room',
119
+ 'Dust all surfaces and furniture',
120
+ 'Wash windows and mirrors',
121
+ 'Deep clean carpets or floors',
122
+ 'Organize closets and drawers',
123
+ 'Donate unused items',
124
+ 'Clean appliances inside and out'
125
+ ]
126
+ };
127
+
128
+ generateBtn.addEventListener('click', function() {
129
+ const userInput = todoInput.value.trim().toLowerCase();
130
+
131
+ if (!userInput) {
132
+ showError('Please describe what you need to do');
133
+ return;
134
+ }
135
+
136
+ // Show loading state
137
+ generateBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Generating...';
138
+ generateBtn.disabled = true;
139
+
140
+ // Simulate AI processing delay
141
+ setTimeout(() => {
142
+ generateTodos(userInput);
143
+ generateBtn.innerHTML = '<i class="fas fa-magic mr-2"></i> Generate';
144
+ generateBtn.disabled = false;
145
+ }, 800);
146
+ });
147
+
148
+ function generateTodos(input) {
149
+ // Hide empty state
150
+ emptyState.style.display = 'none';
151
+
152
+ // Clear previous todos
153
+ todoContainer.innerHTML = '';
154
+
155
+ // Find matching AI response or generate generic one
156
+ let todos = [];
157
+
158
+ for (const [key, value] of Object.entries(aiResponses)) {
159
+ if (input.includes(key)) {
160
+ todos = value;
161
+ break;
162
+ }
163
+ }
164
+
165
+ // If no specific match, create generic todos
166
+ if (todos.length === 0) {
167
+ todos = [
168
+ `Research about ${input}`,
169
+ `Create plan for ${input}`,
170
+ `Gather materials needed for ${input}`,
171
+ `Execute first step of ${input}`,
172
+ `Review progress on ${input}`,
173
+ `Complete ${input} and evaluate results`
174
+ ];
175
+ }
176
+
177
+ // Add heading
178
+ const heading = document.createElement('h3');
179
+ heading.className = 'text-xl font-semibold text-indigo-800 mb-4 mt-2';
180
+ heading.textContent = `Your ${input.charAt(0).toUpperCase() + input.slice(1)} To-Dos`;
181
+ todoContainer.appendChild(heading);
182
+
183
+ // Add todos
184
+ todos.forEach((todo, index) => {
185
+ const todoItem = document.createElement('div');
186
+ todoItem.className = 'todo-item bg-white rounded-lg shadow-sm p-4 flex items-center border border-gray-100 fade-in';
187
+ todoItem.style.animationDelay = `${index * 0.1}s`;
188
+
189
+ todoItem.innerHTML = `
190
+ <label class="flex items-center cursor-pointer w-full">
191
+ <input type="checkbox" class="opacity-0 absolute h-6 w-6">
192
+ <span class="checkmark h-6 w-6 border-2 border-gray-300 rounded-md flex-shrink-0 mr-3 flex items-center justify-center">
193
+ <svg class="w-4 h-4 text-white pointer-events-none hidden" viewBox="0 0 24 24" fill="none">
194
+ <path d="M5 13l4 4L19 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
195
+ </svg>
196
+ </span>
197
+ <span class="text-gray-800 flex-1">${todo}</span>
198
+ <button class="delete-btn opacity-0 text-gray-400 hover:text-red-500 transition-all ml-2">
199
+ <i class="fas fa-trash-alt"></i>
200
+ </button>
201
+ </label>
202
+ `;
203
+
204
+ todoContainer.appendChild(todoItem);
205
+ });
206
+
207
+ // Add event listeners for checkboxes and delete buttons
208
+ document.querySelectorAll('.todo-item input[type="checkbox"]').forEach(checkbox => {
209
+ checkbox.addEventListener('change', function() {
210
+ const checkmark = this.nextElementSibling;
211
+ const text = checkmark.nextElementSibling;
212
+
213
+ if (this.checked) {
214
+ checkmark.querySelector('svg').classList.remove('hidden');
215
+ text.classList.add('line-through', 'text-gray-400');
216
+ } else {
217
+ checkmark.querySelector('svg').classList.add('hidden');
218
+ text.classList.remove('line-through', 'text-gray-400');
219
+ }
220
+ });
221
+ });
222
+
223
+ document.querySelectorAll('.delete-btn').forEach(btn => {
224
+ btn.addEventListener('click', function(e) {
225
+ e.stopPropagation();
226
+ this.closest('.todo-item').classList.add('opacity-0', 'translate-x-10');
227
+ setTimeout(() => {
228
+ this.closest('.todo-item').remove();
229
+ if (todoContainer.children.length === 1) { // Only heading left
230
+ emptyState.style.display = 'block';
231
+ }
232
+ }, 300);
233
+ });
234
+ });
235
+ }
236
+
237
+ function showError(message) {
238
+ const errorDiv = document.createElement('div');
239
+ errorDiv.className = 'bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4 rounded fade-in';
240
+ errorDiv.innerHTML = `<i class="fas fa-exclamation-circle mr-2"></i> ${message}`;
241
+
242
+ // Insert after input
243
+ todoInput.parentNode.parentNode.insertBefore(errorDiv, todoInput.parentNode.nextSibling);
244
+
245
+ // Remove after 3 seconds
246
+ setTimeout(() => {
247
+ errorDiv.classList.add('opacity-0', 'translate-y-[-10px]');
248
+ setTimeout(() => errorDiv.remove(), 300);
249
+ }, 3000);
250
+ }
251
+
252
+ // Allow pressing Enter to generate
253
+ todoInput.addEventListener('keypress', function(e) {
254
+ if (e.key === 'Enter') {
255
+ generateBtn.click();
256
+ }
257
+ });
258
+ });
259
+ </script>
260
+ <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=mkami2828/smart-to-do-generator" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
261
+ </html>
prompts.txt ADDED
File without changes