Severian commited on
Commit
bd82c8d
·
verified ·
1 Parent(s): e5eabbc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +140 -1
index.html CHANGED
@@ -3521,4 +3521,143 @@
3521
 
3522
  outputDiv.innerHTML = html;
3523
  } else if (data.type === 'ghost_file') {
3524
- let html = `<strong>✅ Valid Vaulted File Detected</strong><br>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3521
 
3522
  outputDiv.innerHTML = html;
3523
  } else if (data.type === 'ghost_file') {
3524
+ let html = `<strong>✅ Valid Vaulted File Detected</strong><br>`;
3525
+
3526
+ const meta = data.metadata;
3527
+ if (meta) {
3528
+ // Add summary
3529
+ html += `<br><br><strong>--- Protection Summary ---</strong>`;
3530
+ html += `<br>Format: ${meta.format || 'Unknown'} v${meta.version || 'Unknown'}`;
3531
+ html += `<br>Creator: ${meta.creator || 'Unknown'}`;
3532
+ html += `<br>Encrypted: ${meta.timestamp || 'Unknown'}`;
3533
+
3534
+ if (meta.protection_level) {
3535
+ html += `<br>Protection Level: ${meta.protection_level.level || 'Unknown'}`;
3536
+ html += `<br>Encryption: ${meta.protection_level.encryption || 'Unknown'}`;
3537
+ html += `<br>AI Poisoning: ${meta.protection_level.ai_poisoning || 'Unknown'}`;
3538
+
3539
+ if (meta.protection_level.custom_disclaimer) {
3540
+ html += `<br><br><strong>Custom Disclaimer:</strong>`;
3541
+ html += `<br><em>"${meta.protection_level.custom_disclaimer.text}"</em>`;
3542
+ html += `<br>Set by: ${meta.protection_level.custom_disclaimer.creator}`;
3543
+ }
3544
+ }
3545
+
3546
+ if (meta.file_info) {
3547
+ html += `<br><br><strong>File Information:</strong>`;
3548
+ html += `<br>Original Size: ${(meta.file_info.original_size / 1024).toFixed(2)} KB`;
3549
+ html += `<br>Encrypted Size: ${(meta.file_info.encrypted_size / 1024).toFixed(2)} KB`;
3550
+ }
3551
+
3552
+ if (meta.fingerprint) {
3553
+ html += `<br><br><strong>Fingerprint Data:</strong>`;
3554
+ html += `<br>SRL Stability: ${meta.fingerprint.srl_stability}`;
3555
+ html += `<br>SEFA Emergence: ${meta.fingerprint.sefa_emergence}`;
3556
+ html += `<br>Watermark: ${meta.fingerprint.watermark_embedded ? 'Yes' : 'No'}`;
3557
+ }
3558
+
3559
+ if (meta._verification_info) {
3560
+ html += `<br><br><strong>Verification Info:</strong>`;
3561
+ html += `<br>File Version: ${meta._verification_info.ghost_file_version}`;
3562
+ html += `<br>File Size: ${(meta._verification_info.file_size_bytes / 1024).toFixed(2)} KB`;
3563
+ html += `<br>Verified: ${meta._verification_info.verification_timestamp}`;
3564
+ }
3565
+ }
3566
+
3567
+ // Add full metadata
3568
+ html += `<br><br><strong>--- Full Vault Metadata ---</strong>`;
3569
+ html += `<pre>${JSON.stringify(data.metadata, null, 2)}</pre>`;
3570
+
3571
+ outputDiv.innerHTML = html;
3572
+ } else if (data.type === 'lite_fingerprint') {
3573
+ let html = `<strong>✅ Stamped File Detected</strong><br>`;
3574
+
3575
+ // Add tamper detection status
3576
+ if (data.integrity_message) {
3577
+ html += `<br><strong>File Integrity:</strong> ${data.integrity_message}`;
3578
+ }
3579
+
3580
+ // Add watermark status
3581
+ if (data.watermark_message) {
3582
+ html += `<br><strong>Watermark Status:</strong> ${data.watermark_message}`;
3583
+ }
3584
+
3585
+ // Add summary
3586
+ if (data.summary) {
3587
+ html += `<br><br><strong>--- Protection Summary ---</strong>`;
3588
+ html += `<br>Creator: ${data.summary.creator}`;
3589
+ html += `<br>Protected: ${data.summary.timestamp}`;
3590
+ html += `<br>Level: ${data.summary.protection_level}`;
3591
+ html += `<br>Version: ${data.summary.algorithm_version}`;
3592
+ if (data.summary.ai_disclaimer && data.summary.ai_disclaimer !== 'None') {
3593
+ html += `<br><br><strong>AI Disclaimer:</strong>`;
3594
+ html += `<br><em>${data.summary.ai_disclaimer}</em>`;
3595
+ }
3596
+ }
3597
+
3598
+ // Add full metadata
3599
+ html += `<br><br><strong>--- Full Stamp Metadata ---</strong>`;
3600
+ html += `<pre>${JSON.stringify(data.metadata, null, 2)}</pre>`;
3601
+
3602
+ outputDiv.innerHTML = html;
3603
+ } else if (data.type === 'filename_indicator') {
3604
+ outputDiv.innerHTML = `
3605
+ <strong>⚠️ Possible Ghostprint Signature</strong><br>
3606
+ <br>${data.message}<br>
3607
+ <br><em>Note: The filename suggests this file was processed by Ghostprint, but no embedded signature was found.</em>`;
3608
+ } else {
3609
+ outputDiv.innerHTML = `
3610
+ <strong>❌ Verification Result</strong><br>
3611
+ <br>${data.message || 'Unknown verification result'}`;
3612
+ }
3613
+ }
3614
+ }
3615
+
3616
+ // Theme Management
3617
+ function initializeTheme() {
3618
+ // Check for saved theme preference or fall back to system preference
3619
+ const savedTheme = localStorage.getItem('ghostprint-theme');
3620
+ if (savedTheme) {
3621
+ document.documentElement.setAttribute('data-theme', savedTheme);
3622
+ }
3623
+ // If no saved preference, let CSS media queries handle it automatically
3624
+ }
3625
+
3626
+ function toggleTheme() {
3627
+ const currentTheme = document.documentElement.getAttribute('data-theme');
3628
+ const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
3629
+
3630
+ let newTheme;
3631
+ if (currentTheme === 'light') {
3632
+ newTheme = 'dark';
3633
+ } else if (currentTheme === 'dark') {
3634
+ newTheme = 'light';
3635
+ } else {
3636
+ // No manual theme set, toggle opposite of system preference
3637
+ newTheme = systemPrefersDark ? 'light' : 'dark';
3638
+ }
3639
+
3640
+ document.documentElement.setAttribute('data-theme', newTheme);
3641
+ localStorage.setItem('ghostprint-theme', newTheme);
3642
+
3643
+ // Add a subtle animation effect
3644
+ document.body.style.transition = 'background-color 0.3s ease, color 0.3s ease';
3645
+ setTimeout(() => {
3646
+ document.body.style.transition = '';
3647
+ }, 300);
3648
+ }
3649
+
3650
+ // Listen for system theme changes and update if no manual override
3651
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
3652
+ const manualTheme = localStorage.getItem('ghostprint-theme');
3653
+ if (!manualTheme) {
3654
+ // No manual override, let the system preference take effect
3655
+ document.documentElement.removeAttribute('data-theme');
3656
+ }
3657
+ });
3658
+
3659
+ // Initialize theme on page load
3660
+ document.addEventListener('DOMContentLoaded', initializeTheme);
3661
+ </script>
3662
+ </body>
3663
+ </html>