Spaces:
Running
Running
Delete script.js
Browse files
script.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
| 1 |
-
document.addEventListener('DOMContentLoaded', () => {
|
| 2 |
-
// Scroll Reveal Animation
|
| 3 |
-
const observerOptions = {
|
| 4 |
-
threshold: 0.1
|
| 5 |
-
};
|
| 6 |
-
|
| 7 |
-
const observer = new IntersectionObserver((entries) => {
|
| 8 |
-
entries.forEach(entry => {
|
| 9 |
-
if (entry.isIntersecting) {
|
| 10 |
-
entry.target.style.opacity = '1';
|
| 11 |
-
entry.target.style.transform = 'translateY(0)';
|
| 12 |
-
}
|
| 13 |
-
});
|
| 14 |
-
}, observerOptions);
|
| 15 |
-
|
| 16 |
-
// Apply reveal to cards and headings
|
| 17 |
-
const revealElements = document.querySelectorAll('.card, .value-prop h2');
|
| 18 |
-
revealElements.forEach(el => {
|
| 19 |
-
el.style.opacity = '0';
|
| 20 |
-
el.style.transform = 'translateY(30px)';
|
| 21 |
-
el.style.transition = 'all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1)';
|
| 22 |
-
observer.observe(el);
|
| 23 |
-
});
|
| 24 |
-
|
| 25 |
-
// Button Hover Interaction
|
| 26 |
-
const buttons = document.querySelectorAll('.cta-button');
|
| 27 |
-
buttons.forEach(btn => {
|
| 28 |
-
btn.addEventListener('mousemove', (e) => {
|
| 29 |
-
const rect = btn.getBoundingClientRect();
|
| 30 |
-
const x = e.clientX - rect.left;
|
| 31 |
-
const y = e.clientY - rect.top;
|
| 32 |
-
btn.style.setProperty('--x', `${x}px`);
|
| 33 |
-
btn.style.setProperty('--y', `${y}px`);
|
| 34 |
-
});
|
| 35 |
-
});
|
| 36 |
-
|
| 37 |
-
// --- Advanced Browser-Side RAG Demo (Real Search Logic) ---
|
| 38 |
-
const terminalInput = document.getElementById('terminal-input');
|
| 39 |
-
const terminalOutput = document.getElementById('terminal-output');
|
| 40 |
-
|
| 41 |
-
// Default "Memory" if user doesn't paste anything
|
| 42 |
-
let projectContext = [
|
| 43 |
-
"ICM stands for Infinite Context Memory. It is a sovereign intelligence layer.",
|
| 44 |
-
"The system uses INT8 Scalar Quantization to store 10M tokens on standard disk drives.",
|
| 45 |
-
"Local reranking is performed by BGE-Reranker-v2-m3 to reduce API costs by 90%.",
|
| 46 |
-
"ICM turns 'bots with windows' into 'agents with identity'.",
|
| 47 |
-
"Privacy is protected by AES-256-GCM encrypted BYOK keys.",
|
| 48 |
-
"The Professional Tier costs $1,499/mo for 15 million tokens."
|
| 49 |
-
];
|
| 50 |
-
|
| 51 |
-
function simpleSearch(query) {
|
| 52 |
-
const terms = query.split(' ').filter(t => t.length > 2);
|
| 53 |
-
if (terms.length === 0) return null;
|
| 54 |
-
|
| 55 |
-
let bestDoc = null;
|
| 56 |
-
let maxScore = 0;
|
| 57 |
-
|
| 58 |
-
projectContext.forEach(doc => {
|
| 59 |
-
let score = 0;
|
| 60 |
-
terms.forEach(term => {
|
| 61 |
-
if (doc.toLowerCase().includes(term)) score++;
|
| 62 |
-
});
|
| 63 |
-
if (score > maxScore) {
|
| 64 |
-
maxScore = score;
|
| 65 |
-
bestDoc = doc;
|
| 66 |
-
}
|
| 67 |
-
});
|
| 68 |
-
return bestDoc;
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
-
if (terminalInput) {
|
| 72 |
-
terminalInput.addEventListener('keydown', (e) => {
|
| 73 |
-
if (e.key === 'Enter') {
|
| 74 |
-
const val = terminalInput.value.trim();
|
| 75 |
-
const query = val.toLowerCase();
|
| 76 |
-
if (!query) return;
|
| 77 |
-
|
| 78 |
-
// Add User line
|
| 79 |
-
const userLine = document.createElement('div');
|
| 80 |
-
userLine.style.marginBottom = "15px";
|
| 81 |
-
userLine.innerHTML = `<span style="color: #fff; font-weight: bold;">USER></span> ${val}`;
|
| 82 |
-
terminalOutput.appendChild(userLine);
|
| 83 |
-
terminalInput.value = '';
|
| 84 |
-
|
| 85 |
-
// Handle special "upload" command for demo
|
| 86 |
-
if (query.startsWith('ingest ')) {
|
| 87 |
-
const newText = val.substring(7);
|
| 88 |
-
projectContext.push(newText);
|
| 89 |
-
const sysLine = document.createElement('div');
|
| 90 |
-
sysLine.innerHTML = `<div style="color: #27c93f; margin-bottom: 10px;">[SYSTEM]: Memory Augmented. New context indexed at sub-1ms.</div>`;
|
| 91 |
-
terminalOutput.appendChild(sysLine);
|
| 92 |
-
} else {
|
| 93 |
-
// Simulate Neural Processing Delay
|
| 94 |
-
setTimeout(() => {
|
| 95 |
-
const result = simpleSearch(query);
|
| 96 |
-
const responseLine = document.createElement('div');
|
| 97 |
-
|
| 98 |
-
if (result) {
|
| 99 |
-
responseLine.innerHTML = `
|
| 100 |
-
<div style="margin-top: 5px; background: rgba(138, 43, 226, 0.1); padding: 15px; border-radius: 8px; border-left: 4px solid var(--primary); margin-bottom: 15px;">
|
| 101 |
-
<span class="recall-tag">RECALL SUCCESS</span>
|
| 102 |
-
<span style="color: #00d2ff;">"${result}"</span>
|
| 103 |
-
<div class="speed-tag">Latency: 42ms | Precision: 0.98 | Mode: INT8-Agentic</div>
|
| 104 |
-
</div>
|
| 105 |
-
`;
|
| 106 |
-
} else {
|
| 107 |
-
responseLine.innerHTML = `
|
| 108 |
-
<div style="margin-top: 5px; color: #ff5f56; padding: 10px; margin-bottom: 15px;">
|
| 109 |
-
<span class="recall-tag" style="background: #ff5f56;">MISS</span>
|
| 110 |
-
No specific context found. Try 'ingest [text]' to add data.
|
| 111 |
-
</div>
|
| 112 |
-
`;
|
| 113 |
-
}
|
| 114 |
-
terminalOutput.appendChild(responseLine);
|
| 115 |
-
terminalOutput.scrollTop = terminalOutput.scrollHeight;
|
| 116 |
-
}, 250);
|
| 117 |
-
}
|
| 118 |
-
}
|
| 119 |
-
});
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
// Console message for the curious
|
| 123 |
-
console.log("%c ICM | Sovereign Intelligence Engine", "color: #8a2be2; font-size: 20px; font-weight: bold;");
|
| 124 |
-
console.log("Status: Optimized for Infinite Recall.");
|
| 125 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|