dataquantals commited on
Commit
e0497b7
·
verified ·
1 Parent(s): cd9d9ca

let us do it again under the interview.html. here are the instructions: // Target File: Interview.html // Goal: Embed a full "Add Participant" system directly into the Interview page. This should allow researchers to: // - Add new participants // - View/edit participants in spreadsheet style // - Select participants during "Start New Interview" setup –––––––––––––––––––––––––––––––––––––––––––––– 1. Add “Add Participant” Button: At the top of the participants section inside `Interview.html`, add a green button: <Button className="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 shadow"> ➕ Add Participant </Button> On click → trigger modal or toggle a form inline below the table. –––––––––––––––––––––––––––––––––––––––––––––– 2. Create Participant Entry Form OR Modal: Build a reusable participant entry form with the following fields: - Full Name (text) - Age (number) - Gender (dropdown: Male, Female, Other) - Location (text) - Notes (multiline) Auto-generate unique ID (e.g., `P-001`, `P-002`…) Use Tailwind styling: form group with padding, rounded borders, and error highlighting if validation fails. On submission: - Push to `participants[]` state. - Save to `localStorage["participants"]`. - Show success toast. –––––––––––––––––––––––––––––––––––––––––––––– 3. Display Spreadsheet-style Table: Use a responsive `<table>` inside `Interview.html` or a library like `TanStack Table`. Table Columns: | ID | Full Name | Age | Gender | Location | Notes | Actions (Edit/Delete) | Features: - Inline editable cells (optional) - Delete row button (with confirm) - Sortable by column - Responsive scroll on mobile Use Tailwind classes: `table-auto`, `text-sm`, `rounded`, `shadow`, `overflow-x-scroll` –––––––––––––––––––––––––––––––––––––––––––––– 4. Data Logic: Use the following TypeScript interface: ```ts interface Participant { id: string; name: string; age: number; gender: "Male" | "Female" | "Other"; location: string; notes: string; } Save and retrieve from localStorage: ts Copy Edit useEffect(() => { const saved = JSON.parse(localStorage.getItem("participants") || "[]"); setParticipants(saved); }, []); const saveParticipants = (data) => { localStorage.setItem("participants", JSON.stringify(data)); } –––––––––––––––––––––––––––––––––––––––––––––– 5. Integrate with “Start New Interview”: In the "Start Interview" form (still on Interview.html), add a dropdown: tsx Copy Edit <select className="w-full p-2 border rounded"> {participants.map(p => ( <option key={p.id} value={p.id}> {p.id} – {p.name} </option> ))} </select> Optional: show selected participant’s details below the dropdown. –––––––––––––––––––––––––––––––––––––––––––––– 6. Export/Import Participants: Add "Export CSV" and "Import CSV" buttons next to the table. On export: Convert participants[] to CSV string and trigger download. On import: Parse CSV file → validate → add to list. –––––––––––––––––––––––––––––––––––––––––––––– 7. UI Considerations: Highlight new/unsaved rows Show empty-state illustration when no participants are added yet All elements mobile responsive Use Tailwind utility classes for spacing, font, colors Add icons using Lucide (or any icon lib used in the project) - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +767 -323
index.html CHANGED
@@ -3,396 +3,840 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>AI Assist - 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/marked/marked.min.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  </head>
11
- <body class="bg-gray-50">
12
- <!-- Main Navigation -->
13
- <nav class="bg-white shadow-sm">
14
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
15
- <div class="flex justify-between h-16">
16
- <div class="flex">
17
- <div class="flex-shrink-0 flex items-center">
18
- <img class="h-8 w-auto" src="assets/logo.svg" alt="Quantals Collect">
 
 
 
 
19
  </div>
20
- <div class="hidden sm:ml-6 sm:flex sm:space-x-8">
21
- <a href="Dashboard.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
22
- Dashboard
 
 
 
 
 
 
 
23
  </a>
24
- <a href="Projects.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
25
- Projects
 
26
  </a>
27
- <a href="Participants.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
28
- Participants
 
29
  </a>
30
- <a href="Analysis.html" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
31
- Analysis
 
32
  </a>
33
- <a href="AI_Assist.html" class="border-indigo-500 text-indigo-600 border-b-2 inline-flex items-center px-1 pt-1 text-sm font-medium">
34
- AI Assist
 
 
 
 
 
35
  </a>
36
  </div>
37
- </div>
38
- </div>
39
- </div>
40
- </nav>
41
-
42
- <!-- Main Content -->
43
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
44
- <div class="grid grid-cols-12 gap-6">
45
- <!-- Sidebar Task Menu -->
46
- <div class="col-span-3">
47
- <div class="bg-white rounded-lg shadow p-4">
48
- <h2 class="text-xl font-semibold text-gray-900 mb-4">AI Tasks</h2>
49
- <div class="space-y-2">
50
- <button onclick="selectTask('summarize')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
51
- <i class="fas fa-file-alt text-indigo-600 w-5 h-5"></i>
52
- <span class="ml-3 text-sm font-medium text-gray-900">Summarize Interview</span>
53
- </button>
54
- <button onclick="selectTask('code')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
55
- <i class="fas fa-tags text-indigo-600 w-5 h-5"></i>
56
- <span class="ml-3 text-sm font-medium text-gray-900">Suggest Codes</span>
57
- </button>
58
- <button onclick="selectTask('improve')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
59
- <i class="fas fa-pen text-indigo-600 w-5 h-5"></i>
60
- <span class="ml-3 text-sm font-medium text-gray-900">Improve Field Note</span>
61
- </button>
62
- <button onclick="selectTask('translate')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
63
- <i class="fas fa-language text-indigo-600 w-5 h-5"></i>
64
- <span class="ml-3 text-sm font-medium text-gray-900">Translate to English</span>
65
- </button>
66
- <button onclick="selectTask('cluster')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
67
- <i class="fas fa-object-group text-indigo-600 w-5 h-5"></i>
68
- <span class="ml-3 text-sm font-medium text-gray-900">Cluster Notes</span>
69
- </button>
70
- <button onclick="selectTask('memo')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
71
- <i class="fas fa-sticky-note text-indigo-600 w-5 h-5"></i>
72
- <span class="ml-3 text-sm font-medium text-gray-900">Generate Memo</span>
73
- </button>
74
- <button onclick="selectTask('custom')" class="w-full flex items-center p-3 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
75
- <i class="fas fa-comment text-indigo-600 w-5 h-5"></i>
76
- <span class="ml-3 text-sm font-medium text-gray-900">Custom Prompt</span>
77
  </button>
78
  </div>
79
  </div>
80
  </div>
81
 
82
- <!-- Main Area -->
83
- <div class="col-span-9 space-y-6">
84
- <!-- Header -->
85
- <div class="bg-white rounded-lg shadow p-6">
86
- <h1 class="text-2xl font-bold text-gray-900">AI Assist</h1>
87
- <p class="mt-2 text-gray-600">Let AI help you summarize, translate, code, and cluster qualitative research data.</p>
88
- <div class="mt-4 p-4 bg-yellow-50 rounded-md">
89
- <div class="flex">
90
- <div class="flex-shrink-0">
91
- <i class="fas fa-exclamation-triangle text-yellow-400"></i>
92
- </div>
93
- <div class="ml-3">
94
- <h3 class="text-sm font-medium text-yellow-800">Warning</h3>
95
- <p class="text-sm text-yellow-700">Always validate AI-generated content before use.</p>
96
- </div>
97
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  </div>
99
  </div>
100
-
101
- <!-- Input Area -->
102
- <div class="bg-white rounded-lg shadow p-6">
103
- <div class="space-y-4">
104
- <div>
105
- <label class="block text-sm font-medium text-gray-700">Input Text</label>
106
- <textarea id="inputText" rows="10" class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"></textarea>
 
107
  </div>
108
- <div class="flex items-center justify-between">
109
- <div class="flex items-center">
110
- <input type="file" id="fileUpload" class="hidden" accept=".txt,.json">
111
- <button onclick="document.getElementById('fileUpload').click()" class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
112
- <i class="fas fa-upload mr-2"></i>
113
- Upload File
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  </button>
115
  </div>
116
- <button id="runAI" onclick="runAI()" disabled class="inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed">
117
- <i class="fas fa-robot mr-2"></i>
118
- Run AI
119
- </button>
120
  </div>
121
- </div>
122
- </div>
123
 
124
- <!-- Output Area -->
125
- <div class="bg-white rounded-lg shadow p-6">
126
- <div class="flex justify-between items-center mb-4">
127
- <h3 class="text-lg font-medium text-gray-900">AI Output</h3>
128
- <div class="flex space-x-2">
129
- <button onclick="copyToClipboard()" class="inline-flex items-center px-3 py-1.5 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
130
- <i class="fas fa-copy mr-1"></i>
131
- Copy
132
- </button>
133
- <button onclick="exportOutput()" class="inline-flex items-center px-3 py-1.5 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
134
- <i class="fas fa-download mr-1"></i>
135
- Export
136
- </button>
137
- </div>
138
- </div>
139
- <div id="output" class="prose max-w-none">
140
- <div class="text-gray-500 text-center py-8">
141
- <i class="fas fa-robot text-4xl mb-2"></i>
142
- <p>AI output will appear here</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  </div>
144
  </div>
145
  </div>
146
- </div>
147
  </div>
148
  </div>
149
 
150
- <!-- Loading Overlay -->
151
- <div id="loadingOverlay" class="hidden fixed inset-0 bg-gray-500 bg-opacity-75 flex items-center justify-center">
152
- <div class="bg-white rounded-lg p-6 max-w-sm w-full mx-4">
153
- <div class="flex items-center">
154
- <div class="animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600"></div>
155
- <p class="ml-3 text-gray-700">Processing your request...</p>
156
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  </div>
158
  </div>
159
 
160
- <!-- Scripts -->
161
  <script>
162
- // Configuration
163
- const API_KEY = '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';
164
- const API_URL = 'https://openrouter.ai/api/v1/chat/completions';
165
-
166
- // Task prompts
167
- const TASK_PROMPTS = {
168
- summarize: "Summarize this interview into major themes and include 2-3 key quotes for each.",
169
- code: "Suggest qualitative research codes based on the following transcript. Group them hierarchically if possible.",
170
- improve: "Refine this note for grammar, spelling, and clarity without changing meaning.",
171
- translate: "Translate the following interview from a local language into English.",
172
- cluster: "Group the following field notes into thematic clusters using semantic similarity.",
173
- memo: "Create a theoretical memo from this field data and suggest next steps in analysis.",
174
- custom: "Please analyze the following text:"
175
- };
176
-
177
- // State
178
- let currentTask = null;
179
- let isProcessing = false;
180
-
181
- // UI Elements
182
- const inputText = document.getElementById('inputText');
183
- const runAIButton = document.getElementById('runAI');
184
- const outputDiv = document.getElementById('output');
185
- const loadingOverlay = document.getElementById('loadingOverlay');
186
- const fileUpload = document.getElementById('fileUpload');
187
-
188
- // Event Listeners
189
- inputText.addEventListener('input', validateInput);
190
- fileUpload.addEventListener('change', handleFileUpload);
191
-
192
- // Functions
193
- function selectTask(task) {
194
- currentTask = task;
195
- // Update UI to show selected task
196
- document.querySelectorAll('button').forEach(btn => {
197
- btn.classList.remove('bg-indigo-50');
198
- });
199
- event.currentTarget.classList.add('bg-indigo-50');
200
- }
201
-
202
- function validateInput() {
203
- runAIButton.disabled = !inputText.value.trim();
204
- }
205
 
206
- async function handleFileUpload(event) {
207
- const file = event.target.files[0];
208
- if (file) {
209
- try {
210
- const text = await file.text();
211
- inputText.value = text;
212
- validateInput();
213
- } catch (error) {
214
- showError('Error reading file');
215
  }
216
  }
217
- }
 
 
 
 
 
 
 
 
 
 
218
 
219
- async function runAI() {
220
- if (!currentTask || !inputText.value.trim() || isProcessing) return;
 
 
 
 
 
 
 
 
 
221
 
222
- isProcessing = true;
223
- showLoading();
 
 
 
 
 
224
 
 
 
225
  try {
226
- const response = await fetch(API_URL, {
227
- method: 'POST',
228
- headers: {
229
- 'Authorization': `Bearer ${API_KEY}`,
230
- 'Content-Type': 'application/json'
231
- },
232
- body: JSON.stringify({
233
- model: "deepseek-coder:52-r1",
234
- messages: [
235
- { role: "system", content: "You are a research assistant helping with qualitative data analysis." },
236
- { role: "user", content: `${TASK_PROMPTS[currentTask]}\n\n${inputText.value}` }
237
- ]
238
- })
 
239
  });
240
 
241
- if (!response.ok) {
242
- throw new Error('API request failed');
 
 
 
 
243
  }
244
-
245
- const data = await response.json();
246
- displayResult(data.choices[0].message.content);
247
- } catch (error) {
248
- showError('Error processing request. Please try again.');
249
- console.error('AI processing error:', error);
250
- } finally {
251
- isProcessing = false;
252
- hideLoading();
253
  }
254
  }
255
 
256
- function displayResult(content) {
257
- outputDiv.innerHTML = marked.parse(content);
258
- }
259
 
260
- function showLoading() {
261
- loadingOverlay.classList.remove('hidden');
262
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
- function hideLoading() {
265
- loadingOverlay.classList.add('hidden');
266
- }
267
 
268
- function showError(message) {
269
- outputDiv.innerHTML = `
270
- <div class="bg-red-50 border-l-4 border-red-400 p-4">
271
- <div class="flex">
272
- <div class="flex-shrink-0">
273
- <i class="fas fa-exclamation-circle text-red-400"></i>
274
- </div>
275
- <div class="ml-3">
276
- <p class="text-sm text-red-700">${message}</p>
277
- </div>
278
- </div>
279
- </div>
280
- `;
281
  }
282
 
283
- function copyToClipboard() {
284
- const content = outputDiv.innerText;
285
- navigator.clipboard.writeText(content).then(() => {
286
- showToast('Copied to clipboard');
287
- }).catch(() => {
288
- showToast('Failed to copy');
289
- });
290
  }
291
 
292
- function exportOutput() {
293
- const content = outputDiv.innerText;
294
- const blob = new Blob([content], { type: 'text/plain' });
295
- const url = URL.createObjectURL(blob);
296
- const a = document.createElement('a');
297
- a.href = url;
298
- a.download = 'ai-assist-output.txt';
299
- document.body.appendChild(a);
300
- a.click();
301
- document.body.removeChild(a);
302
- URL.revokeObjectURL(url);
303
  }
304
 
305
- function showToast(message) {
306
- const toast = document.createElement('div');
307
- toast.className = 'fixed bottom-4 right-4 bg-gray-800 text-white px-4 py-2 rounded-md shadow-lg';
308
- toast.textContent = message;
309
- document.body.appendChild(toast);
310
- setTimeout(() => {
311
- toast.remove();
312
- }, 3000);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  }
314
 
315
- // Offline detection
316
- window.addEventListener('online', () => {
317
- runAIButton.disabled = false;
318
- });
 
 
 
 
 
 
 
 
 
 
319
 
320
- window.addEventListener('offline', () => {
321
- runAIButton.disabled = true;
322
- showError('No internet connection');
323
- });
324
- </script>
 
 
 
 
 
 
 
 
 
 
 
325
 
326
- <!-- Styles -->
327
- <style>
328
- .prose {
329
- max-width: 65ch;
330
- color: #374151;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  }
332
 
333
- .prose h1 {
334
- color: #111827;
335
- font-weight: 800;
336
- font-size: 2.25em;
337
- margin-top: 0;
338
- margin-bottom: 0.8888889em;
339
- line-height: 1.1111111;
340
- }
341
 
342
- .prose h2 {
343
- color: #111827;
344
- font-weight: 700;
345
- font-size: 1.5em;
346
- margin-top: 2em;
347
- margin-bottom: 1em;
348
- line-height: 1.3333333;
349
- }
350
 
351
- .prose p {
352
- margin-top: 1.25em;
353
- margin-bottom: 1.25em;
 
354
  }
355
 
356
- .prose ul {
357
- margin-top: 1.25em;
358
- margin-bottom: 1.25em;
359
- padding-left: 1.625em;
360
- }
 
 
 
361
 
362
- .prose li {
363
- margin-top: 0.5em;
364
- margin-bottom: 0.5em;
365
- }
366
 
367
- .prose code {
368
- color: #111827;
369
- font-weight: 600;
370
- font-size: 0.875em;
 
 
 
 
 
 
 
 
371
  }
372
 
373
- .prose pre {
374
- color: #e5e7eb;
375
- background-color: #1f2937;
376
- overflow-x: auto;
377
- font-size: 0.875em;
378
- line-height: 1.7142857;
379
- margin-top: 1.7142857em;
380
- margin-bottom: 1.7142857em;
381
- border-radius: 0.375rem;
382
- padding: 0.8571429em 1.1428571em;
383
- }
 
 
 
 
 
 
 
 
 
 
 
 
384
 
385
- .prose blockquote {
386
- font-weight: 500;
387
- font-style: italic;
388
- color: #111827;
389
- border-left-width: 0.25rem;
390
- border-left-color: #e5e7eb;
391
- quotes: "\201C""\201D""\2018""\2019";
392
- margin-top: 1.6em;
393
- margin-bottom: 1.6em;
394
- padding-left: 1em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  }
396
- </style>
397
  <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>
398
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Interview Management - Quantals Collect</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
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
10
+ <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
12
+ <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
13
+ <style>
14
+ /* Custom styles */
15
+ .recording-indicator {
16
+ animation: pulse 2s infinite;
17
+ }
18
+ @keyframes pulse {
19
+ 0% { opacity: 1; }
20
+ 50% { opacity: 0.5; }
21
+ 100% { opacity: 1; }
22
+ }
23
+ #videoPreview {
24
+ aspect-ratio: 16/9;
25
+ background: #f3f4f6;
26
+ }
27
+ .ql-editor {
28
+ min-height: 200px;
29
+ }
30
+ .interview-history-table th {
31
+ position: sticky;
32
+ top: 0;
33
+ background: white;
34
+ z-index: 10;
35
+ }
36
+ .mobile-menu {
37
+ transition: transform 0.3s ease-in-out;
38
+ }
39
+ .mobile-menu.hidden {
40
+ transform: translateX(-100%);
41
+ }
42
+ .mobile-menu.show {
43
+ transform: translateX(0);
44
+ }
45
+ @media (max-width: 768px) {
46
+ .nav-item {
47
+ padding: 0.75rem 1rem;
48
+ border-bottom: 1px solid #e5e7eb;
49
+ }
50
+ .nav-item:last-child {
51
+ border-bottom: none;
52
+ }
53
+ }
54
+ </style>
55
  </head>
56
+ <body class="bg-gray-50 font-sans">
57
+ <div class="flex flex-col h-screen overflow-hidden">
58
+ <!-- Top Navigation Bar -->
59
+ <nav class="bg-indigo-800 text-white shadow-lg">
60
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
61
+ <div class="flex justify-between items-center h-16">
62
+ <!-- Logo and Brand -->
63
+ <div class="flex items-center space-x-3">
64
+ <div class="bg-white p-2 rounded-lg">
65
+ <i class="fas fa-microscope text-indigo-800 text-xl"></i>
66
+ </div>
67
+ <h1 class="text-xl font-bold">Quantals Collect</h1>
68
  </div>
69
+
70
+ <!-- Desktop Navigation -->
71
+ <div class="hidden md:flex items-center space-x-1">
72
+ <a href="index.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
73
+ <i class="fas fa-home"></i>
74
+ <span>Dashboard</span>
75
+ </a>
76
+ <a href="projects.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
77
+ <i class="fas fa-project-diagram"></i>
78
+ <span>Projects</span>
79
  </a>
80
+ <a href="participants.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
81
+ <i class="fas fa-users"></i>
82
+ <span>Participants</span>
83
  </a>
84
+ <a href="interview.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg bg-indigo-700 text-white">
85
+ <i class="fas fa-microphone"></i>
86
+ <span>Interviews</span>
87
  </a>
88
+ <a href="analysis.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
89
+ <i class="fas fa-chart-pie"></i>
90
+ <span>Analysis</span>
91
  </a>
92
+ <a href="ai-assist.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
93
+ <i class="fas fa-robot"></i>
94
+ <span>AI Assist</span>
95
+ </a>
96
+ <a href="transcriber.html" class="flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
97
+ <i class="fas fa-keyboard"></i>
98
+ <span>Transcriber</span>
99
  </a>
100
  </div>
101
+
102
+ <!-- User Menu and Mobile Menu Button -->
103
+ <div class="flex items-center space-x-4">
104
+ <!-- Settings Link (Desktop) -->
105
+ <a href="settings.html" class="hidden md:flex items-center space-x-2 px-3 py-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
106
+ <i class="fas fa-cog"></i>
107
+ <span>Settings</span>
108
+ </a>
109
+
110
+ <!-- Mobile Menu Button -->
111
+ <button id="mobileMenuBtn" class="md:hidden p-2 rounded-lg text-indigo-200 hover:bg-indigo-700 hover:text-white transition-colors">
112
+ <i class="fas fa-bars text-xl"></i>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  </button>
114
  </div>
115
  </div>
116
  </div>
117
 
118
+ <!-- Mobile Navigation Menu -->
119
+ <div id="mobileMenu" class="mobile-menu hidden md:hidden bg-indigo-800 border-t border-indigo-700">
120
+ <div class="px-4 py-2 space-y-1">
121
+ <a href="index.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
122
+ <i class="fas fa-home w-5"></i>
123
+ <span>Dashboard</span>
124
+ </a>
125
+ <a href="projects.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
126
+ <i class="fas fa-project-diagram w-5"></i>
127
+ <span>Projects</span>
128
+ </a>
129
+ <a href="participants.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
130
+ <i class="fas fa-users w-5"></i>
131
+ <span>Participants</span>
132
+ </a>
133
+ <a href="interview.html" class="nav-item flex items-center space-x-3 bg-indigo-700 text-white rounded-lg">
134
+ <i class="fas fa-microphone w-5"></i>
135
+ <span>Interviews</span>
136
+ </a>
137
+ <a href="analysis.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
138
+ <i class="fas fa-chart-pie w-5"></i>
139
+ <span>Analysis</span>
140
+ </a>
141
+ <a href="ai-assist.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
142
+ <i class="fas fa-robot w-5"></i>
143
+ <span>AI Assist</span>
144
+ </a>
145
+ <a href="transcriber.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
146
+ <i class="fas fa-keyboard w-5"></i>
147
+ <span>Transcriber</span>
148
+ </a>
149
+ <a href="settings.html" class="nav-item flex items-center space-x-3 text-indigo-200 hover:bg-indigo-700 hover:text-white rounded-lg transition-colors">
150
+ <i class="fas fa-cog w-5"></i>
151
+ <span>Settings</span>
152
+ </a>
153
+ </div>
154
+ </div>
155
+ </nav>
156
+
157
+ <!-- Main Content -->
158
+ <div class="flex-1 flex flex-col overflow-hidden">
159
+ <!-- Header -->
160
+ <header class="bg-white shadow-sm p-4 flex justify-between items-center">
161
+ <div class="flex items-center space-x-4">
162
+ <h2 class="text-xl font-semibold text-gray-800">Interviews</h2>
163
+ <div class="offline-indicator hidden px-3 py-1 bg-yellow-100 text-yellow-800 rounded-full text-sm">
164
+ <i class="fas fa-wifi-slash mr-1"></i> Offline
165
  </div>
166
  </div>
167
+ <div class="flex items-center space-x-4">
168
+ <button class="p-2 rounded-full hover:bg-gray-100 relative">
169
+ <i class="fas fa-bell text-gray-600"></i>
170
+ <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
171
+ </button>
172
+ <div class="hidden sm:flex items-center space-x-2">
173
+ <div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center">
174
+ <span class="text-xs font-medium text-indigo-800">RS</span>
175
  </div>
176
+ <span class="text-sm">Research Team</span>
177
+ </div>
178
+ <button class="bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition-colors flex items-center space-x-2">
179
+ <i class="fas fa-plus"></i>
180
+ <span class="hidden sm:inline">Start New Interview</span>
181
+ <span class="sm:hidden">New</span>
182
+ </button>
183
+ </div>
184
+ </header>
185
+
186
+ <!-- Main Content Area -->
187
+ <main class="flex-1 overflow-y-auto p-4 sm:p-6">
188
+ <div class="max-w-7xl mx-auto">
189
+ <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
190
+ <!-- Left Sidebar - Scheduling Panel -->
191
+ <div class="lg:col-span-3">
192
+ <div class="bg-white rounded-lg shadow-sm p-4">
193
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Upcoming Interviews</h3>
194
+ <div class="space-y-4">
195
+ <!-- Sample Interview Items -->
196
+ <div class="p-3 bg-gray-50 rounded-lg">
197
+ <div class="text-sm text-gray-600">Today, 2:00 PM</div>
198
+ <div class="font-medium">John Doe</div>
199
+ <div class="text-sm text-gray-500">Project: UX Research</div>
200
+ </div>
201
+ <div class="p-3 bg-gray-50 rounded-lg">
202
+ <div class="text-sm text-gray-600">Tomorrow, 10:30 AM</div>
203
+ <div class="font-medium">Jane Smith</div>
204
+ <div class="text-sm text-gray-500">Project: Market Study</div>
205
+ </div>
206
+ </div>
207
+ <button class="mt-4 w-full bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition-colors flex items-center justify-center space-x-2">
208
+ <i class="fas fa-plus"></i>
209
+ <span>Schedule Interview</span>
210
  </button>
211
  </div>
 
 
 
 
212
  </div>
 
 
213
 
214
+ <!-- Main Workspace -->
215
+ <div class="lg:col-span-9 space-y-6">
216
+ <!-- Recording Panel -->
217
+ <div class="bg-white rounded-lg shadow-sm p-4">
218
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Recording</h3>
219
+ <div class="flex flex-wrap gap-4 mb-4">
220
+ <div class="w-full">
221
+ <label class="block text-sm font-medium text-gray-700 mb-1">Camera</label>
222
+ <select id="cameraSelect" class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
223
+ <option value="">Select Camera</option>
224
+ </select>
225
+ </div>
226
+ <button class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors flex items-center space-x-2">
227
+ <i class="fas fa-microphone"></i>
228
+ <span>Record Audio</span>
229
+ </button>
230
+ <button class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors flex items-center space-x-2">
231
+ <i class="fas fa-video"></i>
232
+ <span>Record Video</span>
233
+ </button>
234
+ <button class="bg-gray-600 text-white px-4 py-2 rounded-lg hover:bg-gray-700 transition-colors flex items-center space-x-2">
235
+ <i class="fas fa-upload"></i>
236
+ <span>Upload File</span>
237
+ </button>
238
+ </div>
239
+ <div class="mb-4">
240
+ <video id="videoPreview" autoplay muted class="w-full rounded-lg"></video>
241
+ </div>
242
+ <div class="flex justify-between items-center">
243
+ <div class="text-sm text-gray-600">
244
+ <span class="recording-indicator hidden text-red-600">
245
+ <i class="fas fa-circle"></i> Recording...
246
+ </span>
247
+ <span class="timer">00:00:00</span>
248
+ </div>
249
+ <div class="flex space-x-2">
250
+ <button class="bg-gray-100 text-gray-700 px-3 py-1 rounded hover:bg-gray-200 transition-colors">
251
+ <i class="fas fa-pause"></i>
252
+ </button>
253
+ <button class="bg-gray-100 text-gray-700 px-3 py-1 rounded hover:bg-gray-200 transition-colors">
254
+ <i class="fas fa-stop"></i>
255
+ </button>
256
+ </div>
257
+ </div>
258
+ </div>
259
+
260
+ <!-- Notes Panel -->
261
+ <div class="bg-white rounded-lg shadow-sm p-4">
262
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Live Notes</h3>
263
+ <div class="mb-4">
264
+ <div class="text-sm text-gray-600">
265
+ <span class="font-medium">Project:</span> UX Research
266
+ <span class="mx-2">|</span>
267
+ <span class="font-medium">Participant:</span> John Doe
268
+ </div>
269
+ </div>
270
+ <div id="editor" class="h-64"></div>
271
+ <div class="mt-4 flex justify-between items-center">
272
+ <button class="bg-gray-100 text-gray-700 px-3 py-1 rounded hover:bg-gray-200 transition-colors flex items-center space-x-2">
273
+ <i class="fas fa-clock"></i>
274
+ <span>Insert Timestamp</span>
275
+ </button>
276
+ <div class="text-sm text-gray-500">
277
+ Last saved: Just now
278
+ </div>
279
+ </div>
280
+ </div>
281
+
282
+ <!-- Playback & Review Panel -->
283
+ <div class="bg-white rounded-lg shadow-sm p-4">
284
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Playback & Review</h3>
285
+ <div class="flex flex-wrap gap-4 mb-4">
286
+ <button class="bg-gray-100 text-gray-700 px-4 py-2 rounded hover:bg-gray-200 transition-colors flex items-center space-x-2">
287
+ <i class="fas fa-file-alt"></i>
288
+ <span>View Transcript</span>
289
+ </button>
290
+ <div class="relative">
291
+ <button class="bg-gray-100 text-gray-700 px-4 py-2 rounded hover:bg-gray-200 transition-colors flex items-center space-x-2">
292
+ <i class="fas fa-download"></i>
293
+ <span>Export</span>
294
+ <i class="fas fa-chevron-down ml-2"></i>
295
+ </button>
296
+ <!-- Export dropdown menu -->
297
+ </div>
298
+ </div>
299
+ <div class="flex flex-wrap items-center gap-4 mb-4">
300
+ <label class="flex items-center space-x-2">
301
+ <input type="checkbox" class="form-checkbox text-indigo-600">
302
+ <span class="text-sm text-gray-700">Show Transcript</span>
303
+ </label>
304
+ <label class="flex items-center space-x-2">
305
+ <input type="checkbox" class="form-checkbox text-indigo-600">
306
+ <span class="text-sm text-gray-700">Sync Notes Timeline</span>
307
+ </label>
308
+ </div>
309
+ <div id="transcript" class="hidden bg-gray-50 rounded-lg p-4 max-h-64 overflow-y-auto">
310
+ <!-- Transcript content will be inserted here -->
311
+ </div>
312
+ </div>
313
+
314
+ <!-- Interview History -->
315
+ <div class="bg-white rounded-lg shadow-sm p-4">
316
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Interview History</h3>
317
+ <div class="overflow-x-auto">
318
+ <table class="interview-history-table min-w-full">
319
+ <thead>
320
+ <tr class="bg-gray-50">
321
+ <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Interview ID</th>
322
+ <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Participant</th>
323
+ <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Date</th>
324
+ <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Status</th>
325
+ <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Media Type</th>
326
+ <th class="px-4 py-2 text-left text-sm font-medium text-gray-500">Actions</th>
327
+ </tr>
328
+ </thead>
329
+ <tbody class="divide-y divide-gray-200">
330
+ <!-- Sample rows -->
331
+ <tr>
332
+ <td class="px-4 py-2 text-sm">IVW-20240315-001</td>
333
+ <td class="px-4 py-2 text-sm">John Doe</td>
334
+ <td class="px-4 py-2 text-sm">Mar 15, 2024</td>
335
+ <td class="px-4 py-2 text-sm">
336
+ <span class="px-2 py-1 bg-green-100 text-green-800 rounded-full text-xs">Completed</span>
337
+ </td>
338
+ <td class="px-4 py-2 text-sm">Video</td>
339
+ <td class="px-4 py-2 text-sm">
340
+ <div class="flex space-x-2">
341
+ <button class="text-indigo-600 hover:text-indigo-800">
342
+ <i class="fas fa-eye"></i>
343
+ </button>
344
+ <button class="text-gray-600 hover:text-gray-800">
345
+ <i class="fas fa-download"></i>
346
+ </button>
347
+ <button class="text-red-600 hover:text-red-800">
348
+ <i class="fas fa-trash"></i>
349
+ </button>
350
+ </div>
351
+ </td>
352
+ </tr>
353
+ </tbody>
354
+ </table>
355
+ </div>
356
+ </div>
357
  </div>
358
  </div>
359
  </div>
360
+ </main>
361
  </div>
362
  </div>
363
 
364
+ <!-- Schedule Interview Modal -->
365
+ <div id="scheduleModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
366
+ <div class="bg-white rounded-lg p-6 w-full max-w-md mx-4">
367
+ <h3 class="text-lg font-semibold text-gray-800 mb-4">Schedule New Interview</h3>
368
+ <form class="space-y-4">
369
+ <div>
370
+ <label class="block text-sm font-medium text-gray-700 mb-1">Participant *</label>
371
+ <select class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
372
+ <option value="">Select Participant</option>
373
+ <option>John Doe (ID: P001)</option>
374
+ <option>Jane Smith (ID: P002)</option>
375
+ <!-- Will be populated dynamically -->
376
+ </select>
377
+ </div>
378
+ <div>
379
+ <label class="block text-sm font-medium text-gray-700 mb-1">Project *</label>
380
+ <select class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
381
+ <option value="">Select Project</option>
382
+ <option>UX Research</option>
383
+ <option>Market Study</option>
384
+ <!-- Will be populated dynamically -->
385
+ </select>
386
+ </div>
387
+ <div>
388
+ <label class="block text-sm font-medium text-gray-700 mb-1">Date & Time *</label>
389
+ <input type="datetime-local" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
390
+ </div>
391
+ <div>
392
+ <label class="block text-sm font-medium text-gray-700 mb-1">Interviewer *</label>
393
+ <select class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
394
+ <option value="">Select Interviewer</option>
395
+ <option>Research Team</option>
396
+ <option>Alex Johnson</option>
397
+ <option>Sam Williams</option>
398
+ </select>
399
+ </div>
400
+ <div>
401
+ <label class="block text-sm font-medium text-gray-700 mb-1">Mode *</label>
402
+ <div class="space-y-2 mt-1">
403
+ <div class="flex items-center">
404
+ <input type="radio" id="mode-in-person" name="mode" value="in-person" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500">
405
+ <label for="mode-in-person" class="ml-2 block text-sm text-gray-700">In-Person</label>
406
+ </div>
407
+ <div class="flex items-center">
408
+ <input type="radio" id="mode-online" name="mode" value="online" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500">
409
+ <label for="mode-online" class="ml-2 block text-sm text-gray-700">Zoom/Online</label>
410
+ </div>
411
+ <div class="flex items-center">
412
+ <input type="radio" id="mode-phone" name="mode" value="phone" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500">
413
+ <label for="mode-phone" class="ml-2 block text-sm text-gray-700">Phone</label>
414
+ </div>
415
+ </div>
416
+ </div>
417
+ <div id="locationField">
418
+ <label for="location" class="block text-sm font-medium text-gray-700 mb-1">Location/Link *</label>
419
+ <input type="text" id="location" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" required>
420
+ </div>
421
+ <div>
422
+ <label for="notes" class="block text-sm font-medium text-gray-700 mb-1">Notes (Optional)</label>
423
+ <textarea id="notes" rows="3" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"></textarea>
424
+ </div>
425
+ <div class="flex justify-end space-x-3 mt-6">
426
+ <button type="button" id="cancelScheduleBtn"
427
+ class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
428
+ Cancel
429
+ </button>
430
+ <button type="submit" id="submitScheduleBtn"
431
+ class="px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
432
+ Schedule
433
+ </button>
434
+ </div>
435
+ </form>
436
  </div>
437
  </div>
438
 
 
439
  <script>
440
+ // Mobile menu functionality
441
+ const mobileMenuBtn = document.getElementById('mobileMenuBtn');
442
+ const mobileMenu = document.getElementById('mobileMenu');
443
+ let isMobileMenuOpen = false;
444
+
445
+ mobileMenuBtn.addEventListener('click', () => {
446
+ isMobileMenuOpen = !isMobileMenuOpen;
447
+ if (isMobileMenuOpen) {
448
+ mobileMenu.classList.remove('hidden');
449
+ mobileMenu.classList.add('show');
450
+ mobileMenuBtn.innerHTML = '<i class="fas fa-times text-xl"></i>';
451
+ } else {
452
+ mobileMenu.classList.add('hidden');
453
+ mobileMenu.classList.remove('show');
454
+ mobileMenuBtn.innerHTML = '<i class="fas fa-bars text-xl"></i>';
455
+ }
456
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
 
458
+ // Close mobile menu when clicking outside
459
+ document.addEventListener('click', (e) => {
460
+ if (!mobileMenuBtn.contains(e.target) && !mobileMenu.contains(e.target)) {
461
+ if (isMobileMenuOpen) {
462
+ isMobileMenuOpen = false;
463
+ mobileMenu.classList.add('hidden');
464
+ mobileMenu.classList.remove('show');
465
+ mobileMenuBtn.innerHTML = '<i class="fas fa-bars text-xl"></i>';
 
466
  }
467
  }
468
+ });
469
+
470
+ // Close mobile menu on window resize if screen becomes larger
471
+ window.addEventListener('resize', () => {
472
+ if (window.innerWidth >= 768 && isMobileMenuOpen) {
473
+ isMobileMenuOpen = false;
474
+ mobileMenu.classList.add('hidden');
475
+ mobileMenu.classList.remove('show');
476
+ mobileMenuBtn.innerHTML = '<i class="fas fa-bars text-xl"></i>';
477
+ }
478
+ });
479
 
480
+ // Initialize Quill editor
481
+ var quill = new Quill('#editor', {
482
+ theme: 'snow',
483
+ modules: {
484
+ toolbar: [
485
+ ['bold', 'italic', 'underline'],
486
+ [{ 'list': 'ordered'}, { 'list': 'bullet' }],
487
+ ['clean']
488
+ ]
489
+ }
490
+ });
491
 
492
+ // MediaRecorder setup
493
+ let mediaRecorder;
494
+ let recordedChunks = [];
495
+ let isRecording = false;
496
+ let timerInterval;
497
+ let startTime;
498
+ let videoStream;
499
 
500
+ // Get available cameras and start preview
501
+ async function getCameras() {
502
  try {
503
+ const devices = await navigator.mediaDevices.enumerateDevices();
504
+ const videoDevices = devices.filter(device => device.kind === 'videoinput');
505
+ const cameraSelect = document.getElementById('cameraSelect');
506
+ const videoPreview = document.getElementById('videoPreview');
507
+
508
+ // Clear existing options
509
+ cameraSelect.innerHTML = '<option value="">Select Camera</option>';
510
+
511
+ // Add camera options
512
+ videoDevices.forEach(device => {
513
+ const option = document.createElement('option');
514
+ option.value = device.deviceId;
515
+ option.text = device.label || `Camera ${cameraSelect.length + 1}`;
516
+ cameraSelect.appendChild(option);
517
  });
518
 
519
+ // Start preview with first available camera
520
+ if (videoDevices.length > 0) {
521
+ const stream = await navigator.mediaDevices.getUserMedia({
522
+ video: { deviceId: videoDevices[0].deviceId }
523
+ });
524
+ videoPreview.srcObject = stream;
525
  }
526
+ } catch (err) {
527
+ console.error('Error accessing media devices:', err);
 
 
 
 
 
 
 
528
  }
529
  }
530
 
531
+ // Call initially and whenever devices change
532
+ getCameras();
533
+ navigator.mediaDevices.addEventListener('devicechange', getCameras);
534
 
535
+ // Handle camera selection change
536
+ document.getElementById('cameraSelect').addEventListener('change', async function() {
537
+ const videoPreview = document.getElementById('videoPreview');
538
+ const selectedDeviceId = this.value;
539
+
540
+ if (selectedDeviceId) {
541
+ try {
542
+ const stream = await navigator.mediaDevices.getUserMedia({
543
+ video: { deviceId: selectedDeviceId }
544
+ });
545
+
546
+ // Stop previous stream
547
+ if (videoPreview.srcObject) {
548
+ videoPreview.srcObject.getTracks().forEach(track => track.stop());
549
+ }
550
+
551
+ videoPreview.srcObject = stream;
552
+ } catch (err) {
553
+ console.error('Error switching camera:', err);
554
+ }
555
+ }
556
+ });
557
 
558
+ // Timer display
559
+ const timerDisplay = document.querySelector('.timer');
560
+ const recordingIndicator = document.querySelector('.recording-indicator');
561
 
562
+ function startTimer() {
563
+ startTime = Date.now();
564
+ timerInterval = setInterval(updateTimer, 1000);
 
 
 
 
 
 
 
 
 
 
565
  }
566
 
567
+ function updateTimer() {
568
+ const elapsed = Date.now() - startTime;
569
+ const seconds = Math.floor(elapsed / 1000);
570
+ const minutes = Math.floor(seconds / 60);
571
+ const hours = Math.floor(minutes / 60);
572
+
573
+ timerDisplay.textContent = `${String(hours).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}:${String(seconds % 60).padStart(2, '0')}`;
574
  }
575
 
576
+ function stopTimer() {
577
+ clearInterval(timerInterval);
 
 
 
 
 
 
 
 
 
578
  }
579
 
580
+ // Recording functions
581
+ async function startRecording(type) {
582
+ try {
583
+ const constraints = {
584
+ audio: type === 'audio' || type === 'video',
585
+ video: false
586
+ };
587
+
588
+ if (type === 'video') {
589
+ const cameraSelect = document.getElementById('cameraSelect');
590
+ const selectedCameraId = cameraSelect.value;
591
+
592
+ constraints.video = {
593
+ deviceId: selectedCameraId ? { exact: selectedCameraId } : undefined
594
+ };
595
+ }
596
+
597
+ const stream = await navigator.mediaDevices.getUserMedia(constraints);
598
+ videoStream = stream;
599
+
600
+ mediaRecorder = new MediaRecorder(stream);
601
+ recordedChunks = [];
602
+
603
+ mediaRecorder.ondataavailable = (event) => {
604
+ if (event.data.size > 0) {
605
+ recordedChunks.push(event.data);
606
+ }
607
+ };
608
+
609
+ mediaRecorder.onstop = () => {
610
+ const blob = new Blob(recordedChunks, {
611
+ type: type === 'video' ? 'video/webm' : 'audio/webm'
612
+ });
613
+ const url = URL.createObjectURL(blob);
614
+ const mediaContainer = document.querySelector('.media-container');
615
+
616
+ if (type === 'video') {
617
+ mediaContainer.innerHTML = `<video controls src="${url}" class="w-full h-full"></video>`;
618
+ } else {
619
+ mediaContainer.innerHTML = `<audio controls src="${url}" class="w-full"></audio>`;
620
+ }
621
+ };
622
+
623
+ mediaRecorder.start();
624
+ isRecording = true;
625
+ recordingIndicator.classList.remove('hidden');
626
+ startTimer();
627
+ } catch (err) {
628
+ console.error('Error accessing media devices:', err);
629
+ alert('Error accessing media devices. Please ensure you have granted the necessary permissions.');
630
+ }
631
  }
632
 
633
+ function stopRecording() {
634
+ if (mediaRecorder && isRecording) {
635
+ mediaRecorder.stop();
636
+ isRecording = false;
637
+ recordingIndicator.classList.add('hidden');
638
+ stopTimer();
639
+
640
+ // Stop all tracks
641
+ if (videoStream) {
642
+ videoStream.getTracks().forEach(track => track.stop());
643
+ videoStream = null;
644
+ }
645
+ }
646
+ }
647
 
648
+ // Event listeners
649
+ document.querySelector('button:has(.fa-microphone)').addEventListener('click', () => startRecording('audio'));
650
+ document.querySelector('button:has(.fa-video)').addEventListener('click', () => startRecording('video'));
651
+ document.querySelector('button:has(.fa-stop)').addEventListener('click', stopRecording);
652
+
653
+ // Schedule interview modal
654
+ function setupScheduleModal() {
655
+ const scheduleButtons = document.querySelectorAll('button:has(.fa-plus)');
656
+
657
+ scheduleButtons.forEach(button => {
658
+ button.addEventListener('click', () => {
659
+ modal.classList.remove('hidden');
660
+ document.body.style.overflow = 'hidden';
661
+ modal.querySelector('input').focus();
662
+ });
663
+ });
664
 
665
+ // Pre-populate with today's date
666
+ const now = new Date();
667
+ const timeString = `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`;
668
+ const today = `${now.getFullYear()}-${(now.getMonth()+1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`;
669
+ document.querySelector('input[type="datetime-local"]').value = `${today}T${timeString}`;
670
+
671
+ // Handle mode selection changes
672
+ const modeRadios = document.querySelectorAll('input[name="mode"]');
673
+ const locationField = document.getElementById('locationField');
674
+ const locationInput = document.getElementById('location');
675
+
676
+ modeRadios.forEach(radio => {
677
+ radio.addEventListener('change', (e) => {
678
+ const mode = e.target.value;
679
+ const label = locationField.querySelector('label');
680
+
681
+ if (mode === 'online') {
682
+ label.textContent = 'Meeting Link *';
683
+ locationInput.placeholder = 'https://zoom.us/j/...';
684
+ } else if (mode === 'phone') {
685
+ label.textContent = 'Phone Number *';
686
+ locationInput.placeholder = '+1 (555) 123-4567';
687
+ } else {
688
+ label.textContent = 'Location *';
689
+ locationInput.placeholder = 'Office address or room number';
690
+ }
691
+ });
692
+ });
693
  }
694
 
695
+ document.addEventListener('DOMContentLoaded', setupScheduleModal);
 
 
 
 
 
 
 
696
 
697
+ // Auto-save notes
698
+ setInterval(() => {
699
+ const content = quill.root.innerHTML;
700
+ localStorage.setItem('interview_notes', content);
701
+ // TODO: Implement remote save
702
+ }, 30000);
 
 
703
 
704
+ // Load saved notes
705
+ const savedNotes = localStorage.getItem('interview_notes');
706
+ if (savedNotes) {
707
+ quill.root.innerHTML = savedNotes;
708
  }
709
 
710
+ // Before unload warning
711
+ window.addEventListener('beforeunload', (e) => {
712
+ if (isRecording) {
713
+ e.preventDefault();
714
+ e.returnValue = '';
715
+ }
716
+ });
717
+ </script>
718
 
719
+ <!-- Toast Notification -->
720
+ <div id="toast" class="hidden fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg">
721
+ Interview successfully scheduled.
722
+ </div>
723
 
724
+ <script>
725
+ // Modal handling
726
+ const modal = document.getElementById('scheduleModal');
727
+ const cancelBtn = document.getElementById('cancelScheduleBtn');
728
+ const submitBtn = document.getElementById('submitScheduleBtn');
729
+ const form = modal.querySelector('form');
730
+ const toast = document.getElementById('toast');
731
+
732
+ // Modal close functions
733
+ function closeModal() {
734
+ modal.classList.add('hidden');
735
+ document.body.style.overflow = 'auto';
736
  }
737
 
738
+ // Keyboard accessibility
739
+ modal.addEventListener('keydown', (e) => {
740
+ if (e.key === 'Escape') closeModal();
741
+ if (e.key === 'Tab') {
742
+ const focusable = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
743
+ if (focusable.length === 0) return;
744
+
745
+ const first = focusable[0];
746
+ const last = focusable[focusable.length - 1];
747
+
748
+ if (e.shiftKey) {
749
+ if (document.activeElement === first) {
750
+ last.focus();
751
+ e.preventDefault();
752
+ }
753
+ } else {
754
+ if (document.activeElement === last) {
755
+ first.focus();
756
+ e.preventDefault();
757
+ }
758
+ }
759
+ }
760
+ });
761
 
762
+ // Close buttons
763
+ cancelBtn.addEventListener('click', closeModal);
764
+
765
+ // Form submission
766
+ form.addEventListener('submit', async (e) => {
767
+ e.preventDefault();
768
+
769
+ // Validate required fields
770
+ const requiredFields = form.querySelectorAll('[required]');
771
+ let isValid = true;
772
+
773
+ requiredFields.forEach(field => {
774
+ if (!field.value) {
775
+ isValid = false;
776
+ field.classList.add('border-red-500');
777
+ } else {
778
+ field.classList.remove('border-red-500');
779
+ }
780
+ });
781
+
782
+ if (!isValid) return;
783
+
784
+ // Get form values
785
+ const formData = {
786
+ participantId: form.querySelector('select:nth-of-type(1)').value,
787
+ projectId: form.querySelector('select:nth-of-type(2)').value,
788
+ interviewerId: form.querySelector('select:nth-of-type(3)').value,
789
+ datetime: form.querySelector('input[type="datetime-local"]').value,
790
+ mode: form.querySelector('input[name="mode"]:checked').value,
791
+ location: document.getElementById('location').value,
792
+ notes: document.getElementById('notes').value,
793
+ status: 'scheduled'
794
+ };
795
+
796
+ try {
797
+ // In a real app, you would call an API here
798
+ // For demo, we'll use localStorage
799
+ const interviews = JSON.parse(localStorage.getItem('interviews') || '[]');
800
+ const newInterview = {
801
+ ...formData,
802
+ id: 'IVW-' + Date.now().toString().slice(-6)
803
+ };
804
+
805
+ interviews.push(newInterview);
806
+ localStorage.setItem('interviews', JSON.stringify(interviews));
807
+
808
+ // Show success & close modal
809
+ toast.classList.remove('hidden');
810
+ setTimeout(() => toast.classList.add('hidden'), 3000);
811
+ closeModal();
812
+
813
+ // Refresh upcoming interviews
814
+ refreshUpcomingInterviews();
815
+ } catch (error) {
816
+ console.error('Error saving interview:', error);
817
+ alert('Failed to schedule interview');
818
+ }
819
+ });
820
+
821
+ function refreshUpcomingInterviews() {
822
+ const interviews = JSON.parse(localStorage.getItem('interviews') || '[]');
823
+ const upcomingContainer = document.querySelector('.space-y-4');
824
+
825
+ // Sort by datetime
826
+ const sorted = interviews
827
+ .filter(i => new Date(i.datetime) > new Date())
828
+ .sort((a, b) => new Date(a.datetime) - new Date(b.datetime));
829
+
830
+ // Update UI
831
+ upcomingContainer.innerHTML = sorted
832
+ .map(interview => `
833
+ <div class="p-3 bg-gray-50 rounded-lg">
834
+ <div class="text-sm text-gray-600">${new Date(interview.datetime).toLocaleString()}</div>
835
+ <div class="font-medium">${interview.participantId}</div>
836
+ <div class="text-sm text-gray-500">Project: ${interview.projectId}</div>
837
+ </div>
838
+ `).join('');
839
  }
840
+ </script>
841
  <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>
842
  </html>