rishik1111 commited on
Commit
c2a0864
·
1 Parent(s): edf85c0

feat(ui): redesign frontend with modern cyber-forensic HUD, glassmorphism, and live telemetry

Browse files
Files changed (4) hide show
  1. app/static/app.js +357 -110
  2. app/static/index.html +295 -157
  3. app/static/sample.jpg +0 -0
  4. app/static/styles.css +221 -18
app/static/app.js CHANGED
@@ -1,23 +1,35 @@
1
- // FaceID Retro Terminal Application Controller
2
 
3
  document.addEventListener('DOMContentLoaded', () => {
4
- // UI Element References
 
5
  const fileInput = document.getElementById('file-input');
6
  const previewContainer = document.getElementById('preview-container');
7
  const canvasOverlay = document.getElementById('canvas-overlay');
8
  const targetGraphic = document.getElementById('target-graphic');
 
 
 
 
 
 
 
 
 
 
 
9
  const btnVerify = document.getElementById('btn-verify');
10
  const verifySpinner = document.getElementById('verify-spinner');
11
  const verifyText = document.getElementById('verify-text');
12
- const chkBlockchain = document.getElementById('chk-blockchain');
13
- const btnSample1 = document.getElementById('btn-sample-1');
14
 
15
- // Right Panel Elements
16
  const seaStatusBadge = document.getElementById('sea-status-badge');
17
  const idleScreen = document.getElementById('idle-screen');
18
  const telemetryScreen = document.getElementById('telemetry-screen');
19
  const teleStatus = document.getElementById('tele-status');
20
  const teleScore = document.getElementById('tele-score');
 
 
21
  const teleFaceDetected = document.getElementById('tele-face-detected');
22
  const teleFaceCount = document.getElementById('tele-face-count');
23
  const teleSha = document.getElementById('tele-sha');
@@ -27,128 +39,227 @@ document.addEventListener('DOMContentLoaded', () => {
27
  const teleBcStatus = document.getElementById('tele-bc-status');
28
  const teleBcLink = document.getElementById('tele-bc-link');
29
  const teleCandidates = document.getElementById('tele-candidates');
 
30
  const logLine = document.getElementById('log-line');
31
  const logTime = document.getElementById('log-time');
32
  const btnCopyJson = document.getElementById('btn-copy-json');
 
33
  const jsonViewer = document.getElementById('json-viewer');
34
 
35
- // State
 
 
 
 
 
 
 
 
 
36
  let selectedFile = null;
37
- let base64Snapshot = null;
38
  let currentImageElement = null;
 
39
 
40
- // Timer Update
41
  setInterval(() => {
42
  const now = new Date();
43
  logTime.textContent = now.toTimeString().split(' ')[0];
44
  }, 1000);
45
 
46
- // File Upload Handlers
47
- targetGraphic.addEventListener('click', () => fileInput.click());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  fileInput.addEventListener('change', (e) => {
49
  if (e.target.files && e.target.files[0]) {
50
  handleFileSelect(e.target.files[0]);
51
  }
52
  });
53
 
 
54
  function handleFileSelect(file) {
 
 
 
 
 
55
  selectedFile = file;
56
- base64Snapshot = null;
57
  const reader = new FileReader();
58
- reader.onload = (event) => {
59
- displayPreview(event.target.result);
60
  };
61
  reader.readAsDataURL(file);
62
  }
63
 
64
- function displayPreview(dataUrl) {
65
  const img = new Image();
66
  img.onload = () => {
67
  currentImageElement = img;
 
 
68
  canvasOverlay.width = img.width;
69
  canvasOverlay.height = img.height;
70
  const ctx = canvasOverlay.getContext('2d');
 
71
  ctx.drawImage(img, 0, 0);
72
 
73
  previewContainer.classList.remove('hidden');
74
  targetGraphic.classList.add('hidden');
75
- logLine.textContent = `> IMAGE LOADED: ${img.width}x${img.height} PX. READY FOR SCAN.`;
 
 
 
 
 
 
 
76
  };
77
  img.src = dataUrl;
78
  }
79
 
80
  // Quick Sample Loading
81
- btnSample1.addEventListener('click', async () => {
82
- logLine.textContent = '> LOADING SAMPLE SCAN PROFILE...';
83
  try {
84
- const res = await fetch('/static/sample_preview.jpg');
85
  if (res.ok) {
86
  const blob = await res.blob();
87
- handleFileSelect(new File([blob], 'sample.jpg', { type: 'image/jpeg' }));
88
  } else {
89
- // Generate quick canvas image if sample_preview.jpg is not present
90
- const tempCanvas = document.createElement('canvas');
91
- tempCanvas.width = 400;
92
- tempCanvas.height = 400;
93
- const ctx = tempCanvas.getContext('2d');
94
- ctx.fillStyle = '#F0E6D2';
95
- ctx.fillRect(0, 0, 400, 400);
96
- ctx.fillStyle = '#333';
97
- ctx.beginPath();
98
- ctx.arc(150, 160, 20, 0, Math.PI * 2);
99
- ctx.arc(250, 160, 20, 0, Math.PI * 2);
100
- ctx.fill();
101
- displayPreview(tempCanvas.toDataURL('image/jpeg'));
102
- base64Snapshot = tempCanvas.toDataURL('image/jpeg');
103
  }
104
  } catch (err) {
105
- logLine.textContent = `> ERROR LOADING SAMPLE: ${err.message}`;
 
106
  }
107
  });
108
 
109
- // Verification Pipeline Execution
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  btnVerify.addEventListener('click', async () => {
111
- if (!selectedFile && !base64Snapshot) {
112
- alert('Please select a facial image first.');
113
  return;
114
  }
115
 
116
  setLoading(true);
117
- logLine.textContent = '> EXECUTING LOCAL ARCFACE & REVERSE PROVENANCE SEARCH...';
 
118
  seaStatusBadge.textContent = 'SCANNING...';
119
- seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-amber-400 text-black px-2 py-0.5 uppercase tracking-wider animate-pulse';
120
 
121
  const writeBlockchain = chkBlockchain.checked;
 
122
  const startTime = Date.now();
123
 
124
  try {
125
- let response;
126
- if (selectedFile) {
127
- const formData = new FormData();
128
- formData.append('file', selectedFile);
129
- formData.append('write_blockchain', writeBlockchain);
130
- response = await fetch('/api/verify', { method: 'POST', body: formData });
131
- } else {
132
- response = await fetch('/api/verify-base64', {
133
- method: 'POST',
134
- headers: { 'Content-Type': 'application/json' },
135
- body: JSON.stringify({ image_base64: base64Snapshot, write_blockchain: writeBlockchain }),
136
- });
137
- }
138
 
139
  const data = await response.json();
140
  const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);
141
 
142
  if (response.ok) {
 
143
  renderTelemetry(data, elapsed);
 
144
  } else {
145
  throw new Error(data.detail || 'Verification error');
146
  }
147
  } catch (err) {
148
- logLine.textContent = `> PIPELINE ERROR: ${err.message}`;
 
149
  seaStatusBadge.textContent = 'SCAN ERROR';
150
- seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-red-600 text-white px-2 py-0.5 uppercase tracking-wider';
151
- alert(`Pipeline Error: ${err.message}`);
152
  } finally {
153
  setLoading(false);
154
  }
@@ -158,10 +269,18 @@ document.addEventListener('DOMContentLoaded', () => {
158
  btnVerify.disabled = isLoading;
159
  if (isLoading) {
160
  verifySpinner.classList.remove('hidden');
161
- verifyText.textContent = 'PROCESSING PIPELINE...';
 
 
 
 
162
  } else {
163
  verifySpinner.classList.add('hidden');
164
  verifyText.textContent = 'RUN PROVENANCE VERIFICATION →';
 
 
 
 
165
  }
166
  }
167
 
@@ -170,117 +289,245 @@ document.addEventListener('DOMContentLoaded', () => {
170
  idleScreen.classList.add('hidden');
171
  telemetryScreen.classList.remove('hidden');
172
 
173
- const face = data.face || {};
174
- const img = data.image || {};
175
- const search = data.reverse_search || {};
176
  const v = data.verification || {};
177
  const bc = data.blockchain || {};
 
 
 
 
 
 
 
 
 
 
178
 
179
- // 1. Status Pill
180
  if (v.status === 'VERIFIED') {
181
- seaStatusBadge.textContent = 'PROOF VERIFIED';
182
- seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-emerald-500 text-black px-2 py-0.5 uppercase tracking-wider';
183
- teleStatus.textContent = 'VERIFIED MATCH DETECTED';
184
- teleStatus.className = 'text-sm font-extrabold text-emerald-400 tracking-wider';
 
 
185
  } else {
186
  seaStatusBadge.textContent = 'ORIGINAL UNBOUND';
187
- seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-amber-400 text-black px-2 py-0.5 uppercase tracking-wider';
188
- teleStatus.textContent = 'NO CONFIRMED MATCH (LOCAL ORIGINAL)';
189
- teleStatus.className = 'text-sm font-extrabold text-amber-300 tracking-wider';
 
 
190
  }
191
 
192
- const scorePercent = ((v.best_similarity || 0) * 100).toFixed(1);
193
- teleScore.textContent = `${scorePercent}%`;
 
 
 
 
 
 
 
194
 
195
- // 2. Modules
196
- teleFaceDetected.textContent = `Detected: ${face.detected ? 'YES' : 'NO'}`;
197
- teleFaceCount.textContent = `Faces Found: ${face.count || 0}`;
 
 
198
 
199
- teleSha.textContent = img.sha256 ? img.sha256.substring(0, 20) + '...' : 'N/A';
200
- telePhash.textContent = img.phash || 'N/A';
 
201
 
202
  if (search.error) {
203
- teleSearchCount.textContent = `Error: ${search.error.substring(0, 30)}...`;
 
204
  } else {
205
- teleSearchCount.textContent = `Candidates Found: ${search.count || 0}`;
 
206
  }
207
- teleSearchEngine.textContent = `Engine: ${search.provider || 'Google Lens'}`;
208
 
209
  if (bc.submitted) {
210
- teleBcStatus.textContent = `Status: ANCHORED (${bc.network})`;
211
- teleBcLink.innerHTML = `<a href="${bc.explorer_url}" target="_blank" class="underline text-amber-300 font-bold">Tx: ${bc.tx_hash.substring(0, 14)}... ↗</a>`;
212
  } else {
213
- teleBcStatus.textContent = `Status: NOT SUBMITTED`;
214
- teleBcLink.textContent = `Tx: N/A`;
215
  }
216
 
217
- // 3. Candidate Grid
218
  const matches = data.matches || [];
 
219
  if (matches.length > 0) {
220
- teleCandidates.innerHTML = matches.map(m => `
221
- <div class="border border-emerald-500/40 bg-[#0A2D22] p-2 space-y-1">
222
- <div class="flex items-center justify-between text-[11px] font-bold text-emerald-300">
223
- <span class="truncate max-w-[140px]">${m.title || 'Candidate'}</span>
224
- <span class="text-amber-300 font-mono">${((m.visual_similarity || 0) * 100).toFixed(1)}%</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  </div>
226
- <a href="${m.link}" target="_blank" class="text-[10px] text-emerald-400 underline block truncate">Source Link ↗</a>
227
- </div>
228
- `).join('');
229
  } else {
230
- teleCandidates.innerHTML = `<span class="text-emerald-700 italic text-[11px]">No external candidate matches returned.</span>`;
231
  }
232
 
233
- // 4. Bounding Boxes Overlay
234
- if (currentImageElement && face.face_boxes) {
235
- drawBoundingBoxes(face.face_boxes, face.landmarks);
 
 
236
  }
237
 
238
- // 5. JSON Viewer & Log
239
  jsonViewer.textContent = JSON.stringify(data, null, 2);
240
- logLine.textContent = `> SCAN COMPLETED IN ${elapsed}S. STATUS: ${v.status}`;
241
  }
242
 
 
243
  function drawBoundingBoxes(boxes, landmarks) {
244
  if (!currentImageElement) return;
245
  const ctx = canvasOverlay.getContext('2d');
 
246
  ctx.drawImage(currentImageElement, 0, 0);
247
 
248
  boxes.forEach((box, idx) => {
249
  const [x1, y1, x2, y2] = box;
250
  const width = x2 - x1;
251
  const height = y2 - y1;
 
 
 
 
 
252
 
253
- // Draw thick retro bounding box
254
- ctx.strokeStyle = '#10b981';
255
- ctx.lineWidth = 4;
256
  ctx.strokeRect(x1, y1, width, height);
257
 
258
- ctx.fillStyle = '#10b981';
259
- ctx.fillRect(x1, y1 - 22, 100, 22);
260
- ctx.fillStyle = '#000000';
261
- ctx.font = 'bold 11px JetBrains Mono';
262
- ctx.fillText(`FACE #${idx + 1}`, x1 + 4, y1 - 6);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  });
264
 
 
265
  if (landmarks && landmarks.length > 0) {
266
  landmarks.forEach(kpsGroup => {
267
  kpsGroup.forEach(([x, y]) => {
 
 
 
 
 
 
 
268
  ctx.beginPath();
269
- ctx.arc(x, y, 5, 0, 2 * Math.PI);
270
- ctx.fillStyle = '#fbbf24';
271
  ctx.fill();
272
- ctx.lineWidth = 1.5;
273
- ctx.strokeStyle = '#000000';
274
  ctx.stroke();
275
  });
276
  });
277
  }
278
  }
279
 
280
- // Copy JSON button
281
  btnCopyJson.addEventListener('click', () => {
282
  navigator.clipboard.writeText(jsonViewer.textContent).then(() => {
283
- alert('Provenance JSON audit report copied to clipboard!');
284
  });
285
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  });
 
1
+ // FaceID Cyber-Forensic Terminal Application Controller
2
 
3
  document.addEventListener('DOMContentLoaded', () => {
4
+ // UI Elements
5
+ const dropzone = document.getElementById('dropzone');
6
  const fileInput = document.getElementById('file-input');
7
  const previewContainer = document.getElementById('preview-container');
8
  const canvasOverlay = document.getElementById('canvas-overlay');
9
  const targetGraphic = document.getElementById('target-graphic');
10
+ const scanLaser = document.getElementById('scan-laser');
11
+ const previewTag = document.getElementById('preview-tag');
12
+ const fileMetaBar = document.getElementById('file-meta-bar');
13
+ const fileMetaName = document.getElementById('file-meta-name');
14
+ const fileMetaDim = document.getElementById('file-meta-dim');
15
+
16
+ const thresholdSlider = document.getElementById('threshold-slider');
17
+ const thresholdVal = document.getElementById('threshold-val');
18
+ const chkBlockchain = document.getElementById('chk-blockchain');
19
+ const btnQuickSample = document.getElementById('btn-quick-sample');
20
+ const btnReset = document.getElementById('btn-reset');
21
  const btnVerify = document.getElementById('btn-verify');
22
  const verifySpinner = document.getElementById('verify-spinner');
23
  const verifyText = document.getElementById('verify-text');
 
 
24
 
25
+ // Telemetry & Results Elements
26
  const seaStatusBadge = document.getElementById('sea-status-badge');
27
  const idleScreen = document.getElementById('idle-screen');
28
  const telemetryScreen = document.getElementById('telemetry-screen');
29
  const teleStatus = document.getElementById('tele-status');
30
  const teleScore = document.getElementById('tele-score');
31
+ const gaugeCircle = document.getElementById('gauge-circle');
32
+ const teleDeepfakeBadge = document.getElementById('tele-deepfake-badge');
33
  const teleFaceDetected = document.getElementById('tele-face-detected');
34
  const teleFaceCount = document.getElementById('tele-face-count');
35
  const teleSha = document.getElementById('tele-sha');
 
39
  const teleBcStatus = document.getElementById('tele-bc-status');
40
  const teleBcLink = document.getElementById('tele-bc-link');
41
  const teleCandidates = document.getElementById('tele-candidates');
42
+ const teleCandidateCountBadge = document.getElementById('tele-candidate-count-badge');
43
  const logLine = document.getElementById('log-line');
44
  const logTime = document.getElementById('log-time');
45
  const btnCopyJson = document.getElementById('btn-copy-json');
46
+ const btnCopySha = document.getElementById('btn-copy-sha');
47
  const jsonViewer = document.getElementById('json-viewer');
48
 
49
+ // Stepper elements
50
+ const steps = [
51
+ document.getElementById('step-1'),
52
+ document.getElementById('step-2'),
53
+ document.getElementById('step-3'),
54
+ document.getElementById('step-4'),
55
+ document.getElementById('step-5'),
56
+ ];
57
+
58
+ // State Variables
59
  let selectedFile = null;
 
60
  let currentImageElement = null;
61
+ let stepperInterval = null;
62
 
63
+ // Real-time Clock
64
  setInterval(() => {
65
  const now = new Date();
66
  logTime.textContent = now.toTimeString().split(' ')[0];
67
  }, 1000);
68
 
69
+ // Threshold Slider Listener
70
+ thresholdSlider.addEventListener('input', (e) => {
71
+ const val = parseFloat(e.target.value);
72
+ let label = `${val.toFixed(2)}`;
73
+ if (val >= 0.95) label += ' (Ultra Strict)';
74
+ else if (val >= 0.88) label += ' (Strict)';
75
+ else if (val >= 0.75) label += ' (Standard)';
76
+ else label += ' (Permissive)';
77
+ thresholdVal.textContent = label;
78
+ });
79
+
80
+ // Drag and Drop Handlers
81
+ dropzone.addEventListener('click', () => fileInput.click());
82
+
83
+ ['dragenter', 'dragover'].forEach(eventName => {
84
+ dropzone.addEventListener(eventName, (e) => {
85
+ e.preventDefault();
86
+ e.stopPropagation();
87
+ dropzone.classList.add('drag-active');
88
+ });
89
+ });
90
+
91
+ ['dragleave', 'drop'].forEach(eventName => {
92
+ dropzone.addEventListener(eventName, (e) => {
93
+ e.preventDefault();
94
+ e.stopPropagation();
95
+ dropzone.classList.remove('drag-active');
96
+ });
97
+ });
98
+
99
+ dropzone.addEventListener('drop', (e) => {
100
+ const dt = e.dataTransfer;
101
+ if (dt && dt.files && dt.files.length > 0) {
102
+ handleFileSelect(dt.files[0]);
103
+ }
104
+ });
105
+
106
  fileInput.addEventListener('change', (e) => {
107
  if (e.target.files && e.target.files[0]) {
108
  handleFileSelect(e.target.files[0]);
109
  }
110
  });
111
 
112
+ // File Selection & Display
113
  function handleFileSelect(file) {
114
+ if (!file.type.startsWith('image/')) {
115
+ showToast('Invalid file format. Please upload an image.', 'error');
116
+ return;
117
+ }
118
+
119
  selectedFile = file;
 
120
  const reader = new FileReader();
121
+ reader.onload = (e) => {
122
+ displayPreview(e.target.result, file.name);
123
  };
124
  reader.readAsDataURL(file);
125
  }
126
 
127
+ function displayPreview(dataUrl, fileName = 'image.jpg') {
128
  const img = new Image();
129
  img.onload = () => {
130
  currentImageElement = img;
131
+
132
+ // Set canvas dimensions
133
  canvasOverlay.width = img.width;
134
  canvasOverlay.height = img.height;
135
  const ctx = canvasOverlay.getContext('2d');
136
+ ctx.clearRect(0, 0, img.width, img.height);
137
  ctx.drawImage(img, 0, 0);
138
 
139
  previewContainer.classList.remove('hidden');
140
  targetGraphic.classList.add('hidden');
141
+ fileMetaBar.classList.remove('hidden');
142
+ fileMetaName.textContent = fileName;
143
+ fileMetaDim.textContent = `${img.width} × ${img.height} PX`;
144
+ previewTag.textContent = 'PROBE READY';
145
+ previewTag.className = 'absolute bottom-2 left-2 bg-slate-900/90 backdrop-blur text-emerald-400 font-mono text-[10px] px-2.5 py-1 rounded border border-emerald-500/40';
146
+
147
+ logLine.textContent = `> PROBE LOADED: ${img.width}x${img.height}PX. READY FOR ARCFACE SCAN.`;
148
+ showToast(`Loaded ${fileName} (${img.width}x${img.height})`, 'success');
149
  };
150
  img.src = dataUrl;
151
  }
152
 
153
  // Quick Sample Loading
154
+ btnQuickSample.addEventListener('click', async () => {
155
+ logLine.textContent = '> RETRIEVING BENCHMARK SAMPLE PROBE...';
156
  try {
157
+ const res = await fetch('/static/sample.jpg');
158
  if (res.ok) {
159
  const blob = await res.blob();
160
+ handleFileSelect(new File([blob], 'sample_portrait.jpg', { type: 'image/jpeg' }));
161
  } else {
162
+ throw new Error('Sample file not reachable');
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
  } catch (err) {
165
+ logLine.textContent = `> SAMPLE LOAD ERROR: ${err.message}`;
166
+ showToast('Unable to load sample portrait.', 'error');
167
  }
168
  });
169
 
170
+ // Reset Terminal State
171
+ btnReset.addEventListener('click', () => {
172
+ selectedFile = null;
173
+ currentImageElement = null;
174
+ fileInput.value = '';
175
+ previewContainer.classList.add('hidden');
176
+ targetGraphic.classList.remove('hidden');
177
+ fileMetaBar.classList.add('hidden');
178
+ telemetryScreen.classList.add('hidden');
179
+ idleScreen.classList.remove('hidden');
180
+ seaStatusBadge.textContent = 'AWAITING SCAN';
181
+ seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-slate-800 text-amber-300 border border-amber-500/30 px-2.5 py-0.5 rounded-full uppercase tracking-wider';
182
+ resetStepper();
183
+ logLine.textContent = '> TERMINAL BUFFER CLEARED. AWAITING SCAN COMMAND.';
184
+ showToast('Terminal reset to clean state.', 'info');
185
+ });
186
+
187
+ // Stepper Animation Helpers
188
+ function startStepperAnimation() {
189
+ resetStepper();
190
+ let currentStep = 0;
191
+ stepperInterval = setInterval(() => {
192
+ steps.forEach((s, idx) => {
193
+ if (idx < currentStep) {
194
+ s.className = 'p-1.5 rounded bg-emerald-950/60 border border-emerald-500/60 text-emerald-300 transition-all shadow-[0_0_10px_rgba(16,185,129,0.2)]';
195
+ } else if (idx === currentStep) {
196
+ s.className = 'p-1.5 rounded bg-cyan-900/60 border border-cyan-400 text-cyan-200 animate-pulse transition-all shadow-[0_0_12px_rgba(6,182,212,0.4)]';
197
+ } else {
198
+ s.className = 'p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all';
199
+ }
200
+ });
201
+ currentStep = (currentStep + 1) % steps.length;
202
+ }, 600);
203
+ }
204
+
205
+ function completeStepper() {
206
+ if (stepperInterval) clearInterval(stepperInterval);
207
+ steps.forEach(s => {
208
+ s.className = 'p-1.5 rounded bg-emerald-950/80 border border-emerald-500/70 text-emerald-300 font-bold transition-all';
209
+ });
210
+ }
211
+
212
+ function resetStepper() {
213
+ if (stepperInterval) clearInterval(stepperInterval);
214
+ steps.forEach(s => {
215
+ s.className = 'p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all';
216
+ });
217
+ }
218
+
219
+ // Run Provenance Verification Pipeline
220
  btnVerify.addEventListener('click', async () => {
221
+ if (!selectedFile) {
222
+ showToast('Please select or drop a facial probe image first.', 'warning');
223
  return;
224
  }
225
 
226
  setLoading(true);
227
+ startStepperAnimation();
228
+ logLine.textContent = '> EXECUTING ARCFACE 512-D EXTRACTION & REVERSE PROVENANCE SEARCH...';
229
  seaStatusBadge.textContent = 'SCANNING...';
230
+ seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-cyan-500/20 text-cyan-300 border border-cyan-400 px-2.5 py-0.5 rounded-full uppercase tracking-wider animate-pulse';
231
 
232
  const writeBlockchain = chkBlockchain.checked;
233
+ const threshold = parseFloat(thresholdSlider.value);
234
  const startTime = Date.now();
235
 
236
  try {
237
+ const formData = new FormData();
238
+ formData.append('file', selectedFile);
239
+
240
+ // Pass parameters in query string
241
+ const endpoint = `/api/verify?write_blockchain=${writeBlockchain}&threshold=${threshold}&top_k=10`;
242
+ const response = await fetch(endpoint, {
243
+ method: 'POST',
244
+ body: formData
245
+ });
 
 
 
 
246
 
247
  const data = await response.json();
248
  const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);
249
 
250
  if (response.ok) {
251
+ completeStepper();
252
  renderTelemetry(data, elapsed);
253
+ showToast(`Scan complete in ${elapsed}s: ${data.verification?.status || 'PROCESSED'}`, 'success');
254
  } else {
255
  throw new Error(data.detail || 'Verification error');
256
  }
257
  } catch (err) {
258
+ resetStepper();
259
+ logLine.textContent = `> PIPELINE EXCEPTION: ${err.message}`;
260
  seaStatusBadge.textContent = 'SCAN ERROR';
261
+ seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-rose-500/20 text-rose-300 border border-rose-500/50 px-2.5 py-0.5 rounded-full uppercase tracking-wider';
262
+ showToast(`Pipeline Error: ${err.message}`, 'error');
263
  } finally {
264
  setLoading(false);
265
  }
 
269
  btnVerify.disabled = isLoading;
270
  if (isLoading) {
271
  verifySpinner.classList.remove('hidden');
272
+ verifyText.textContent = 'EXECUTING PROVENANCE ENGINE...';
273
+ scanLaser.classList.remove('hidden');
274
+ dropzone.classList.add('scanning');
275
+ previewTag.textContent = 'SCANNING VECTORS';
276
+ previewTag.className = 'absolute bottom-2 left-2 bg-slate-900/90 backdrop-blur text-cyan-300 font-mono text-[10px] px-2.5 py-1 rounded border border-cyan-400 animate-pulse';
277
  } else {
278
  verifySpinner.classList.add('hidden');
279
  verifyText.textContent = 'RUN PROVENANCE VERIFICATION →';
280
+ scanLaser.classList.add('hidden');
281
+ dropzone.classList.remove('scanning');
282
+ previewTag.textContent = 'ANALYSIS COMPLETE';
283
+ previewTag.className = 'absolute bottom-2 left-2 bg-slate-900/90 backdrop-blur text-emerald-400 font-mono text-[10px] px-2.5 py-1 rounded border border-emerald-500/40';
284
  }
285
  }
286
 
 
289
  idleScreen.classList.add('hidden');
290
  telemetryScreen.classList.remove('hidden');
291
 
292
+ const face = data.face || data.biometrics || {};
293
+ const img = data.image || data.source_image || {};
294
+ const search = data.reverse_search || data.osint_search || {};
295
  const v = data.verification || {};
296
  const bc = data.blockchain || {};
297
+ const df = data.deepfake_analysis || {};
298
+
299
+ // 1. Status & Verdict
300
+ const score = v.best_similarity || 0;
301
+ const scorePercent = (score * 100).toFixed(1);
302
+ teleScore.textContent = `${scorePercent}%`;
303
+
304
+ // Update Circular Gauge (Circumference is 100)
305
+ const offset = Math.max(0, 100 - score * 100);
306
+ gaugeCircle.style.strokeDashoffset = offset;
307
 
 
308
  if (v.status === 'VERIFIED') {
309
+ seaStatusBadge.textContent = 'PROOF VERIFIED ✓';
310
+ seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-emerald-500/20 text-emerald-300 border border-emerald-500/60 px-2.5 py-0.5 rounded-full uppercase tracking-wider shadow-[0_0_12px_rgba(16,185,129,0.3)]';
311
+
312
+ teleStatus.innerHTML = `<span>VERIFIED MATCH DETECTED</span> <span class="text-xs bg-emerald-500/20 text-emerald-300 px-2 py-0.5 rounded border border-emerald-500/40 font-mono">MATCH ✓</span>`;
313
+ teleStatus.className = 'text-lg font-black text-emerald-400 tracking-wide flex items-center gap-2';
314
+ gaugeCircle.setAttribute('class', 'gauge-circle text-emerald-400');
315
  } else {
316
  seaStatusBadge.textContent = 'ORIGINAL UNBOUND';
317
+ seaStatusBadge.className = 'font-mono text-[10px] font-bold bg-amber-500/20 text-amber-300 border border-amber-500/60 px-2.5 py-0.5 rounded-full uppercase tracking-wider shadow-[0_0_12px_rgba(245,158,11,0.3)]';
318
+
319
+ teleStatus.innerHTML = `<span>NO CONFIRMED MATCH</span> <span class="text-xs bg-amber-500/20 text-amber-300 px-2 py-0.5 rounded border border-amber-500/40 font-mono">LOCAL ORIGINAL</span>`;
320
+ teleStatus.className = 'text-lg font-black text-amber-300 tracking-wide flex items-center gap-2';
321
+ gaugeCircle.setAttribute('class', 'gauge-circle text-amber-400');
322
  }
323
 
324
+ // Deepfake / Synthetic Detection Badge
325
+ if (df.is_synthetic) {
326
+ teleDeepfakeBadge.innerHTML = `<span>⚠️ Potential Synthetic / Deepfake (Risk: ${(df.risk_score * 100).toFixed(0)}%)</span>`;
327
+ teleDeepfakeBadge.className = 'inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full bg-rose-500/20 text-rose-300 border border-rose-500/40 text-[10px]';
328
+ } else {
329
+ const conf = df.confidence ? `${(df.confidence * 100).toFixed(0)}% Conf.` : 'High Confidence';
330
+ teleDeepfakeBadge.innerHTML = `<span>🛡️ Authentic / Real Media (${conf})</span>`;
331
+ teleDeepfakeBadge.className = 'inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full bg-emerald-500/15 text-emerald-300 border border-emerald-500/30 text-[10px]';
332
+ }
333
 
334
+ // 2. Modules Telemetry
335
+ const faceDetected = face.detected ? 'True' : 'False';
336
+ teleFaceDetected.innerHTML = `Detected: <span class="${face.detected ? 'text-emerald-300' : 'text-rose-400'} font-bold">${faceDetected}</span>`;
337
+ const detScore = face.det_score ? `(Score: ${(face.det_score * 100).toFixed(1)}%)` : '';
338
+ teleFaceCount.textContent = `Faces Analyzed: ${face.count || face.face_count || 0} ${detScore}`;
339
 
340
+ teleSha.textContent = img.sha256 ? `${img.sha256.substring(0, 18)}...` : '--';
341
+ teleSha.title = img.sha256 || '';
342
+ telePhash.textContent = img.phash || '--';
343
 
344
  if (search.error) {
345
+ teleSearchCount.textContent = `Error: ${search.error.substring(0, 26)}...`;
346
+ teleSearchCount.className = 'text-rose-400 font-bold text-[11px]';
347
  } else {
348
+ teleSearchCount.textContent = `Candidates Found: ${search.count || search.total_candidates || 0}`;
349
+ teleSearchCount.className = 'text-slate-200 font-bold';
350
  }
351
+ teleSearchEngine.textContent = `Engine: ${search.provider || 'Google Lens via SerpApi'}`;
352
 
353
  if (bc.submitted) {
354
+ teleBcStatus.innerHTML = `Status: <span class="text-emerald-400 font-bold">ANCHORED (${bc.network || 'Sepolia'})</span>`;
355
+ teleBcLink.innerHTML = `<a href="${bc.explorer_url}" target="_blank" class="inline-flex items-center gap-1 text-amber-300 hover:text-amber-200 font-bold underline"><span>Tx: ${bc.tx_hash.substring(0, 14)}...</span> <span>↗</span></a>`;
356
  } else {
357
+ teleBcStatus.innerHTML = `Status: <span class="text-slate-500">NOT SUBMITTED (Local Chain Only)</span>`;
358
+ teleBcLink.textContent = `Tx: Local Layer 1`;
359
  }
360
 
361
+ // 3. Candidates Matrix Gallery
362
  const matches = data.matches || [];
363
+ teleCandidateCountBadge.textContent = `${matches.length} MATCHES`;
364
  if (matches.length > 0) {
365
+ teleCandidates.innerHTML = matches.map((m, idx) => {
366
+ const sim = ((m.visual_similarity || m.cosine_similarity || 0) * 100).toFixed(1);
367
+ const platform = m.social_meta?.platform || m.platform || m.source || 'Web';
368
+ const isVerified = m.verified;
369
+ const badgeColor = isVerified
370
+ ? 'bg-emerald-500/20 text-emerald-300 border-emerald-500/40'
371
+ : (sim > 70 ? 'bg-cyan-500/20 text-cyan-300 border-cyan-500/40' : 'bg-slate-800 text-slate-400 border-slate-700');
372
+
373
+ return `
374
+ <div class="rounded-lg border border-slate-800/80 bg-slate-900/60 p-2.5 space-y-1.5 hover:border-slate-700 transition-all">
375
+ <div class="flex items-center justify-between">
376
+ <span class="text-[9px] font-bold px-2 py-0.5 rounded-full border ${badgeColor}">
377
+ ${platform}
378
+ </span>
379
+ <span class="text-[11px] font-bold font-mono ${isVerified ? 'text-emerald-400' : 'text-amber-300'}">${sim}%</span>
380
+ </div>
381
+ <div class="text-[11px] font-semibold text-slate-200 truncate" title="${m.title || ''}">${m.title || 'Visual Candidate Match'}</div>
382
+ <a href="${m.link}" target="_blank" class="text-[10px] text-cyan-400 hover:text-cyan-300 flex items-center gap-1 truncate transition-colors">
383
+ <span class="truncate">${m.link}</span>
384
+ <span>↗</span>
385
+ </a>
386
  </div>
387
+ `;
388
+ }).join('');
 
389
  } else {
390
+ teleCandidates.innerHTML = `<span class="text-slate-500 italic text-[11px] col-span-2 py-3 text-center">No external visual candidate matches returned.</span>`;
391
  }
392
 
393
+ // 4. Draw Facial Landmarks & Bounding Reticles
394
+ const boxes = face.face_boxes || [];
395
+ const landmarks = face.landmarks || [];
396
+ if (currentImageElement && boxes.length > 0) {
397
+ drawBoundingBoxes(boxes, landmarks);
398
  }
399
 
400
+ // 5. JSON Evidence Viewer
401
  jsonViewer.textContent = JSON.stringify(data, null, 2);
402
+ logLine.textContent = `> SCAN COMPLETED IN ${elapsed}S. VERDICT: ${v.status}`;
403
  }
404
 
405
+ // High-Tech Cyber Bounding Box Reticles
406
  function drawBoundingBoxes(boxes, landmarks) {
407
  if (!currentImageElement) return;
408
  const ctx = canvasOverlay.getContext('2d');
409
+ ctx.clearRect(0, 0, currentImageElement.width, currentImageElement.height);
410
  ctx.drawImage(currentImageElement, 0, 0);
411
 
412
  boxes.forEach((box, idx) => {
413
  const [x1, y1, x2, y2] = box;
414
  const width = x2 - x1;
415
  const height = y2 - y1;
416
+ const bracketLen = Math.min(width, height) * 0.22;
417
+
418
+ // Semi-transparent scan fill
419
+ ctx.fillStyle = 'rgba(16, 185, 129, 0.08)';
420
+ ctx.fillRect(x1, y1, width, height);
421
 
422
+ // Reticle Border
423
+ ctx.strokeStyle = 'rgba(16, 185, 129, 0.5)';
424
+ ctx.lineWidth = 1.5;
425
  ctx.strokeRect(x1, y1, width, height);
426
 
427
+ // Glowing Cyber Corner Brackets
428
+ ctx.strokeStyle = '#10B981';
429
+ ctx.lineWidth = 3.5;
430
+
431
+ // Top-Left
432
+ ctx.beginPath();
433
+ ctx.moveTo(x1, y1 + bracketLen);
434
+ ctx.lineTo(x1, y1);
435
+ ctx.lineTo(x1 + bracketLen, y1);
436
+ ctx.stroke();
437
+
438
+ // Top-Right
439
+ ctx.beginPath();
440
+ ctx.moveTo(x2 - bracketLen, y1);
441
+ ctx.lineTo(x2, y1);
442
+ ctx.lineTo(x2, y1 + bracketLen);
443
+ ctx.stroke();
444
+
445
+ // Bottom-Left
446
+ ctx.beginPath();
447
+ ctx.moveTo(x1, y2 - bracketLen);
448
+ ctx.lineTo(x1, y2);
449
+ ctx.lineTo(x1 + bracketLen, y2);
450
+ ctx.stroke();
451
+
452
+ // Bottom-Right
453
+ ctx.beginPath();
454
+ ctx.moveTo(x2 - bracketLen, y2);
455
+ ctx.lineTo(x2, y2);
456
+ ctx.lineTo(x2, y2 - bracketLen);
457
+ ctx.stroke();
458
+
459
+ // Face Header HUD Badge
460
+ const badgeW = Math.min(130, width);
461
+ ctx.fillStyle = '#0F172A';
462
+ ctx.fillRect(x1, Math.max(0, y1 - 22), badgeW, 22);
463
+ ctx.strokeStyle = '#10B981';
464
+ ctx.lineWidth = 1;
465
+ ctx.strokeRect(x1, Math.max(0, y1 - 22), badgeW, 22);
466
+
467
+ ctx.fillStyle = '#10B981';
468
+ ctx.font = 'bold 10px JetBrains Mono';
469
+ ctx.fillText(`#FACE-0${idx + 1} • 512-D`, x1 + 6, Math.max(14, y1 - 7));
470
  });
471
 
472
+ // Glowing Facial Landmarks
473
  if (landmarks && landmarks.length > 0) {
474
  landmarks.forEach(kpsGroup => {
475
  kpsGroup.forEach(([x, y]) => {
476
+ // Outer glow
477
+ ctx.beginPath();
478
+ ctx.arc(x, y, 6, 0, 2 * Math.PI);
479
+ ctx.fillStyle = 'rgba(6, 182, 212, 0.35)';
480
+ ctx.fill();
481
+
482
+ // Core point
483
  ctx.beginPath();
484
+ ctx.arc(x, y, 3, 0, 2 * Math.PI);
485
+ ctx.fillStyle = '#38BDF8';
486
  ctx.fill();
487
+ ctx.lineWidth = 1;
488
+ ctx.strokeStyle = '#FFFFFF';
489
  ctx.stroke();
490
  });
491
  });
492
  }
493
  }
494
 
495
+ // 1-Click Copy Buttons with Non-blocking Toasts
496
  btnCopyJson.addEventListener('click', () => {
497
  navigator.clipboard.writeText(jsonViewer.textContent).then(() => {
498
+ showToast('Audit JSON report copied to clipboard!', 'success');
499
  });
500
  });
501
+
502
+ btnCopySha.addEventListener('click', (e) => {
503
+ e.stopPropagation();
504
+ const fullSha = teleSha.title || teleSha.textContent;
505
+ if (fullSha && fullSha !== '--') {
506
+ navigator.clipboard.writeText(fullSha).then(() => {
507
+ showToast('SHA-256 hash copied to clipboard!', 'success');
508
+ });
509
+ }
510
+ });
511
+
512
+ // Modern Toast Notification Utility
513
+ function showToast(message, type = 'info') {
514
+ const container = document.getElementById('toast-container');
515
+ const toast = document.createElement('div');
516
+ toast.className = 'toast';
517
+
518
+ let icon = 'ℹ️';
519
+ if (type === 'success') icon = '✓';
520
+ else if (type === 'warning') icon = '⚠️';
521
+ else if (type === 'error') icon = '✕';
522
+
523
+ toast.innerHTML = `<span class="font-bold text-emerald-400">${icon}</span><span>${message}</span>`;
524
+ container.appendChild(toast);
525
+
526
+ setTimeout(() => {
527
+ toast.style.opacity = '0';
528
+ toast.style.transform = 'translateY(10px) scale(0.95)';
529
+ toast.style.transition = 'all 0.3s ease';
530
+ setTimeout(() => toast.remove(), 300);
531
+ }, 3200);
532
+ }
533
  });
app/static/index.html CHANGED
@@ -1,234 +1,372 @@
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>FACEID</title>
7
- <!-- Google Fonts: Playfair Display / Cinzel for Retro Serif titles + JetBrains Mono / Space Mono for Terminal -->
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
11
  <script src="https://cdn.tailwindcss.com"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  <link rel="stylesheet" href="/static/styles.css">
13
  </head>
14
- <body class="bg-[#F8F5EC] text-slate-950 font-sans antialiased min-h-screen p-3 sm:p-6 selection:bg-emerald-950 selection:text-emerald-300">
15
 
16
- <!-- Outer Retro Terminal Shell -->
17
- <div class="max-w-7xl mx-auto space-y-4">
 
 
 
18
 
19
- <!-- Header Bar -->
20
- <header class="border-2 border-black bg-[#F2EDE0] p-3 sm:p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
21
- <div class="flex items-center space-x-3">
22
- <div class="w-9 h-9 bg-black text-amber-400 flex items-center justify-center font-mono font-black text-xl rounded-sm shadow-[2px_2px_0px_0px_rgba(0,0,0,0.3)]">
23
- 🛡️
 
 
 
24
  </div>
25
  <div>
26
- <h1 class="font-serif text-xl sm:text-2xl font-extrabold tracking-wider text-black uppercase">FACEID</h1>
27
- <p class="font-mono text-[11px] text-slate-700 tracking-tight font-medium">PRIVACY-PRESERVING IMAGE VERIFICATION & BLOCKCHAIN PROOF</p>
 
 
 
28
  </div>
29
  </div>
30
 
31
- <!-- Tech Stack Telemetry Badges -->
32
  <div class="flex flex-wrap items-center gap-2 font-mono text-[11px]">
33
- <span class="bg-white border border-black px-2.5 py-1 font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] flex items-center space-x-1.5">
34
- <span class="w-2 h-2 rounded-full bg-emerald-500 animate-pulse"></span>
35
- <span>ArcFace 512-d</span>
36
- </span>
37
- <span class="bg-white border border-black px-2.5 py-1 font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
38
- Google Lens via SerpApi
39
- </span>
40
- <span class="bg-white border border-black px-2.5 py-1 font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
41
- Ethereum Sepolia
42
- </span>
 
 
43
  </div>
44
  </header>
45
 
46
- <!-- Subheader Controls & SLA Bar -->
47
- <div class="border-2 border-black bg-[#F2EDE0] p-2.5 sm:p-3 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] flex flex-col md:flex-row items-start md:items-center justify-between gap-3 font-mono text-xs">
48
- <div class="flex items-center space-x-2 flex-wrap">
49
- <span class="font-extrabold text-black uppercase">VERIFICATION MODE:</span>
50
- <span class="px-3 py-1 font-bold bg-black text-white shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">IMAGE FORENSICS</span>
51
- </div>
52
- <div class="flex items-center space-x-4 flex-wrap">
53
- <label class="flex items-center space-x-2 cursor-pointer font-bold select-none bg-white border border-black px-2.5 py-1 shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
54
- <input type="checkbox" id="chk-privacy" checked disabled class="accent-black">
 
 
 
 
55
  <span>Zero-Biometric Exposure (RAM Only)</span>
56
  </label>
57
- <span class="border border-black bg-amber-200 px-2.5 py-1 font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
58
- Target SLA: &lt; 300 ms
 
 
59
  </span>
 
 
 
 
 
 
60
  </div>
61
  </div>
62
 
63
- <!-- Main 2-Column Desktop Grid -->
64
  <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
65
 
66
  <!-- Left Card: THE BIOMETRIC TERMINAL -->
67
- <div class="lg:col-span-5 border-2 border-black bg-white p-5 shadow-[6px_6px_0px_0px_rgba(0,0,0,1)] space-y-5">
68
-
69
- <div class="flex items-center justify-between border-b-2 border-black pb-3">
70
- <h2 class="font-serif text-lg font-black uppercase text-black tracking-wide">THE BIOMETRIC TERMINAL</h2>
71
- <span class="font-mono text-[10px] font-bold bg-black text-white px-2 py-0.5 uppercase tracking-wider">IMAGE SCANNER</span>
72
- </div>
73
-
74
- <!-- Central Geometric Scan Target Box -->
75
- <div class="border-2 border-black bg-[#FAF8F3] p-4 text-center relative overflow-hidden shadow-[3px_3px_0px_0px_rgba(0,0,0,1)]">
76
 
77
- <!-- File Input Hidden -->
78
- <input type="file" id="file-input" accept="image/*" class="hidden">
79
-
80
- <!-- Canvas Preview for Image + Landmark Overlay -->
81
- <div id="preview-container" class="hidden relative w-full h-64 bg-slate-950 border-2 border-black flex items-center justify-center overflow-hidden mb-3">
82
- <canvas id="canvas-overlay" class="max-w-full max-h-full object-contain"></canvas>
 
83
  </div>
84
 
85
- <!-- Default Scanner Graphic (when awaiting image) -->
86
- <div id="target-graphic" class="py-6 space-y-4 cursor-pointer">
87
- <div class="relative w-28 h-28 mx-auto flex items-center justify-center border-2 border-dashed border-black bg-white rounded shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:bg-slate-100 transition-all">
88
- <svg class="w-12 h-12 text-black" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5">
89
- <path stroke-linecap="round" stroke-linejoin="round" d="M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z" />
90
- <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z" />
91
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  </div>
93
- <div class="bg-black text-emerald-400 font-mono text-xs font-extrabold py-1.5 px-3 inline-block uppercase tracking-wider border border-black shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
94
- &gt;&gt;&gt; READY FOR FACIAL SCAN
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  </div>
96
- <p class="text-xs font-mono font-bold text-slate-700">Click to upload image or drop file here</p>
97
  </div>
98
 
99
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
- <!-- Input Action Form & Anchor Checkbox -->
102
- <div class="space-y-3 font-mono text-xs">
103
-
104
- <div class="flex items-center justify-between border-2 border-black p-2 bg-[#F2EDE0] shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
105
- <span class="font-extrabold text-black">ANCHOR ON SEPOLIA CHAIN:</span>
106
- <label class="relative inline-flex items-center cursor-pointer">
107
- <input type="checkbox" id="chk-blockchain" class="sr-only peer">
108
- <div class="w-9 h-5 bg-slate-400 peer-focus:outline-none border-2 border-black rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-black after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-2 after:border-black after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500"></div>
109
- </label>
110
  </div>
111
 
112
- <button id="btn-verify" class="w-full py-3.5 bg-black hover:bg-slate-900 text-amber-300 font-mono font-extrabold text-sm uppercase tracking-wider border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] active:translate-x-0.5 active:translate-y-0.5 transition-all flex items-center justify-center space-x-2">
113
- <span id="verify-spinner" class="hidden animate-spin">⚡</span>
114
- <span id="verify-text">RUN PROVENANCE VERIFICATION →</span>
115
- </button>
116
  </div>
117
 
118
- <!-- Quick Profiles Prompt Bar -->
119
- <div class="pt-3 border-t-2 border-black font-mono text-[11px] space-y-2">
120
- <span class="font-extrabold text-slate-800 uppercase block">💡 QUICK SAMPLE PROFILES:</span>
121
- <div class="flex flex-wrap gap-2">
122
- <button id="btn-sample-1" class="border border-black bg-[#FAF8F3] hover:bg-black hover:text-white px-2.5 py-1 font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] transition-all">
123
- [SAMPLE SCAN PROFILE]
124
- </button>
125
- </div>
126
  </div>
127
 
128
  </div>
129
 
130
  <!-- Right Card: THE SEA LINKS -->
131
- <div class="lg:col-span-7 border-2 border-black bg-white p-5 shadow-[6px_6px_0px_0px_rgba(0,0,0,1)] space-y-5 flex flex-col justify-between">
132
 
133
- <div class="flex items-center justify-between border-b-2 border-black pb-3">
134
- <h2 class="font-serif text-lg font-black uppercase text-black tracking-wide">THE SEA LINKS</h2>
135
- <span id="sea-status-badge" class="font-mono text-[10px] font-bold bg-black text-amber-300 px-2 py-0.5 uppercase tracking-wider">AWAITING SCAN</span>
136
- </div>
137
-
138
- <!-- Dark Emerald Cyber Grid Canvas Area -->
139
- <div id="grid-viewport" class="border-2 border-black bg-[#061A14] min-h-[380px] p-5 text-emerald-400 font-mono relative overflow-hidden shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] flex flex-col justify-between">
140
 
141
- <!-- Grid Background Pattern Layer -->
142
- <div class="absolute inset-0 bg-[linear-gradient(to_right,#09382b_1px,transparent_1px),linear-gradient(to_bottom,#09382b_1px,transparent_1px)] bg-[size:24px_24px] opacity-40"></div>
 
 
 
 
 
 
 
 
143
 
144
- <!-- Idle Screen State -->
145
- <div id="idle-screen" class="relative z-10 my-auto text-center space-y-3 py-12">
146
- <div class="w-12 h-12 mx-auto rounded-full bg-emerald-950 border-2 border-emerald-500/40 flex items-center justify-center text-emerald-400 text-xl shadow-[0_0_15px_rgba(16,185,129,0.3)]">
147
- 👁️
 
 
 
 
 
 
 
 
 
 
 
 
148
  </div>
149
- <h3 class="text-sm font-extrabold uppercase tracking-widest text-emerald-300">AWAITING BIOMETRIC SCAN INPUT</h3>
150
- <p class="text-xs text-emerald-600/90 max-w-md mx-auto leading-relaxed">
151
- Upload a facial image into <span class="text-emerald-300 font-bold">The Biometric Terminal</span> to execute local ArcFace detection, pHash perceptual comparison, and Sepolia blockchain proof verification.
152
- </p>
153
  </div>
154
 
155
- <!-- Active Telemetry Screen (hidden by default) -->
156
- <div id="telemetry-screen" class="hidden relative z-10 space-y-4 text-xs">
157
 
158
- <!-- Status Banner Header -->
159
- <div class="border border-emerald-500/40 bg-[#0A261D] p-3 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 shadow-[2px_2px_0px_0px_rgba(0,0,0,1)]">
160
- <div>
161
- <span class="text-[10px] text-emerald-600 block uppercase">VERIFICATION RESULT:</span>
162
- <span id="tele-status" class="text-sm font-extrabold text-emerald-300 tracking-wider">VERIFIED MATCH</span>
163
- </div>
164
- <div class="text-right">
165
- <span class="text-[10px] text-emerald-600 block uppercase">BEST SIMILARITY SCORE:</span>
166
- <span id="tele-score" class="text-base font-black text-amber-300">0.00%</span>
 
167
  </div>
 
 
 
 
168
  </div>
169
 
170
- <!-- 4 Step Telemetry Modules Grid -->
171
- <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
172
 
173
- <!-- Module 1: Face Detection -->
174
- <div class="border border-emerald-500/30 bg-[#082018] p-3 space-y-1">
175
- <div class="text-[10px] font-bold text-emerald-500 uppercase">1. LOCAL ARCFACE DETECTION</div>
176
- <div id="tele-face-detected" class="text-emerald-300 font-bold">Detected: False</div>
177
- <div id="tele-face-count" class="text-emerald-600">Faces: 0</div>
178
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
- <!-- Module 2: Hashes -->
181
- <div class="border border-emerald-500/30 bg-[#082018] p-3 space-y-1">
182
- <div class="text-[10px] font-bold text-emerald-500 uppercase">2. CRYPTOGRAPHIC FINGERPRINT</div>
183
- <div class="truncate"><span class="text-emerald-600">SHA-256:</span> <span id="tele-sha" class="text-emerald-300 select-all">N/A</span></div>
184
- <div><span class="text-emerald-600">pHash:</span> <span id="tele-phash" class="text-amber-300 select-all">N/A</span></div>
185
  </div>
186
 
187
- <!-- Module 3: Reverse Search -->
188
- <div class="border border-emerald-500/30 bg-[#082018] p-3 space-y-1">
189
- <div class="text-[10px] font-bold text-emerald-500 uppercase">3. GOOGLE LENS REVERSE SCAN</div>
190
- <div id="tele-search-count" class="text-emerald-300 font-bold">Candidates Found: 0</div>
191
- <div id="tele-search-engine" class="text-emerald-600">Engine: SerpApi Google Lens</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  </div>
193
 
194
- <!-- Module 4: Sepolia Blockchain -->
195
- <div class="border border-emerald-500/30 bg-[#082018] p-3 space-y-1">
196
- <div class="text-[10px] font-bold text-emerald-500 uppercase">4. SEPOLIA BLOCKCHAIN ANCHOR</div>
197
- <div id="tele-bc-status" class="text-amber-300 font-bold">Status: NOT SUBMITTED</div>
198
- <div id="tele-bc-link" class="truncate text-emerald-400">Tx: N/A</div>
 
 
 
 
199
  </div>
200
 
201
  </div>
202
 
203
- <!-- Candidates Gallery Grid -->
204
- <div class="border border-emerald-500/30 bg-[#082018] p-3 space-y-2">
205
- <div class="text-[10px] font-bold text-emerald-500 uppercase">REVERSE SEARCH CANDIDATE MATRIX</div>
206
- <div id="tele-candidates" class="grid grid-cols-1 sm:grid-cols-2 gap-2">
207
- <span class="text-emerald-700 italic text-[11px]">No external matches found.</span>
208
- </div>
209
  </div>
210
 
211
  </div>
212
 
213
- <!-- Terminal Log Footer Bar -->
214
- <div class="relative z-10 pt-3 border-t border-emerald-500/30 flex items-center justify-between text-[10px] text-emerald-600 font-mono">
215
- <span id="log-line">> SYSTEM READY. AWAITING SCAN COMMAND.</span>
216
- <span id="log-time">00:00:00</span>
 
 
 
 
 
 
 
 
217
  </div>
218
 
219
  </div>
220
 
221
- <!-- Collapsible JSON Audit Report Box -->
222
- <div class="border-2 border-black bg-[#FAF8F3] p-3 shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] space-y-2">
223
- <div class="flex items-center justify-between font-mono text-xs">
224
- <span class="font-extrabold text-black uppercase">JSON PROVENANCE AUDIT REPORT</span>
225
- <button id="btn-copy-json" class="bg-black text-amber-300 hover:bg-slate-800 px-2 py-0.5 text-[10px] font-bold border border-black shadow-[1px_1px_0px_0px_rgba(0,0,0,1)]">
226
- COPY REPORT JSON
227
- </button>
228
- </div>
229
- <pre id="json-viewer" class="bg-black p-3 text-[10px] font-mono text-emerald-400 border border-black max-h-36 overflow-y-auto select-all">{ "status": "AWAITING_INPUT" }</pre>
230
- </div>
231
-
232
  </div>
233
 
234
  </div>
 
1
  <!DOCTYPE html>
2
+ <html lang="en" class="dark">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>FACEID — Biometric Provenance Engine</title>
7
+ <!-- Fonts: Cinzel & JetBrains Mono & Plus Jakarta Sans -->
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
11
  <script src="https://cdn.tailwindcss.com"></script>
12
+ <script>
13
+ tailwind.config = {
14
+ darkMode: 'class',
15
+ theme: {
16
+ extend: {
17
+ colors: {
18
+ cyber: {
19
+ bg: '#080C14',
20
+ card: '#0F172A',
21
+ emerald: '#10B981',
22
+ cyan: '#06B6D4',
23
+ amber: '#F59E0B',
24
+ rose: '#F43F5E',
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ </script>
31
  <link rel="stylesheet" href="/static/styles.css">
32
  </head>
33
+ <body class="min-h-screen text-slate-100 antialiased p-3 sm:p-6 selection:bg-emerald-500 selection:text-black">
34
 
35
+ <!-- Toast Notification Container -->
36
+ <div id="toast-container"></div>
37
+
38
+ <!-- Main Outer Container -->
39
+ <div class="max-w-7xl mx-auto space-y-5">
40
 
41
+ <!-- Header HUD Bar -->
42
+ <header class="glass-panel rounded-2xl p-4 sm:p-5 flex flex-col md:flex-row items-start md:items-center justify-between gap-4 border border-slate-800">
43
+ <div class="flex items-center space-x-3.5">
44
+ <div class="relative w-11 h-11 rounded-xl bg-gradient-to-br from-emerald-500/20 to-cyan-500/10 border border-emerald-500/40 flex items-center justify-center text-emerald-400 text-xl shadow-[0_0_20px_rgba(16,185,129,0.25)]">
45
+ <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
46
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
47
+ </svg>
48
+ <span class="absolute -top-1 -right-1 w-2.5 h-2.5 rounded-full bg-emerald-400 animate-ping"></span>
49
  </div>
50
  <div>
51
+ <div class="flex items-center space-x-2">
52
+ <h1 class="font-display text-2xl sm:text-3xl font-black tracking-wider text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 via-teal-300 to-cyan-400">FACEID</h1>
53
+ <span class="font-mono text-[10px] font-bold bg-emerald-500/10 text-emerald-400 border border-emerald-500/30 px-2 py-0.5 rounded-full uppercase tracking-wider">v2.0 HUD</span>
54
+ </div>
55
+ <p class="font-mono text-[11px] text-slate-400 tracking-tight font-medium">DECENTRALIZED BIOMETRIC PROVENANCE & FORENSIC ARCFACE ENGINE</p>
56
  </div>
57
  </div>
58
 
59
+ <!-- Live Status Telemetry Badges -->
60
  <div class="flex flex-wrap items-center gap-2 font-mono text-[11px]">
61
+ <div class="px-3 py-1.5 rounded-lg bg-slate-900/80 border border-emerald-500/30 text-emerald-300 flex items-center space-x-2 shadow-sm">
62
+ <span class="w-2 h-2 rounded-full bg-emerald-400 animate-pulse"></span>
63
+ <span>Sepolia Node: Connected</span>
64
+ </div>
65
+ <div class="px-3 py-1.5 rounded-lg bg-slate-900/80 border border-cyan-500/30 text-cyan-300 flex items-center space-x-2 shadow-sm">
66
+ <span class="w-2 h-2 rounded-full bg-cyan-400"></span>
67
+ <span>ArcFace: 512-d (ONNX)</span>
68
+ </div>
69
+ <div class="px-3 py-1.5 rounded-lg bg-slate-900/80 border border-amber-500/30 text-amber-300 flex items-center space-x-2 shadow-sm">
70
+ <span class="w-2 h-2 rounded-full bg-amber-400"></span>
71
+ <span>Google Lens OSINT</span>
72
+ </div>
73
  </div>
74
  </header>
75
 
76
+ <!-- Subheader Controls & SLA Status Bar -->
77
+ <div class="glass-panel rounded-xl p-3 flex flex-col md:flex-row items-start md:items-center justify-between gap-3 font-mono text-xs border border-slate-800">
78
+ <div class="flex items-center space-x-3 flex-wrap">
79
+ <span class="font-extrabold text-slate-400 uppercase flex items-center gap-1.5">
80
+ <span class="inline-block w-1.5 h-3 bg-emerald-400 rounded-sm"></span>
81
+ MODE:
82
+ </span>
83
+ <span class="px-3 py-1 font-bold bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 rounded-md text-[11px] tracking-wide">
84
+ IMAGE FORENSICS & POE
85
+ </span>
86
+ <span class="text-slate-500">|</span>
87
+ <label class="flex items-center space-x-2 cursor-pointer font-medium select-none text-slate-300 hover:text-white transition-colors">
88
+ <input type="checkbox" id="chk-privacy" checked disabled class="accent-emerald-500 rounded">
89
  <span>Zero-Biometric Exposure (RAM Only)</span>
90
  </label>
91
+ </div>
92
+ <div class="flex items-center space-x-3 flex-wrap">
93
+ <span class="px-3 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-300 font-semibold text-[11px]">
94
+ ⚡ Target SLA: &lt; 300 ms
95
  </span>
96
+ <button id="btn-quick-sample" class="px-3 py-1 rounded-md bg-slate-800 hover:bg-slate-700 text-slate-200 hover:text-white border border-slate-700 transition-all text-[11px] flex items-center gap-1">
97
+ <span>💡 Load Sample Face</span>
98
+ </button>
99
+ <button id="btn-reset" class="px-3 py-1 rounded-md bg-slate-800/80 hover:bg-rose-950/40 text-slate-400 hover:text-rose-300 border border-slate-700 hover:border-rose-500/40 transition-all text-[11px]">
100
+ Reset
101
+ </button>
102
  </div>
103
  </div>
104
 
105
+ <!-- 2-Column Main Workspace Grid -->
106
  <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
107
 
108
  <!-- Left Card: THE BIOMETRIC TERMINAL -->
109
+ <div class="lg:col-span-5 glass-panel rounded-2xl p-5 space-y-5 border border-slate-800 flex flex-col justify-between">
110
+ <div class="space-y-4">
 
 
 
 
 
 
 
111
 
112
+ <!-- Title Bar -->
113
+ <div class="flex items-center justify-between border-b border-slate-800 pb-3">
114
+ <div class="flex items-center space-x-2">
115
+ <span class="w-2.5 h-2.5 rounded-full bg-emerald-400"></span>
116
+ <h2 class="font-display text-lg font-black uppercase text-slate-100 tracking-wide">THE BIOMETRIC TERMINAL</h2>
117
+ </div>
118
+ <span class="font-mono text-[10px] font-bold bg-slate-800 text-emerald-400 border border-emerald-500/30 px-2.5 py-0.5 rounded-full uppercase tracking-wider">IMAGE SCANNER</span>
119
  </div>
120
 
121
+ <!-- Central Scan Target Viewport -->
122
+ <div id="dropzone" class="dropzone relative rounded-xl border-2 border-dashed border-slate-700 bg-slate-950/60 p-4 text-center overflow-hidden transition-all duration-300 min-h-[290px] flex flex-col items-center justify-center cursor-pointer group hover:border-emerald-500/60">
123
+
124
+ <!-- HUD Corner Target Accents -->
125
+ <div class="hud-corner hud-tl"></div>
126
+ <div class="hud-corner hud-tr"></div>
127
+ <div class="hud-corner hud-bl"></div>
128
+ <div class="hud-corner hud-br"></div>
129
+
130
+ <!-- Animated Laser Scanner Sweep (active during verification) -->
131
+ <div id="scan-laser" class="scan-laser hidden"></div>
132
+
133
+ <!-- Hidden File Input -->
134
+ <input type="file" id="file-input" accept="image/*" class="hidden">
135
+
136
+ <!-- Canvas Image Preview + Landmark Reticles -->
137
+ <div id="preview-container" class="hidden relative w-full h-64 bg-slate-950 rounded-lg flex items-center justify-center overflow-hidden">
138
+ <canvas id="canvas-overlay" class="max-w-full max-h-full object-contain rounded"></canvas>
139
+ <div id="preview-tag" class="absolute bottom-2 left-2 bg-slate-900/90 backdrop-blur text-emerald-400 font-mono text-[10px] px-2.5 py-1 rounded border border-emerald-500/40">
140
+ PROBE READY
141
+ </div>
142
  </div>
143
+
144
+ <!-- Default Empty Target Graphic -->
145
+ <div id="target-graphic" class="py-8 space-y-4">
146
+ <div class="w-20 h-20 mx-auto rounded-2xl bg-slate-900 border border-slate-700/80 flex items-center justify-center text-slate-400 group-hover:text-emerald-400 group-hover:border-emerald-500/50 group-hover:scale-105 transition-all shadow-inner">
147
+ <svg class="w-10 h-10" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="1.5">
148
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z" />
149
+ <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z" />
150
+ </svg>
151
+ </div>
152
+ <div>
153
+ <div class="font-mono text-xs font-bold text-emerald-400 uppercase tracking-wider mb-1">
154
+ &gt;&gt; DRAG & DROP OR CLICK TO UPLOAD
155
+ </div>
156
+ <p class="text-[11px] font-mono text-slate-500">Supports PNG, JPG, WEBP • Max 20MB</p>
157
+ </div>
158
  </div>
159
+
160
  </div>
161
 
162
+ <!-- Image Metadata Tag (when image loaded) -->
163
+ <div id="file-meta-bar" class="hidden font-mono text-[11px] px-3 py-2 rounded-lg bg-slate-900/80 border border-slate-800 flex items-center justify-between text-slate-400">
164
+ <span id="file-meta-name" class="truncate max-w-[220px] text-slate-200 font-semibold">image.jpg</span>
165
+ <span id="file-meta-dim" class="text-emerald-400">-- x -- PX</span>
166
+ </div>
167
+
168
+ <!-- Investigative Tuning Options (Collapsible Details) -->
169
+ <div class="rounded-xl border border-slate-800 bg-slate-950/40 p-3.5 space-y-3 font-mono text-xs">
170
+
171
+ <!-- Blockchain Anchor Switch -->
172
+ <div class="flex items-center justify-between">
173
+ <div class="flex items-center space-x-2">
174
+ <span class="text-slate-300 font-bold">ANCHOR ON SEPOLIA CHAIN</span>
175
+ <span class="text-[10px] text-slate-500">(PoE Calldata)</span>
176
+ </div>
177
+ <label class="relative inline-flex items-center cursor-pointer">
178
+ <input type="checkbox" id="chk-blockchain" class="sr-only peer" checked>
179
+ <div class="w-10 h-5 bg-slate-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500"></div>
180
+ </label>
181
+ </div>
182
+
183
+ <!-- Cosine Threshold Slider -->
184
+ <div class="space-y-1 pt-2 border-t border-slate-800/80">
185
+ <div class="flex items-center justify-between text-[11px]">
186
+ <span class="text-slate-400">Similarity Threshold:</span>
187
+ <span id="threshold-val" class="text-emerald-400 font-bold">0.90 (Strict)</span>
188
+ </div>
189
+ <input type="range" id="threshold-slider" min="0.50" max="0.99" step="0.01" value="0.90" class="w-full h-1.5 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-emerald-400">
190
+ </div>
191
 
 
 
 
 
 
 
 
 
 
192
  </div>
193
 
 
 
 
 
194
  </div>
195
 
196
+ <!-- Run Verification Action Button -->
197
+ <div class="pt-2">
198
+ <button id="btn-verify" class="w-full btn-cyber-primary py-4 rounded-xl text-black font-mono font-black text-sm uppercase tracking-wider flex items-center justify-center space-x-2">
199
+ <span id="verify-spinner" class="hidden animate-spin text-lg">⚡</span>
200
+ <span id="verify-text">RUN PROVENANCE VERIFICATION →</span>
201
+ </button>
 
 
202
  </div>
203
 
204
  </div>
205
 
206
  <!-- Right Card: THE SEA LINKS -->
207
+ <div class="lg:col-span-7 glass-panel rounded-2xl p-5 space-y-5 border border-slate-800 flex flex-col justify-between">
208
 
209
+ <div class="space-y-4">
 
 
 
 
 
 
210
 
211
+ <!-- Title Bar -->
212
+ <div class="flex items-center justify-between border-b border-slate-800 pb-3">
213
+ <div class="flex items-center space-x-2">
214
+ <span class="w-2.5 h-2.5 rounded-full bg-cyan-400"></span>
215
+ <h2 class="font-display text-lg font-black uppercase text-slate-100 tracking-wide">THE SEA LINKS</h2>
216
+ </div>
217
+ <span id="sea-status-badge" class="font-mono text-[10px] font-bold bg-slate-800 text-amber-300 border border-amber-500/30 px-2.5 py-0.5 rounded-full uppercase tracking-wider">
218
+ AWAITING SCAN
219
+ </span>
220
+ </div>
221
 
222
+ <!-- Pipeline Stage Progress Stepper (Animated during scan) -->
223
+ <div id="pipeline-stepper" class="grid grid-cols-5 gap-1 font-mono text-[10px] text-center">
224
+ <div id="step-1" class="p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all">
225
+ 1. ArcFace
226
+ </div>
227
+ <div id="step-2" class="p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all">
228
+ 2. Hashes
229
+ </div>
230
+ <div id="step-3" class="p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all">
231
+ 3. OSINT Lens
232
+ </div>
233
+ <div id="step-4" class="p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all">
234
+ 4. Deepfake
235
+ </div>
236
+ <div id="step-5" class="p-1.5 rounded bg-slate-900 border border-slate-800 text-slate-500 transition-all">
237
+ 5. Sepolia PoE
238
  </div>
 
 
 
 
239
  </div>
240
 
241
+ <!-- Viewport Canvas Area -->
242
+ <div id="grid-viewport" class="relative rounded-xl border border-slate-800/80 bg-[#060D1A] min-h-[360px] p-5 overflow-hidden flex flex-col justify-between shadow-inner">
243
 
244
+ <!-- Cyber Grid Canvas Overlay -->
245
+ <div class="absolute inset-0 bg-[linear-gradient(to_right,#0B1B36_1px,transparent_1px),linear-gradient(to_bottom,#0B1B36_1px,transparent_1px)] bg-[size:24px_24px] opacity-40 pointer-events-none"></div>
246
+
247
+ <!-- Idle Screen State -->
248
+ <div id="idle-screen" class="relative z-10 my-auto text-center space-y-3 py-12">
249
+ <div class="w-14 h-14 mx-auto rounded-2xl bg-slate-900/80 border border-cyan-500/30 flex items-center justify-center text-cyan-400 text-2xl shadow-[0_0_20px_rgba(6,182,212,0.15)]">
250
+ <svg class="w-7 h-7 animate-pulse" fill="none" stroke="currentColor" viewBox="0 0 24 24">
251
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
252
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
253
+ </svg>
254
  </div>
255
+ <h3 class="font-mono text-sm font-extrabold uppercase tracking-widest text-cyan-300">AWAITING BIOMETRIC SCAN INPUT</h3>
256
+ <p class="text-xs text-slate-400 max-w-md mx-auto leading-relaxed font-sans">
257
+ Upload a portrait to execute local ArcFace 512-D embedding extraction, reverse Google Lens OSINT matching, synthetic media verification, and immutable Sepolia Ethereum proof anchoring.
258
+ </p>
259
  </div>
260
 
261
+ <!-- Active Telemetry Screen (Populated after verification) -->
262
+ <div id="telemetry-screen" class="hidden relative z-10 space-y-4 font-mono text-xs">
263
 
264
+ <!-- Hero Match Verdict & Radial Gauge Header -->
265
+ <div class="rounded-xl border border-slate-700/80 bg-slate-900/90 p-4 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 shadow-lg backdrop-blur">
266
+
267
+ <div class="space-y-1">
268
+ <span class="text-[10px] text-slate-400 block uppercase tracking-wider">VERIFICATION VERDICT:</span>
269
+ <div id="tele-status" class="text-lg font-black text-emerald-400 tracking-wide flex items-center gap-2">
270
+ VERIFIED MATCH
271
+ </div>
272
+ <div id="tele-deepfake-badge" class="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full bg-emerald-500/10 text-emerald-300 border border-emerald-500/30 text-[10px]">
273
+ <span>🛡️ Authentic / Real Media</span>
274
+ </div>
275
+ </div>
276
+
277
+ <!-- Circular Match Score Gauge -->
278
+ <div class="flex items-center space-x-3">
279
+ <div class="relative w-16 h-16 flex items-center justify-center">
280
+ <svg class="w-full h-full transform -rotate-90" viewBox="0 0 36 36">
281
+ <path class="text-slate-800" stroke-width="3" stroke="currentColor" fill="none" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831" />
282
+ <path id="gauge-circle" class="gauge-circle text-emerald-400" stroke-dasharray="100, 100" stroke-dashoffset="100" stroke-width="3" stroke-linecap="round" stroke="currentColor" fill="none" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831" />
283
+ </svg>
284
+ <span id="tele-score" class="absolute font-mono text-xs font-black text-slate-100">0.0%</span>
285
+ </div>
286
+ <div class="text-left">
287
+ <span class="text-[10px] text-slate-400 block uppercase">SIMILARITY</span>
288
+ <span class="text-[11px] text-slate-200 font-bold">COSINE METRIC</span>
289
+ </div>
290
+ </div>
291
 
 
 
 
 
 
292
  </div>
293
 
294
+ <!-- 4 Telemetry Modules Grid -->
295
+ <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
296
+
297
+ <!-- Module 1: Face Detection -->
298
+ <div class="glass-card rounded-xl p-3.5 space-y-1.5">
299
+ <div class="text-[10px] font-bold text-emerald-400 uppercase tracking-wider flex items-center justify-between">
300
+ <span>1. LOCAL ARCFACE BIOMETRICS</span>
301
+ <span class="text-slate-500">512-D</span>
302
+ </div>
303
+ <div id="tele-face-detected" class="text-slate-200 font-bold">Detected: True</div>
304
+ <div id="tele-face-count" class="text-slate-400 text-[11px]">Faces Analyzed: 1 (Det: 94.2%)</div>
305
+ </div>
306
+
307
+ <!-- Module 2: Hashes -->
308
+ <div class="glass-card rounded-xl p-3.5 space-y-1.5">
309
+ <div class="text-[10px] font-bold text-cyan-400 uppercase tracking-wider flex items-center justify-between">
310
+ <span>2. CRYPTOGRAPHIC FINGERPRINT</span>
311
+ <button id="btn-copy-sha" class="text-[9px] text-slate-400 hover:text-cyan-300">COPY</button>
312
+ </div>
313
+ <div class="truncate text-[11px]"><span class="text-slate-500">SHA-256:</span> <span id="tele-sha" class="text-cyan-300 select-all font-mono">--</span></div>
314
+ <div class="text-[11px]"><span class="text-slate-500">pHash:</span> <span id="tele-phash" class="text-amber-300 font-mono">--</span></div>
315
+ </div>
316
+
317
+ <!-- Module 3: Reverse Search -->
318
+ <div class="glass-card rounded-xl p-3.5 space-y-1.5">
319
+ <div class="text-[10px] font-bold text-amber-400 uppercase tracking-wider">3. GOOGLE LENS OSINT SEARCH</div>
320
+ <div id="tele-search-count" class="text-slate-200 font-bold">Candidates Found: 0</div>
321
+ <div id="tele-search-engine" class="text-slate-400 text-[11px]">Engine: Google Lens via SerpApi</div>
322
+ </div>
323
+
324
+ <!-- Module 4: Sepolia Blockchain -->
325
+ <div class="glass-card rounded-xl p-3.5 space-y-1.5">
326
+ <div class="text-[10px] font-bold text-emerald-400 uppercase tracking-wider">4. SEPOLIA BLOCKCHAIN ANCHOR</div>
327
+ <div id="tele-bc-status" class="text-amber-300 font-bold">Status: ANCHORED</div>
328
+ <div id="tele-bc-link" class="truncate text-[11px] text-slate-400">Tx: N/A</div>
329
+ </div>
330
+
331
  </div>
332
 
333
+ <!-- Candidates Gallery Grid -->
334
+ <div class="glass-card rounded-xl p-3.5 space-y-2.5">
335
+ <div class="flex items-center justify-between">
336
+ <div class="text-[10px] font-bold text-slate-300 uppercase tracking-wider">REVERSE SEARCH CANDIDATE MATRIX</div>
337
+ <span id="tele-candidate-count-badge" class="text-[10px] text-slate-500 font-mono">0 MATCHES</span>
338
+ </div>
339
+ <div id="tele-candidates" class="grid grid-cols-1 sm:grid-cols-2 gap-2.5 max-h-48 overflow-y-auto pr-1">
340
+ <span class="text-slate-500 italic text-[11px]">No external matches found.</span>
341
+ </div>
342
  </div>
343
 
344
  </div>
345
 
346
+ <!-- Terminal Log Footer Bar -->
347
+ <div class="relative z-10 pt-3 border-t border-slate-800/80 flex items-center justify-between text-[11px] text-slate-400 font-mono">
348
+ <span id="log-line">&gt; SYSTEM ONLINE. READY FOR PROVENANCE SCAN.</span>
349
+ <span id="log-time" class="text-emerald-400 font-bold">00:00:00</span>
 
 
350
  </div>
351
 
352
  </div>
353
 
354
+ <!-- Collapsible JSON Audit Report Box -->
355
+ <div class="rounded-xl border border-slate-800 bg-slate-950/60 p-3.5 space-y-2.5">
356
+ <div class="flex items-center justify-between font-mono text-xs">
357
+ <div class="flex items-center space-x-2">
358
+ <span class="text-emerald-400 font-bold">{ }</span>
359
+ <span class="font-bold text-slate-300 uppercase">JSON PROVENANCE AUDIT REPORT</span>
360
+ </div>
361
+ <button id="btn-copy-json" class="px-3 py-1 rounded-md bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white border border-slate-700 text-[10px] font-semibold transition-all">
362
+ 📋 COPY REPORT JSON
363
+ </button>
364
+ </div>
365
+ <pre id="json-viewer" class="bg-slate-900/90 p-3 rounded-lg text-[10px] font-mono text-emerald-400/90 border border-slate-800 max-h-36 overflow-y-auto select-all">{ "status": "AWAITING_INPUT" }</pre>
366
  </div>
367
 
368
  </div>
369
 
 
 
 
 
 
 
 
 
 
 
 
370
  </div>
371
 
372
  </div>
app/static/sample.jpg ADDED
app/static/styles.css CHANGED
@@ -1,16 +1,155 @@
1
- /* FaceID Retro-Brutalist Terminal Stylesheet */
2
 
3
- @keyframes spin-slow {
4
- from {
5
- transform: rotate(0deg);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
7
- to {
8
- transform: rotate(360deg);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
 
12
- .animate-spin-slow {
13
- animation: spin-slow 30s linear infinite;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
 
16
  /* Custom Scrollbars */
@@ -19,24 +158,88 @@
19
  height: 6px;
20
  }
21
  ::-webkit-scrollbar-track {
22
- background: #000000;
23
  }
24
  ::-webkit-scrollbar-thumb {
25
- background: #10b981;
26
- border-radius: 0px;
27
  }
28
  ::-webkit-scrollbar-thumb:hover {
29
- background: #fbbf24;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
 
32
- /* Brutalist Button Active Press Effect */
33
- button:active {
34
- transform: translate(2px, 2px);
35
- box-shadow: 1px 1px 0px 0px rgba(0,0,0,1) !important;
 
36
  }
37
 
38
  /* Custom Selection Highlight */
39
  ::selection {
40
- background-color: #000000;
41
- color: #34d399;
42
  }
 
1
+ /* FaceID Cyber-Forensic Terminal Stylesheet */
2
 
3
+ @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
4
+
5
+ :root {
6
+ --bg-dark: #080C14;
7
+ --card-bg: rgba(15, 23, 42, 0.72);
8
+ --border-subtle: rgba(51, 65, 85, 0.6);
9
+ --accent-emerald: #10B981;
10
+ --accent-cyan: #06B6D4;
11
+ --accent-amber: #F59E0B;
12
+ --accent-rose: #F43F5E;
13
+ }
14
+
15
+ body {
16
+ background-color: var(--bg-dark);
17
+ background-image:
18
+ radial-gradient(ellipse at 15% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
19
+ radial-gradient(ellipse at 85% 100%, rgba(6, 182, 212, 0.07) 0%, transparent 50%),
20
+ radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 0.6) 0%, transparent 100%);
21
+ background-attachment: fixed;
22
+ font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
23
+ color: #F1F5F9;
24
+ }
25
+
26
+ .font-mono {
27
+ font-family: 'JetBrains Mono', monospace;
28
+ }
29
+
30
+ .font-display {
31
+ font-family: 'Cinzel', serif;
32
+ }
33
+
34
+ /* Glassmorphism Surface */
35
+ .glass-panel {
36
+ background: rgba(15, 23, 42, 0.75);
37
+ backdrop-filter: blur(16px);
38
+ -webkit-backdrop-filter: blur(16px);
39
+ border: 1px solid rgba(51, 65, 85, 0.6);
40
+ box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
41
+ }
42
+
43
+ .glass-card {
44
+ background: rgba(11, 19, 36, 0.8);
45
+ backdrop-filter: blur(12px);
46
+ -webkit-backdrop-filter: blur(12px);
47
+ border: 1px solid rgba(51, 65, 85, 0.5);
48
+ box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
49
+ transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
50
+ }
51
+
52
+ .glass-card:hover {
53
+ border-color: rgba(16, 185, 129, 0.4);
54
+ transform: translateY(-2px);
55
+ box-shadow: 0 8px 25px -4px rgba(16, 185, 129, 0.15);
56
+ }
57
+
58
+ /* Laser Scanner Sweep Animation */
59
+ @keyframes laser-sweep {
60
+ 0% {
61
+ top: 0%;
62
+ opacity: 0.9;
63
  }
64
+ 50% {
65
+ opacity: 1;
66
+ }
67
+ 100% {
68
+ top: 100%;
69
+ opacity: 0.9;
70
+ }
71
+ }
72
+
73
+ .scan-laser {
74
+ position: absolute;
75
+ left: 0;
76
+ right: 0;
77
+ height: 3px;
78
+ background: linear-gradient(90deg, transparent 0%, rgba(6, 182, 212, 0.9) 20%, #10B981 50%, rgba(6, 182, 212, 0.9) 80%, transparent 100%);
79
+ box-shadow: 0 0 15px 3px rgba(16, 185, 129, 0.8), 0 0 30px 6px rgba(6, 182, 212, 0.5);
80
+ animation: laser-sweep 2.2s ease-in-out infinite alternate;
81
+ pointer-events: none;
82
+ z-index: 25;
83
+ }
84
+
85
+ /* Radar Pulse / Ping Animation */
86
+ @keyframes radar-pulse {
87
+ 0% {
88
+ transform: scale(0.95);
89
+ opacity: 0.8;
90
+ }
91
+ 70% {
92
+ transform: scale(1.05);
93
+ opacity: 0;
94
  }
95
+ 100% {
96
+ transform: scale(0.95);
97
+ opacity: 0;
98
+ }
99
+ }
100
+
101
+ .radar-ping {
102
+ animation: radar-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
103
+ }
104
+
105
+ /* HUD Corner Brackets for Scanner Target */
106
+ .hud-corner {
107
+ position: absolute;
108
+ width: 14px;
109
+ height: 14px;
110
+ border-color: #10B981;
111
+ pointer-events: none;
112
+ z-index: 20;
113
+ transition: all 0.3s ease;
114
  }
115
 
116
+ .hud-tl {
117
+ top: 10px;
118
+ left: 10px;
119
+ border-top: 2px solid #10B981;
120
+ border-left: 2px solid #10B981;
121
+ }
122
+
123
+ .hud-tr {
124
+ top: 10px;
125
+ right: 10px;
126
+ border-top: 2px solid #10B981;
127
+ border-right: 2px solid #10B981;
128
+ }
129
+
130
+ .hud-bl {
131
+ bottom: 10px;
132
+ left: 10px;
133
+ border-bottom: 2px solid #10B981;
134
+ border-left: 2px solid #10B981;
135
+ }
136
+
137
+ .hud-br {
138
+ bottom: 10px;
139
+ right: 10px;
140
+ border-bottom: 2px solid #10B981;
141
+ border-right: 2px solid #10B981;
142
+ }
143
+
144
+ .scanning .hud-corner {
145
+ border-color: #06B6D4;
146
+ width: 20px;
147
+ height: 20px;
148
+ }
149
+
150
+ /* Circular Gauge Animation */
151
+ .gauge-circle {
152
+ transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
153
  }
154
 
155
  /* Custom Scrollbars */
 
158
  height: 6px;
159
  }
160
  ::-webkit-scrollbar-track {
161
+ background: #0B1120;
162
  }
163
  ::-webkit-scrollbar-thumb {
164
+ background: #1E293B;
165
+ border-radius: 9999px;
166
  }
167
  ::-webkit-scrollbar-thumb:hover {
168
+ background: #10B981;
169
+ }
170
+
171
+ /* Toast Notifications */
172
+ #toast-container {
173
+ position: fixed;
174
+ bottom: 24px;
175
+ right: 24px;
176
+ z-index: 100;
177
+ display: flex;
178
+ flex-direction: column;
179
+ gap: 8px;
180
+ pointer-events: none;
181
+ }
182
+
183
+ .toast {
184
+ pointer-events: auto;
185
+ background: rgba(15, 23, 42, 0.95);
186
+ backdrop-filter: blur(12px);
187
+ border: 1px solid rgba(16, 185, 129, 0.4);
188
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.2);
189
+ color: #F1F5F9;
190
+ padding: 12px 18px;
191
+ border-radius: 10px;
192
+ font-family: 'JetBrains Mono', monospace;
193
+ font-size: 12px;
194
+ display: flex;
195
+ align-items: center;
196
+ gap: 10px;
197
+ animation: toast-slide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
198
+ }
199
+
200
+ @keyframes toast-slide {
201
+ from {
202
+ opacity: 0;
203
+ transform: translateY(20px) scale(0.95);
204
+ }
205
+ to {
206
+ opacity: 1;
207
+ transform: translateY(0) scale(1);
208
+ }
209
+ }
210
+
211
+ /* Glowing Button Hover Effects */
212
+ .btn-cyber-primary {
213
+ background: linear-gradient(135deg, #10B981 0%, #0D9488 50%, #06B6D4 100%);
214
+ box-shadow: 0 0 20px -2px rgba(16, 185, 129, 0.4);
215
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
216
+ }
217
+
218
+ .btn-cyber-primary:hover:not(:disabled) {
219
+ box-shadow: 0 0 30px 2px rgba(16, 185, 129, 0.6), 0 0 15px rgba(6, 182, 212, 0.4);
220
+ transform: translateY(-1px);
221
+ filter: brightness(1.1);
222
+ }
223
+
224
+ .btn-cyber-primary:active:not(:disabled) {
225
+ transform: translateY(1px);
226
+ }
227
+
228
+ .btn-cyber-primary:disabled {
229
+ opacity: 0.6;
230
+ cursor: not-allowed;
231
+ filter: grayscale(0.5);
232
  }
233
 
234
+ /* Drag and Drop Active Highlight */
235
+ .dropzone.drag-active {
236
+ border-color: #10B981 !important;
237
+ background: rgba(16, 185, 129, 0.08) !important;
238
+ box-shadow: 0 0 25px rgba(16, 185, 129, 0.25) inset;
239
  }
240
 
241
  /* Custom Selection Highlight */
242
  ::selection {
243
+ background-color: #10B981;
244
+ color: #080C14;
245
  }