Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +469 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 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: notes-taker
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: yellow
|
| 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,469 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Notes - Quantals Collect</title>
|
| 7 |
+
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
| 8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/core@2.0.0-beta.209"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/starter-kit@2.0.0-beta.209"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/extension-link@2.0.0-beta.209"></script>
|
| 12 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/extension-image@2.0.0-beta.209"></script>
|
| 13 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/extension-placeholder@2.0.0-beta.209"></script>
|
| 14 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/extension-task-list@2.0.0-beta.209"></script>
|
| 15 |
+
<script src="https://cdn.jsdelivr.net/npm/@tiptap/extension-task-item@2.0.0-beta.209"></script>
|
| 16 |
+
<script src="https://cdn.jsdelivr.net/npm/lunr@2.3.9/lunr.min.js"></script>
|
| 17 |
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js"></script>
|
| 18 |
+
<link href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css" rel="stylesheet">
|
| 19 |
+
</head>
|
| 20 |
+
<body class="bg-gray-50 dark:bg-gray-900">
|
| 21 |
+
<!-- Main Navigation -->
|
| 22 |
+
<nav class="bg-white dark:bg-gray-800 shadow-sm">
|
| 23 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 24 |
+
<div class="flex justify-between h-16">
|
| 25 |
+
<div class="flex">
|
| 26 |
+
<div class="flex-shrink-0 flex items-center">
|
| 27 |
+
<img class="h-8 w-auto" src="assets/logo.svg" alt="Quantals Collect">
|
| 28 |
+
</div>
|
| 29 |
+
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
|
| 30 |
+
<a href="Dashboard.html" class="border-transparent text-gray-500 dark:text-gray-300 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
|
| 31 |
+
Dashboard
|
| 32 |
+
</a>
|
| 33 |
+
<a href="Projects.html" class="border-transparent text-gray-500 dark:text-gray-300 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
|
| 34 |
+
Projects
|
| 35 |
+
</a>
|
| 36 |
+
<a href="Participants.html" class="border-transparent text-gray-500 dark:text-gray-300 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
|
| 37 |
+
Participants
|
| 38 |
+
</a>
|
| 39 |
+
<a href="Analysis.html" class="border-transparent text-gray-500 dark:text-gray-300 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
|
| 40 |
+
Analysis
|
| 41 |
+
</a>
|
| 42 |
+
<a href="Notes.html" class="border-indigo-500 text-indigo-600 dark:text-indigo-400 border-b-2 inline-flex items-center px-1 pt-1 text-sm font-medium">
|
| 43 |
+
<i class="fas fa-sticky-note mr-2"></i>
|
| 44 |
+
Notes
|
| 45 |
+
</a>
|
| 46 |
+
</div>
|
| 47 |
+
</div>
|
| 48 |
+
<div class="flex items-center">
|
| 49 |
+
<button onclick="toggleDarkMode()" class="p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 50 |
+
<i class="fas fa-moon dark:hidden"></i>
|
| 51 |
+
<i class="fas fa-sun hidden dark:block"></i>
|
| 52 |
+
</button>
|
| 53 |
+
</div>
|
| 54 |
+
</div>
|
| 55 |
+
</div>
|
| 56 |
+
</nav>
|
| 57 |
+
|
| 58 |
+
<!-- Main Content -->
|
| 59 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
| 60 |
+
<div class="grid grid-cols-12 gap-6">
|
| 61 |
+
<!-- Left Sidebar -->
|
| 62 |
+
<div class="col-span-3">
|
| 63 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-4">
|
| 64 |
+
<div class="space-y-6">
|
| 65 |
+
<!-- Note Type Filter -->
|
| 66 |
+
<div>
|
| 67 |
+
<h3 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Note Types</h3>
|
| 68 |
+
<div class="space-y-2">
|
| 69 |
+
<button onclick="filterNotes('all')" class="w-full flex items-center p-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700">
|
| 70 |
+
<i class="fas fa-list text-indigo-600 dark:text-indigo-400 w-5 h-5"></i>
|
| 71 |
+
<span class="ml-3 text-sm font-medium text-gray-900 dark:text-white">All Notes</span>
|
| 72 |
+
</button>
|
| 73 |
+
<button onclick="filterNotes('observation')" class="w-full flex items-center p-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700">
|
| 74 |
+
<i class="fas fa-eye text-indigo-600 dark:text-indigo-400 w-5 h-5"></i>
|
| 75 |
+
<span class="ml-3 text-sm font-medium text-gray-900 dark:text-white">Observations</span>
|
| 76 |
+
</button>
|
| 77 |
+
<button onclick="filterNotes('memo')" class="w-full flex items-center p-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700">
|
| 78 |
+
<i class="fas fa-file-alt text-indigo-600 dark:text-indigo-400 w-5 h-5"></i>
|
| 79 |
+
<span class="ml-3 text-sm font-medium text-gray-900 dark:text-white">Memos</span>
|
| 80 |
+
</button>
|
| 81 |
+
<button onclick="filterNotes('theory')" class="w-full flex items-center p-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700">
|
| 82 |
+
<i class="fas fa-lightbulb text-indigo-600 dark:text-indigo-400 w-5 h-5"></i>
|
| 83 |
+
<span class="ml-3 text-sm font-medium text-gray-900 dark:text-white">Theories</span>
|
| 84 |
+
</button>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<!-- Linked Entities -->
|
| 89 |
+
<div>
|
| 90 |
+
<h3 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Linked Entities</h3>
|
| 91 |
+
<div class="space-y-2">
|
| 92 |
+
<div class="p-2 bg-gray-50 dark:bg-gray-700 rounded-lg">
|
| 93 |
+
<h4 class="text-sm font-medium text-gray-900 dark:text-white mb-2">Participants</h4>
|
| 94 |
+
<div class="space-y-1">
|
| 95 |
+
<div class="flex items-center p-1 hover:bg-gray-100 dark:hover:bg-gray-600 rounded cursor-pointer">
|
| 96 |
+
<span class="text-sm text-gray-600 dark:text-gray-300">P-12 (Female, 35)</span>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="flex items-center p-1 hover:bg-gray-100 dark:hover:bg-gray-600 rounded cursor-pointer">
|
| 99 |
+
<span class="text-sm text-gray-600 dark:text-gray-300">P-13 (Male, 42)</span>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
<div class="p-2 bg-gray-50 dark:bg-gray-700 rounded-lg">
|
| 104 |
+
<h4 class="text-sm font-medium text-gray-900 dark:text-white mb-2">Interviews</h4>
|
| 105 |
+
<div class="space-y-1">
|
| 106 |
+
<div class="flex items-center p-1 hover:bg-gray-100 dark:hover:bg-gray-600 rounded cursor-pointer">
|
| 107 |
+
<span class="text-sm text-gray-600 dark:text-gray-300">Interview #23</span>
|
| 108 |
+
</div>
|
| 109 |
+
<div class="flex items-center p-1 hover:bg-gray-100 dark:hover:bg-gray-600 rounded cursor-pointer">
|
| 110 |
+
<span class="text-sm text-gray-600 dark:text-gray-300">Interview #24</span>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<!-- Tags -->
|
| 118 |
+
<div>
|
| 119 |
+
<h3 class="text-lg font-medium text-gray-900 dark:text-white mb-4">Tags</h3>
|
| 120 |
+
<div class="flex flex-wrap gap-2">
|
| 121 |
+
<span class="px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full text-xs">#urban_planning</span>
|
| 122 |
+
<span class="px-2 py-1 bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200 rounded-full text-xs">#safety</span>
|
| 123 |
+
<span class="px-2 py-1 bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200 rounded-full text-xs">#infrastructure</span>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
</div>
|
| 129 |
+
|
| 130 |
+
<!-- Main Content Area -->
|
| 131 |
+
<div class="col-span-9 space-y-6">
|
| 132 |
+
<!-- Note Editor -->
|
| 133 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow">
|
| 134 |
+
<div class="p-4 border-b border-gray-200 dark:border-gray-700">
|
| 135 |
+
<div class="flex justify-between items-center">
|
| 136 |
+
<div class="flex space-x-2">
|
| 137 |
+
<button onclick="formatText('bold')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 138 |
+
<i class="fas fa-bold"></i>
|
| 139 |
+
</button>
|
| 140 |
+
<button onclick="formatText('italic')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 141 |
+
<i class="fas fa-italic"></i>
|
| 142 |
+
</button>
|
| 143 |
+
<button onclick="formatText('heading')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 144 |
+
<i class="fas fa-heading"></i>
|
| 145 |
+
</button>
|
| 146 |
+
<button onclick="insertLink()" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 147 |
+
<i class="fas fa-link"></i>
|
| 148 |
+
</button>
|
| 149 |
+
<button onclick="insertImage()" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 150 |
+
<i class="fas fa-image"></i>
|
| 151 |
+
</button>
|
| 152 |
+
<button onclick="insertEquation()" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 153 |
+
<i class="fas fa-square-root-alt"></i>
|
| 154 |
+
</button>
|
| 155 |
+
</div>
|
| 156 |
+
<div class="flex space-x-2">
|
| 157 |
+
<button onclick="saveNote()" class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700">
|
| 158 |
+
<i class="fas fa-save mr-2"></i>
|
| 159 |
+
Save
|
| 160 |
+
</button>
|
| 161 |
+
</div>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
<div class="p-4">
|
| 165 |
+
<div id="editor" class="prose dark:prose-invert max-w-none min-h-[500px] focus:outline-none" role="textbox" aria-label="Research note" tabindex="0" aria-description="Press Ctrl+Alt+L to link to participants"></div>
|
| 166 |
+
</div>
|
| 167 |
+
</div>
|
| 168 |
+
|
| 169 |
+
<!-- Note List -->
|
| 170 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow">
|
| 171 |
+
<div class="p-4 border-b border-gray-200 dark:border-gray-700">
|
| 172 |
+
<div class="flex justify-between items-center">
|
| 173 |
+
<h3 class="text-lg font-medium text-gray-900 dark:text-white">Recent Notes</h3>
|
| 174 |
+
<div class="flex space-x-2">
|
| 175 |
+
<button onclick="changeView('timeline')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 176 |
+
<i class="fas fa-clock"></i>
|
| 177 |
+
</button>
|
| 178 |
+
<button onclick="changeView('network')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 179 |
+
<i class="fas fa-project-diagram"></i>
|
| 180 |
+
</button>
|
| 181 |
+
<button onclick="changeView('table')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 182 |
+
<i class="fas fa-table"></i>
|
| 183 |
+
</button>
|
| 184 |
+
</div>
|
| 185 |
+
</div>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="p-4">
|
| 188 |
+
<div id="noteList" class="space-y-4">
|
| 189 |
+
<!-- Note cards will be dynamically inserted here -->
|
| 190 |
+
</div>
|
| 191 |
+
</div>
|
| 192 |
+
</div>
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
</div>
|
| 196 |
+
|
| 197 |
+
<!-- Offline Banner -->
|
| 198 |
+
<div id="offlineBanner" class="hidden fixed bottom-0 left-0 right-0 bg-yellow-500 text-white p-4 text-center">
|
| 199 |
+
<i class="fas fa-wifi-slash mr-2"></i>
|
| 200 |
+
You are currently offline. Changes will be saved locally.
|
| 201 |
+
</div>
|
| 202 |
+
|
| 203 |
+
<!-- Scripts -->
|
| 204 |
+
<script>
|
| 205 |
+
// Initialize TipTap editor
|
| 206 |
+
const editor = new Editor({
|
| 207 |
+
element: document.querySelector('#editor'),
|
| 208 |
+
extensions: [
|
| 209 |
+
StarterKit,
|
| 210 |
+
Link,
|
| 211 |
+
Image,
|
| 212 |
+
Placeholder.configure({
|
| 213 |
+
placeholder: 'Start writing your note...',
|
| 214 |
+
}),
|
| 215 |
+
TaskList,
|
| 216 |
+
TaskItem,
|
| 217 |
+
],
|
| 218 |
+
content: '',
|
| 219 |
+
onUpdate: ({ editor }) => {
|
| 220 |
+
// Auto-save functionality
|
| 221 |
+
saveNote();
|
| 222 |
+
},
|
| 223 |
+
});
|
| 224 |
+
|
| 225 |
+
// Initialize IndexedDB
|
| 226 |
+
const db = new Dexie('NotesDB');
|
| 227 |
+
db.version(1).stores({
|
| 228 |
+
notes: '++id, content, type, linkedTo, createdAt, lastEdited',
|
| 229 |
+
versionHistory: '++id, noteId, content, timestamp',
|
| 230 |
+
});
|
| 231 |
+
|
| 232 |
+
// State management
|
| 233 |
+
let currentView = 'timeline';
|
| 234 |
+
let currentFilter = 'all';
|
| 235 |
+
let isOffline = false;
|
| 236 |
+
|
| 237 |
+
// Note management
|
| 238 |
+
function saveNote() {
|
| 239 |
+
const content = editor.getHTML();
|
| 240 |
+
const note = {
|
| 241 |
+
content,
|
| 242 |
+
type: 'memo', // Default type
|
| 243 |
+
linkedTo: {
|
| 244 |
+
participants: [],
|
| 245 |
+
interviews: [],
|
| 246 |
+
codes: [],
|
| 247 |
+
},
|
| 248 |
+
createdAt: new Date().toISOString(),
|
| 249 |
+
lastEdited: new Date().toISOString(),
|
| 250 |
+
};
|
| 251 |
+
|
| 252 |
+
if (isOffline) {
|
| 253 |
+
// Save to IndexedDB
|
| 254 |
+
db.notes.add(note);
|
| 255 |
+
} else {
|
| 256 |
+
// Save to server
|
| 257 |
+
saveToServer(note);
|
| 258 |
+
}
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
function saveToServer(note) {
|
| 262 |
+
fetch('/api/notes', {
|
| 263 |
+
method: 'POST',
|
| 264 |
+
headers: {
|
| 265 |
+
'Content-Type': 'application/json',
|
| 266 |
+
},
|
| 267 |
+
body: JSON.stringify(note),
|
| 268 |
+
})
|
| 269 |
+
.then(response => response.json())
|
| 270 |
+
.then(data => {
|
| 271 |
+
console.log('Note saved:', data);
|
| 272 |
+
})
|
| 273 |
+
.catch(error => {
|
| 274 |
+
console.error('Error saving note:', error);
|
| 275 |
+
// Fallback to IndexedDB
|
| 276 |
+
db.notes.add(note);
|
| 277 |
+
});
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
// View management
|
| 281 |
+
function changeView(view) {
|
| 282 |
+
currentView = view;
|
| 283 |
+
updateNoteList();
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
function updateNoteList() {
|
| 287 |
+
const noteList = document.getElementById('noteList');
|
| 288 |
+
noteList.innerHTML = ''; // Clear existing notes
|
| 289 |
+
|
| 290 |
+
// Fetch notes based on current view and filter
|
| 291 |
+
fetchNotes().then(notes => {
|
| 292 |
+
notes.forEach(note => {
|
| 293 |
+
const noteCard = createNoteCard(note);
|
| 294 |
+
noteList.appendChild(noteCard);
|
| 295 |
+
});
|
| 296 |
+
});
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
function createNoteCard(note) {
|
| 300 |
+
const card = document.createElement('div');
|
| 301 |
+
card.className = 'bg-white dark:bg-gray-800 rounded-lg shadow p-4';
|
| 302 |
+
card.innerHTML = `
|
| 303 |
+
<div class="flex justify-between items-start">
|
| 304 |
+
<div>
|
| 305 |
+
<h4 class="text-lg font-medium text-gray-900 dark:text-white">${note.title}</h4>
|
| 306 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">${formatDate(note.lastEdited)}</p>
|
| 307 |
+
</div>
|
| 308 |
+
<div class="flex space-x-2">
|
| 309 |
+
<button onclick="editNote('${note.id}')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 310 |
+
<i class="fas fa-edit"></i>
|
| 311 |
+
</button>
|
| 312 |
+
<button onclick="deleteNote('${note.id}')" class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300">
|
| 313 |
+
<i class="fas fa-trash"></i>
|
| 314 |
+
</button>
|
| 315 |
+
</div>
|
| 316 |
+
</div>
|
| 317 |
+
<div class="mt-2">
|
| 318 |
+
<div class="prose dark:prose-invert max-w-none">${note.content}</div>
|
| 319 |
+
</div>
|
| 320 |
+
<div class="mt-4 flex flex-wrap gap-2">
|
| 321 |
+
${note.tags.map(tag => `
|
| 322 |
+
<span class="px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full text-xs">${tag}</span>
|
| 323 |
+
`).join('')}
|
| 324 |
+
</div>
|
| 325 |
+
`;
|
| 326 |
+
return card;
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
// Formatting functions
|
| 330 |
+
function formatText(type) {
|
| 331 |
+
switch (type) {
|
| 332 |
+
case 'bold':
|
| 333 |
+
editor.chain().focus().toggleBold().run();
|
| 334 |
+
break;
|
| 335 |
+
case 'italic':
|
| 336 |
+
editor.chain().focus().toggleItalic().run();
|
| 337 |
+
break;
|
| 338 |
+
case 'heading':
|
| 339 |
+
editor.chain().focus().toggleHeading({ level: 2 }).run();
|
| 340 |
+
break;
|
| 341 |
+
}
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
function insertLink() {
|
| 345 |
+
const url = prompt('Enter URL:');
|
| 346 |
+
if (url) {
|
| 347 |
+
editor.chain().focus().setLink({ href: url }).run();
|
| 348 |
+
}
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
function insertImage() {
|
| 352 |
+
const url = prompt('Enter image URL:');
|
| 353 |
+
if (url) {
|
| 354 |
+
editor.chain().focus().setImage({ src: url }).run();
|
| 355 |
+
}
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
function insertEquation() {
|
| 359 |
+
const equation = prompt('Enter LaTeX equation:');
|
| 360 |
+
if (equation) {
|
| 361 |
+
const rendered = katex.renderToString(equation);
|
| 362 |
+
editor.chain().focus().insertContent(rendered).run();
|
| 363 |
+
}
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
// Utility functions
|
| 367 |
+
function formatDate(date) {
|
| 368 |
+
return new Date(date).toLocaleDateString();
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
function toggleDarkMode() {
|
| 372 |
+
document.documentElement.classList.toggle('dark');
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
// Offline detection
|
| 376 |
+
function checkOnlineStatus() {
|
| 377 |
+
isOffline = !navigator.onLine;
|
| 378 |
+
document.getElementById('offlineBanner').classList.toggle('hidden', !isOffline);
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
window.addEventListener('online', checkOnlineStatus);
|
| 382 |
+
window.addEventListener('offline', checkOnlineStatus);
|
| 383 |
+
|
| 384 |
+
// Initialize
|
| 385 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 386 |
+
checkOnlineStatus();
|
| 387 |
+
updateNoteList();
|
| 388 |
+
});
|
| 389 |
+
</script>
|
| 390 |
+
|
| 391 |
+
<!-- Styles -->
|
| 392 |
+
<style>
|
| 393 |
+
/* Dark mode styles */
|
| 394 |
+
.dark {
|
| 395 |
+
color-scheme: dark;
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
.dark .prose {
|
| 399 |
+
color: #e5e7eb;
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
.dark .prose h1,
|
| 403 |
+
.dark .prose h2,
|
| 404 |
+
.dark .prose h3,
|
| 405 |
+
.dark .prose h4 {
|
| 406 |
+
color: #f3f4f6;
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
/* Editor styles */
|
| 410 |
+
.ProseMirror {
|
| 411 |
+
min-height: 500px;
|
| 412 |
+
padding: 1rem;
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
.ProseMirror:focus {
|
| 416 |
+
outline: none;
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
.ProseMirror p {
|
| 420 |
+
margin: 1em 0;
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
.ProseMirror h1,
|
| 424 |
+
.ProseMirror h2,
|
| 425 |
+
.ProseMirror h3 {
|
| 426 |
+
margin: 1em 0 0.5em;
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
/* Tag styles */
|
| 430 |
+
.tag {
|
| 431 |
+
display: inline-flex;
|
| 432 |
+
align-items: center;
|
| 433 |
+
padding: 0.25rem 0.75rem;
|
| 434 |
+
border-radius: 9999px;
|
| 435 |
+
font-size: 0.75rem;
|
| 436 |
+
font-weight: 500;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
.tag-blue {
|
| 440 |
+
background-color: #dbeafe;
|
| 441 |
+
color: #1e40af;
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
.dark .tag-blue {
|
| 445 |
+
background-color: #1e3a8a;
|
| 446 |
+
color: #dbeafe;
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
/* Note card styles */
|
| 450 |
+
.note-card {
|
| 451 |
+
transition: all 0.2s ease-in-out;
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
.note-card:hover {
|
| 455 |
+
transform: translateY(-2px);
|
| 456 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
/* Loading animation */
|
| 460 |
+
@keyframes spin {
|
| 461 |
+
to { transform: rotate(360deg); }
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
.loading {
|
| 465 |
+
animation: spin 1s linear infinite;
|
| 466 |
+
}
|
| 467 |
+
</style>
|
| 468 |
+
<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=dataquantals/notes-taker" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 469 |
+
</html>
|