Amantro commited on
Commit
b65c4d1
·
verified ·
1 Parent(s): ed8ee5d

I need a web app for Notes

Browse files
Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +253 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Scribblesphere Your Digital Notepad
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: ScribbleSphere - Your Digital Notepad 🗒️
3
+ colorFrom: purple
4
+ colorTo: pink
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,254 @@
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>ScribbleSphere - Digital Notes</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
12
+ <style>
13
+ .note-card {
14
+ transition: all 0.3s ease;
15
+ }
16
+ .note-card:hover {
17
+ transform: translateY(-5px);
18
+ box-shadow: 0 10px 20px rgba(0,0,0,0.1);
19
+ }
20
+ #vanta-bg {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ z-index: -1;
27
+ opacity: 0.15;
28
+ }
29
+ </style>
30
+ </head>
31
+ <body class="bg-gray-50 min-h-screen">
32
+ <div id="vanta-bg"></div>
33
+
34
+ <header class="bg-indigo-600 text-white shadow-lg">
35
+ <div class="container mx-auto px-4 py-6">
36
+ <div class="flex justify-between items-center">
37
+ <div class="flex items-center space-x-2">
38
+ <i data-feather="edit-3" class="w-8 h-8"></i>
39
+ <h1 class="text-2xl font-bold">ScribbleSphere</h1>
40
+ </div>
41
+ <button id="new-note-btn" class="bg-white text-indigo-600 px-4 py-2 rounded-full font-medium flex items-center space-x-1 hover:bg-indigo-50 transition">
42
+ <i data-feather="plus" class="w-4 h-4"></i>
43
+ <span>New Note</span>
44
+ </button>
45
+ </div>
46
+ </div>
47
+ </header>
48
+
49
+ <main class="container mx-auto px-4 py-8">
50
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
51
+ <!-- Note cards will go here -->
52
+ <div class="note-card bg-white rounded-xl shadow-md p-6 flex flex-col">
53
+ <div class="flex justify-between items-start mb-4">
54
+ <h3 class="text-lg font-semibold text-gray-800">Welcome Note</h3>
55
+ <div class="flex space-x-2">
56
+ <button class="text-gray-500 hover:text-indigo-600">
57
+ <i data-feather="edit-2" class="w-4 h-4"></i>
58
+ </button>
59
+ <button class="text-gray-500 hover:text-red-600">
60
+ <i data-feather="trash-2" class="w-4 h-4"></i>
61
+ </button>
62
+ </div>
63
+ </div>
64
+ <p class="text-gray-600 mb-4 flex-grow">
65
+ Welcome to ScribbleSphere! Start creating your notes by clicking the "New Note" button above. Your notes are automatically saved as you type.
66
+ </p>
67
+ <div class="text-sm text-gray-400 mt-auto">
68
+ Created: Just now
69
+ </div>
70
+ </div>
71
+ </div>
72
+
73
+ <!-- Note Editor Modal (hidden by default) -->
74
+ <div id="note-editor" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
75
+ <div class="bg-white rounded-xl w-full max-w-2xl mx-4">
76
+ <div class="flex justify-between items-center border-b px-6 py-4">
77
+ <input type="text" id="note-title" placeholder="Note Title" class="text-xl font-semibold border-none focus:ring-0 w-full">
78
+ <button id="close-editor" class="text-gray-500 hover:text-gray-700">
79
+ <i data-feather="x" class="w-6 h-6"></i>
80
+ </button>
81
+ </div>
82
+ <div class="p-6">
83
+ <textarea id="note-content" class="w-full h-64 border-none focus:ring-0 resize-none" placeholder="Start typing your note here..."></textarea>
84
+ </div>
85
+ <div class="flex justify-end space-x-3 border-t px-6 py-3">
86
+ <button id="save-note" class="bg-indigo-600 text-white px-4 py-2 rounded-full font-medium hover:bg-indigo-700 transition">
87
+ Save Note
88
+ </button>
89
+ <button id="cancel-note" class="bg-gray-200 text-gray-700 px-4 py-2 rounded-full font-medium hover:bg-gray-300 transition">
90
+ Cancel
91
+ </button>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </main>
96
+
97
+ <footer class="bg-gray-100 border-t mt-12">
98
+ <div class="container mx-auto px-4 py-6 text-center text-gray-500">
99
+ <p>ScribbleSphere - Your thoughts, organized beautifully</p>
100
+ </div>
101
+ </footer>
102
+
103
+ <script>
104
+ // Initialize Vanta.js background
105
+ VANTA.NET({
106
+ el: "#vanta-bg",
107
+ mouseControls: true,
108
+ touchControls: true,
109
+ gyroControls: false,
110
+ minHeight: 200.00,
111
+ minWidth: 200.00,
112
+ scale: 1.00,
113
+ scaleMobile: 1.00,
114
+ color: 0x6366f1,
115
+ backgroundColor: 0xf8fafc,
116
+ points: 12.00,
117
+ maxDistance: 20.00,
118
+ spacing: 15.00
119
+ });
120
+
121
+ // Initialize Feather Icons
122
+ document.addEventListener('DOMContentLoaded', function() {
123
+ feather.replace();
124
+
125
+ // Note management functionality
126
+ const newNoteBtn = document.getElementById('new-note-btn');
127
+ const noteEditor = document.getElementById('note-editor');
128
+ const closeEditor = document.getElementById('close-editor');
129
+ const cancelNote = document.getElementById('cancel-note');
130
+ const saveNote = document.getElementById('save-note');
131
+ const noteTitle = document.getElementById('note-title');
132
+ const noteContent = document.getElementById('note-content');
133
+ const notesContainer = document.querySelector('.grid');
134
+
135
+ // Sample notes data (in a real app, this would come from a database)
136
+ let notes = [
137
+ {
138
+ id: Date.now(),
139
+ title: 'Welcome Note',
140
+ content: 'Welcome to ScribbleSphere! Start creating your notes by clicking the "New Note" button above. Your notes are automatically saved as you type.',
141
+ createdAt: 'Just now'
142
+ }
143
+ ];
144
+
145
+ // Open editor for new note
146
+ newNoteBtn.addEventListener('click', () => {
147
+ noteTitle.value = '';
148
+ noteContent.value = '';
149
+ noteEditor.classList.remove('hidden');
150
+ noteTitle.focus();
151
+ });
152
+
153
+ // Close editor
154
+ function closeEditorModal() {
155
+ noteEditor.classList.add('hidden');
156
+ }
157
+
158
+ closeEditor.addEventListener('click', closeEditorModal);
159
+ cancelNote.addEventListener('click', closeEditorModal);
160
+
161
+ // Save note
162
+ saveNote.addEventListener('click', () => {
163
+ if (noteTitle.value.trim() === '' || noteContent.value.trim() === '') {
164
+ alert('Please enter both a title and content for your note.');
165
+ return;
166
+ }
167
+
168
+ const newNote = {
169
+ id: Date.now(),
170
+ title: noteTitle.value,
171
+ content: noteContent.value,
172
+ createdAt: new Date().toLocaleDateString()
173
+ };
174
+
175
+ notes.unshift(newNote);
176
+ renderNotes();
177
+ closeEditorModal();
178
+ });
179
+
180
+ // Render all notes
181
+ function renderNotes() {
182
+ notesContainer.innerHTML = '';
183
+
184
+ notes.forEach(note => {
185
+ const noteElement = document.createElement('div');
186
+ noteElement.className = 'note-card bg-white rounded-xl shadow-md p-6 flex flex-col';
187
+ noteElement.innerHTML = `
188
+ <div class="flex justify-between items-start mb-4">
189
+ <h3 class="text-lg font-semibold text-gray-800">${note.title}</h3>
190
+ <div class="flex space-x-2">
191
+ <button class="text-gray-500 hover:text-indigo-600 edit-btn" data-id="${note.id}">
192
+ <i data-feather="edit-2" class="w-4 h-4"></i>
193
+ </button>
194
+ <button class="text-gray-500 hover:text-red-600 delete-btn" data-id="${note.id}">
195
+ <i data-feather="trash-2" class="w-4 h-4"></i>
196
+ </button>
197
+ </div>
198
+ </div>
199
+ <p class="text-gray-600 mb-4 flex-grow">${note.content}</p>
200
+ <div class="text-sm text-gray-400 mt-auto">
201
+ Created: ${note.createdAt}
202
+ </div>
203
+ `;
204
+
205
+ notesContainer.appendChild(noteElement);
206
+ });
207
+
208
+ // Add event listeners to edit and delete buttons
209
+ document.querySelectorAll('.edit-btn').forEach(btn => {
210
+ btn.addEventListener('click', (e) => {
211
+ const noteId = parseInt(e.currentTarget.getAttribute('data-id'));
212
+ const noteToEdit = notes.find(note => note.id === noteId);
213
+
214
+ if (noteToEdit) {
215
+ noteTitle.value = noteToEdit.title;
216
+ noteContent.value = noteToEdit.content;
217
+ noteEditor.classList.remove('hidden');
218
+
219
+ // Update save button to handle editing
220
+ saveNote.onclick = function() {
221
+ noteToEdit.title = noteTitle.value;
222
+ noteToEdit.content = noteContent.value;
223
+ renderNotes();
224
+ closeEditorModal();
225
+
226
+ // Reset save button to create new notes
227
+ saveNote.onclick = originalSaveHandler;
228
+ };
229
+ }
230
+ });
231
+ });
232
+
233
+ document.querySelectorAll('.delete-btn').forEach(btn => {
234
+ btn.addEventListener('click', (e) => {
235
+ if (confirm('Are you sure you want to delete this note?')) {
236
+ const noteId = parseInt(e.currentTarget.getAttribute('data-id'));
237
+ notes = notes.filter(note => note.id !== noteId);
238
+ renderNotes();
239
+ }
240
+ });
241
+ });
242
+
243
+ feather.replace();
244
+ }
245
+
246
+ // Store original save handler
247
+ const originalSaveHandler = saveNote.onclick;
248
+
249
+ // Initial render
250
+ renderNotes();
251
+ });
252
+ </script>
253
+ </body>
254
  </html>