File size: 19,467 Bytes
c190eb8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AuraRecall | AI-Powered Memory System</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .file-upload-container {
            transition: all 0.3s ease;
        }
        .file-upload-container:hover {
            transform: translateY(-2px);
        }
        .ai-response-container {
            max-height: 300px;
            overflow-y: auto;
        }
        .pulse-animation {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }
        .gradient-border {
            border: 2px solid transparent;
            background: linear-gradient(white, white) padding-box,
                        linear-gradient(to right, #6366f1, #8b5cf6) border-box;
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen">
    <div class="container mx-auto px-4 py-8 max-w-6xl">
        <!-- Header -->
        <header class="mb-12 text-center">
            <div class="flex justify-center items-center mb-4">
                <div class="w-12 h-12 rounded-full bg-indigo-500 flex items-center justify-center mr-4">
                    <i class="fas fa-brain text-white text-xl"></i>
                </div>
                <h1 class="text-4xl font-bold text-indigo-800">AuraRecall</h1>
            </div>
            <h2 class="text-2xl font-semibold text-gray-700">AI-Powered Memory System with Cloudflare Integration</h2>
            <div class="w-24 h-1 bg-indigo-500 mx-auto mt-4 rounded-full"></div>
        </header>

        <!-- Main Content -->
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
            <!-- File Upload Section -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden gradient-border">
                <div class="bg-indigo-600 px-6 py-4">
                    <h3 class="text-xl font-semibold text-white flex items-center">
                        <i class="fas fa-cloud-upload-alt mr-3"></i> Memory Fragment Upload
                    </h3>
                </div>
                <div class="p-6">
                    <div id="file-upload-container" class="file-upload-container border-2 border-dashed border-gray-300 rounded-lg p-8 text-center cursor-pointer hover:border-indigo-400 transition">
                        <i class="fas fa-file-upload text-4xl text-gray-400 mb-4"></i>
                        <p class="text-gray-600 mb-2">Drag & drop your memory fragment here</p>
                        <p class="text-sm text-gray-500 mb-4">Supports audio (MP3, WAV) and video (MP4, MOV) files</p>
                        <input type="file" id="file-input" class="hidden" accept=".mp3,.wav,.mp4,.mov">
                        <label for="file-input" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition cursor-pointer">
                            Select File
                        </label>
                    </div>
                    
                    <div id="upload-progress" class="mt-6 hidden">
                        <div class="flex justify-between mb-2">
                            <span class="text-sm font-medium text-gray-700">Uploading...</span>
                            <span id="upload-percent" class="text-sm font-medium text-indigo-600">0%</span>
                        </div>
                        <div class="w-full bg-gray-200 rounded-full h-2.5">
                            <div id="upload-progress-bar" class="bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div>
                        </div>
                    </div>
                    
                    <div id="upload-success" class="mt-6 p-4 bg-green-50 rounded-lg hidden">
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-green-500 text-xl mr-3"></i>
                            <div>
                                <h4 class="font-medium text-green-800">Upload Successful!</h4>
                                <p class="text-sm text-green-600">Your memory fragment is being processed.</p>
                            </div>
                        </div>
                    </div>
                    
                    <div id="upload-error" class="mt-6 p-4 bg-red-50 rounded-lg hidden">
                        <div class="flex items-center">
                            <i class="fas fa-exclamation-circle text-red-500 text-xl mr-3"></i>
                            <div>
                                <h4 class="font-medium text-red-800">Upload Failed</h4>
                                <p id="error-message" class="text-sm text-red-600"></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- AI Query Section -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden gradient-border">
                <div class="bg-purple-600 px-6 py-4">
                    <h3 class="text-xl font-semibold text-white flex items-center">
                        <i class="fas fa-robot mr-3"></i> Cloudflare AI Gateway
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mb-6">
                        <label for="ai-query" class="block text-sm font-medium text-gray-700 mb-2">Ask about your memories</label>
                        <div class="flex">
                            <input type="text" id="ai-query" placeholder="E.g. What was that restaurant we visited in Paris?" 
                                   class="flex-1 px-4 py-2 border border-gray-300 rounded-l-lg focus:ring-indigo-500 focus:border-indigo-500">
                            <button id="send-query" class="px-4 py-2 bg-purple-600 text-white rounded-r-lg hover:bg-purple-700 transition">
                                <i class="fas fa-paper-plane"></i>
                            </button>
                        </div>
                    </div>
                    
                    <div id="ai-thinking" class="hidden mb-6 p-4 bg-purple-50 rounded-lg">
                        <div class="flex items-center">
                            <div class="pulse-animation">
                                <i class="fas fa-circle-notch fa-spin text-purple-500 mr-3"></i>
                            </div>
                            <span class="text-purple-700">Processing your query with AI...</span>
                        </div>
                    </div>
                    
                    <div id="ai-response-container" class="hidden">
                        <h4 class="font-medium text-gray-700 mb-3 flex items-center">
                            <i class="fas fa-comment-dots text-purple-500 mr-2"></i> AI Response
                        </h4>
                        <div class="ai-response-container bg-gray-50 p-4 rounded-lg border border-gray-200">
                            <p id="ai-response" class="text-gray-700"></p>
                        </div>
                        <div class="mt-3 text-right">
                            <button id="refine-query" class="text-sm px-3 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200 transition">
                                <i class="fas fa-redo mr-1"></i> Refine Query
                            </button>
                        </div>
                    </div>
                    
                    <div id="ai-error" class="hidden mt-6 p-4 bg-red-50 rounded-lg">
                        <div class="flex items-center">
                            <i class="fas fa-exclamation-circle text-red-500 text-xl mr-3"></i>
                            <div>
                                <h4 class="font-medium text-red-800">AI Query Failed</h4>
                                <p id="ai-error-message" class="text-sm text-red-600"></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- System Status -->
        <div class="mt-12 bg-white rounded-xl shadow-md overflow-hidden">
            <div class="bg-gray-800 px-6 py-4">
                <h3 class="text-xl font-semibold text-white flex items-center">
                    <i class="fas fa-server mr-3"></i> System Status
                </h3>
            </div>
            <div class="p-6">
                <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                    <div class="border border-gray-200 rounded-lg p-4">
                        <div class="flex items-center mb-3">
                            <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center mr-3">
                                <i class="fas fa-upload text-indigo-500"></i>
                            </div>
                            <h4 class="font-medium text-gray-700">Ingestion Service</h4>
                        </div>
                        <div class="flex items-center">
                            <div class="w-2 h-2 rounded-full bg-green-500 mr-2"></div>
                            <span class="text-sm text-gray-600">Operational</span>
                        </div>
                    </div>
                    
                    <div class="border border-gray-200 rounded-lg p-4">
                        <div class="flex items-center mb-3">
                            <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                <i class="fas fa-network-wired text-purple-500"></i>
                            </div>
                            <h4 class="font-medium text-gray-700">Cloudflare Gateway</h4>
                        </div>
                        <div class="flex items-center">
                            <div class="w-2 h-2 rounded-full bg-green-500 mr-2"></div>
                            <span class="text-sm text-gray-600">Connected</span>
                        </div>
                    </div>
                    
                    <div class="border border-gray-200 rounded-lg p-4">
                        <div class="flex items-center mb-3">
                            <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                <i class="fas fa-database text-blue-500"></i>
                            </div>
                            <h4 class="font-medium text-gray-700">Memory Database</h4>
                        </div>
                        <div class="flex items-center">
                            <div class="w-2 h-2 rounded-full bg-green-500 mr-2"></div>
                            <span class="text-sm text-gray-600">Synced</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // File Upload Handling
            const fileInput = document.getElementById('file-input');
            const uploadContainer = document.getElementById('file-upload-container');
            const uploadProgress = document.getElementById('upload-progress');
            const progressBar = document.getElementById('upload-progress-bar');
            const uploadPercent = document.getElementById('upload-percent');
            const uploadSuccess = document.getElementById('upload-success');
            const uploadError = document.getElementById('upload-error');
            const errorMessage = document.getElementById('error-message');
            
            // Drag and drop functionality
            uploadContainer.addEventListener('dragover', (e) => {
                e.preventDefault();
                uploadContainer.classList.add('border-indigo-500', 'bg-indigo-50');
            });
            
            uploadContainer.addEventListener('dragleave', () => {
                uploadContainer.classList.remove('border-indigo-500', 'bg-indigo-50');
            });
            
            uploadContainer.addEventListener('drop', (e) => {
                e.preventDefault();
                uploadContainer.classList.remove('border-indigo-500', 'bg-indigo-50');
                if (e.dataTransfer.files.length) {
                    fileInput.files = e.dataTransfer.files;
                    handleFileUpload();
                }
            });
            
            fileInput.addEventListener('change', handleFileUpload);
            
            function handleFileUpload() {
                const file = fileInput.files[0];
                if (!file) return;
                
                // Validate file type
                const validTypes = ['audio/mp3', 'audio/wav', 'video/mp4', 'video/quicktime'];
                if (!validTypes.includes(file.type)) {
                    showUploadError('Invalid file type. Please upload an audio or video file.');
                    return;
                }
                
                // Validate file size (max 100MB)
                if (file.size > 100 * 1024 * 1024) {
                    showUploadError('File too large. Maximum size is 100MB.');
                    return;
                }
                
                // Show upload progress
                uploadProgress.classList.remove('hidden');
                uploadSuccess.classList.add('hidden');
                uploadError.classList.add('hidden');
                
                // Simulate upload progress (in a real app, this would be actual upload progress)
                let progress = 0;
                const interval = setInterval(() => {
                    progress += Math.random() * 10;
                    if (progress >= 100) {
                        progress = 100;
                        clearInterval(interval);
                        
                        // Simulate successful upload
                        setTimeout(() => {
                            uploadProgress.classList.add('hidden');
                            uploadSuccess.classList.remove('hidden');
                            
                            // Reset after 5 seconds
                            setTimeout(() => {
                                uploadSuccess.classList.add('hidden');
                                fileInput.value = '';
                            }, 5000);
                        }, 500);
                    }
                    
                    progressBar.style.width = `${progress}%`;
                    uploadPercent.textContent = `${Math.round(progress)}%`;
                }, 300);
            }
            
            function showUploadError(message) {
                errorMessage.textContent = message;
                uploadError.classList.remove('hidden');
                uploadProgress.classList.add('hidden');
                uploadSuccess.classList.add('hidden');
                
                // Hide error after 5 seconds
                setTimeout(() => {
                    uploadError.classList.add('hidden');
                }, 5000);
            }
            
            // AI Query Handling
            const aiQueryInput = document.getElementById('ai-query');
            const sendQueryBtn = document.getElementById('send-query');
            const aiThinking = document.getElementById('ai-thinking');
            const aiResponseContainer = document.getElementById('ai-response-container');
            const aiResponse = document.getElementById('ai-response');
            const aiError = document.getElementById('ai-error');
            const aiErrorMessage = document.getElementById('ai-error-message');
            const refineQueryBtn = document.getElementById('refine-query');
            
            sendQueryBtn.addEventListener('click', handleAIQuery);
            aiQueryInput.addEventListener('keypress', (e) => {
                if (e.key === 'Enter') handleAIQuery();
            });
            
            refineQueryBtn.addEventListener('click', () => {
                aiResponseContainer.classList.add('hidden');
                aiQueryInput.focus();
            });
            
            function handleAIQuery() {
                const query = aiQueryInput.value.trim();
                if (!query) return;
                
                // Show thinking indicator
                aiThinking.classList.remove('hidden');
                aiResponseContainer.classList.add('hidden');
                aiError.classList.add('hidden');
                
                // In a real app, this would be an actual API call to Cloudflare AI Gateway
                // For demo purposes, we'll simulate a response after a delay
                setTimeout(() => {
                    aiThinking.classList.add('hidden');
                    
                    // Simulate success or error randomly
                    if (Math.random() > 0.2) { // 80% chance of success
                        // Generate a plausible AI response
                        const responses = [
                            `Based on your memories, you visited a charming French bistro called "Le Petit Jardin" in Paris on June 15, 2022. The meal included duck confit and a bottle of Bordeaux wine. You mentioned the service was exceptional.`,
                            `Your memory fragments show a restaurant with red awnings and outdoor seating. The name "Chez Marie" appears in one of your photos from that trip. You were there with two friends around 7:30 PM.`,
                            `I found references to a Parisian restaurant in your audio recordings from last year. You described it as having "the best onion soup" and located near the Eiffel Tower. The receipt shows you paid €85 for three people.`
                        ];
                        
                        aiResponse.textContent = responses[Math.floor(Math.random() * responses.length)];
                        aiResponseContainer.classList.remove('hidden');
                    } else {
                        // Simulate error
                        aiErrorMessage.textContent = "Could not connect to AI service. Please try again later.";
                        aiError.classList.remove('hidden');
                    }
                }, 1500 + Math.random() * 2000); // Random delay between 1.5-3.5 seconds
            }
        });
    </script>
<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=privateuserh/aurarecall1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>