-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
323 lines (277 loc) · 15.2 KB
/
index.html
File metadata and controls
323 lines (277 loc) · 15.2 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Context Window - Comparing Generative AI</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
/* Custom Scrollbar */
iframe::-webkit-scrollbar { width: 8px; }
iframe::-webkit-scrollbar-track { background: #1f2937; }
iframe::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }
.glass-panel {
background: rgba(17, 24, 39, 0.7);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
/* Loader Animation */
.loader-ring { display: inline-block; position: relative; width: 80px; height: 80px; }
.loader-ring div { box-sizing: border-box; display: block; position: absolute; width: 64px; height: 64px; margin: 8px; border: 4px solid #3b82f6; border-radius: 50%; animation: loader-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; border-color: #3b82f6 transparent transparent transparent; }
.loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes loader-ring { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* CARD ANIMATION STYLES */
.ai-card {
transform-origin: center center;
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
/* The button that appears on hover */
.fullscreen-trigger {
opacity: 0;
transform: translateY(-10px);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-card:hover .fullscreen-trigger {
opacity: 1;
transform: translateY(0);
}
/* When in fullscreen mode */
.is-fullscreen {
z-index: 9999 !important;
border-radius: 0 !important;
border: none !important;
}
/* Hide other elements when one is fullscreen */
body.has-fullscreen-active header {
opacity: 0;
pointer-events: none;
}
</style>
</head>
<body class="bg-gray-900 text-white h-screen w-screen flex flex-col overflow-hidden font-sans selection:bg-blue-500 selection:text-white">
<div id="info-modal" class="fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm opacity-0 pointer-events-none transition-opacity duration-500">
<div id="info-modal-card" class="bg-gray-800 border border-gray-600 rounded-xl p-6 max-w-md w-full mx-4 shadow-2xl transform scale-95 transition-transform duration-500 relative overflow-hidden">
<div class="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-blue-500 via-purple-500 to-pink-500"></div>
<div class="text-center space-y-4">
<div class="w-12 h-12 bg-gray-700 rounded-full flex items-center justify-center mx-auto text-blue-400">
<i class="fa-solid fa-circle-info text-xl"></i>
</div>
<h3 class="text-xl font-bold text-white tracking-wide">Notice</h3>
<div class="text-gray-300 text-sm leading-relaxed space-y-2">
<p>
I do not own any of the AI models displayed in this interface. They are proprietary technologies of their respective owners.
</p>
<p class="text-gray-400 text-xs border-t border-gray-700 pt-2 mt-2">
Generated: <span class="text-blue-300 font-mono">November 19th</span>
</p>
</div>
<div class="pt-4">
<button onclick="closeModal()" class="w-full bg-blue-600 hover:bg-blue-500 text-white font-semibold py-2 px-4 rounded-lg transition-colors duration-200 shadow-lg shadow-blue-900/20">
Understood
</button>
<p class="mt-4 text-xs text-gray-500 font-mono">Developed by Veer Bajaj</p>
</div>
</div>
</div>
</div>
<header class="glass-panel border-b border-gray-700 flex-none z-50 shadow-lg transition-opacity duration-500">
<div class="max-w-7xl mx-auto px-4 py-3 flex items-center justify-between gap-4">
<div class="flex items-center gap-2 text-gray-400 text-sm font-bold uppercase tracking-wider min-w-fit hidden md:flex">
<i class="fa-solid fa-layer-group text-blue-500"></i>
<span id="site-title">Context Window</span>
</div>
<div class="flex-1 flex gap-4 items-center">
<div class="relative min-w-[150px]">
<select id="benchmark-selector" class="block w-full bg-gray-800 border border-gray-700 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 cursor-pointer outline-none">
<!-- Populated by JS -->
</select>
</div>
<div class="flex-1 relative group">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fa-solid fa-terminal text-gray-500 text-xs"></i>
</div>
<div id="current-prompt" class="block w-full bg-gray-800 border border-gray-700 rounded-md py-2 pl-10 pr-4 text-sm text-green-400 font-mono shadow-inner overflow-hidden text-ellipsis whitespace-nowrap">
Loading...
</div>
<div class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-gray-700 text-xs text-gray-300 px-2 py-0.5 rounded border border-gray-600">
Prompt
</div>
</div>
</div>
<div class="flex items-center gap-3 min-w-fit">
<a href="https://github.com/coder11v/contextwindow" target="_blank" class="flex items-center gap-2 bg-gray-800 hover:bg-gray-700 border border-gray-700 text-gray-300 hover:text-white px-3 py-1.5 rounded-lg text-xs font-semibold transition-all shadow-sm" title="Contribute on GitHub">
<i class="fa-brands fa-github text-sm"></i>
<span class="hidden sm:inline">Contribute</span>
</a>
<button onclick="refreshCurrent()" class="text-gray-400 hover:text-white transition-colors" title="Reload Models"><i class="fa-solid fa-rotate"></i></button>
</div>
</div>
</header>
<div id="loader-overlay" class="flex-1 flex flex-col items-center justify-center bg-gray-900 z-40 absolute inset-0 top-[60px]">
<div class="loader-ring"><div></div><div></div><div></div><div></div></div>
<h2 class="mt-6 text-blue-400 font-mono tracking-widest text-sm animate-pulse">INITIALIZING CONTEXT WINDOW...</h2>
</div>
<main id="main-grid" class="flex-1 grid grid-cols-1 md:grid-cols-2 gap-1 p-1 bg-gray-800 hidden opacity-0 transition-opacity duration-500 relative overflow-y-auto">
<!-- AI cards will be injected here -->
</main>
<script>
let configData = [];
let currentBenchmarkId = null;
// --- FETCH CONFIG ---
async function fetchConfig() {
try {
const response = await fetch('config.json');
configData = await response.json();
populateBenchmarkSelector();
if (configData.length > 0) {
loadBenchmark(configData[0].id);
}
} catch (error) {
console.error('Error loading config:', error);
document.getElementById('current-prompt').innerText = "Error loading config.json";
}
}
function populateBenchmarkSelector() {
const selector = document.getElementById('benchmark-selector');
selector.innerHTML = configData.map(bench => `
<option value="${bench.id}">${bench.id.charAt(0).toUpperCase() + bench.id.slice(1)}</option>
`).join('');
selector.onchange = (e) => loadBenchmark(e.target.value);
}
function loadBenchmark(id) {
const benchmark = configData.find(b => b.id === id);
if (!benchmark) return;
currentBenchmarkId = id;
document.getElementById('current-prompt').innerText = benchmark.prompt;
const grid = document.getElementById('main-grid');
grid.innerHTML = '';
benchmark.models.forEach((model, index) => {
const card = document.createElement('div');
card.id = `card-${id}-${model.id}`;
card.className = `ai-card relative group border border-gray-700 bg-white overflow-hidden bg-gray-900 h-[600px] md:h-auto min-h-[400px]`;
// Color mapping for badges
const colors = ['blue', 'teal', 'orange', 'purple', 'green', 'pink', 'yellow'];
const color = colors[index % colors.length];
card.innerHTML = `
<div class="absolute top-3 left-3 right-3 z-20 flex justify-between items-start pointer-events-none">
<div class="flex items-center gap-2 bg-gray-900/90 backdrop-blur-md border border-${color}-500/30 text-white px-3 py-1.5 rounded-full shadow-lg">
<div class="w-2 h-2 rounded-full bg-${color}-400 animate-pulse"></div>
<span class="text-xs font-semibold tracking-wide">${model.name || model.id}</span>
</div>
<button onclick="toggleFullscreen('${card.id}')" class="fullscreen-trigger pointer-events-auto bg-gray-800/80 hover:bg-${color}-600 text-white w-8 h-8 rounded-full flex items-center justify-center border border-gray-600 hover:border-${color}-400 backdrop-blur shadow-lg cursor-pointer">
<i class="fa-solid fa-expand text-xs"></i>
</button>
</div>
<iframe class="w-full h-full bg-white" src="${model.path}"></iframe>
`;
grid.appendChild(card);
});
}
function refreshCurrent() {
if (currentBenchmarkId) loadBenchmark(currentBenchmarkId);
}
// --- MODAL LOGIC ---
function closeModal() {
const modal = document.getElementById('info-modal');
const modalContent = document.getElementById('info-modal-card');
modal.style.opacity = '0';
modalContent.classList.remove('scale-100');
modalContent.classList.add('scale-95');
setTimeout(() => {
modal.style.display = 'none';
}, 500);
}
function showModal() {
const modal = document.getElementById('info-modal');
const modalContent = document.getElementById('info-modal-card');
if (!modal) return;
modal.classList.remove('pointer-events-none');
modal.style.opacity = '1';
modal.style.display = 'flex';
modalContent.classList.remove('scale-95');
modalContent.classList.add('scale-100');
}
// --- 1. LOADING SEQUENCE ---
window.addEventListener('load', () => {
fetchConfig();
setTimeout(() => {
const loader = document.getElementById('loader-overlay');
const grid = document.getElementById('main-grid');
loader.style.opacity = '0';
loader.style.transition = 'opacity 0.8s ease';
setTimeout(() => {
loader.style.display = 'none';
grid.classList.remove('hidden');
requestAnimationFrame(() => { grid.style.opacity = '1'; });
setTimeout(() => {
showModal();
}, 600);
}, 300);
}, 1000);
});
// --- 2. FLUID FULLSCREEN ANIMATION LOGIC ---
let activeCardId = null;
let originalRect = null;
function toggleFullscreen(cardId) {
const card = document.getElementById(cardId);
const btnIcon = card.querySelector('.fullscreen-trigger i');
const isExpanding = !card.classList.contains('is-fullscreen');
if (isExpanding) {
if (activeCardId && activeCardId !== cardId) return;
activeCardId = cardId;
const rect = card.getBoundingClientRect();
originalRect = rect;
card.style.position = 'fixed';
card.style.top = rect.top + 'px';
card.style.left = rect.left + 'px';
card.style.width = rect.width + 'px';
card.style.height = rect.height + 'px';
card.style.zIndex = '50';
card.style.margin = '0';
requestAnimationFrame(() => {
card.style.transition = 'all 0.5s cubic-bezier(0.16, 1, 0.3, 1)';
requestAnimationFrame(() => {
card.classList.add('is-fullscreen');
document.body.classList.add('has-fullscreen-active');
card.style.top = '0';
card.style.left = '0';
card.style.width = '100vw';
card.style.height = '100vh';
btnIcon.classList.remove('fa-expand');
btnIcon.classList.add('fa-compress');
});
});
} else {
card.style.top = originalRect.top + 'px';
card.style.left = originalRect.left + 'px';
card.style.width = originalRect.width + 'px';
card.style.height = originalRect.height + 'px';
card.classList.remove('is-fullscreen');
document.body.classList.remove('has-fullscreen-active');
btnIcon.classList.remove('fa-compress');
btnIcon.classList.add('fa-expand');
setTimeout(() => {
card.style.position = '';
card.style.top = '';
card.style.left = '';
card.style.width = '';
card.style.height = '';
card.style.zIndex = '';
card.style.transition = '';
activeCardId = null;
}, 500);
}
}
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
if (activeCardId) toggleFullscreen(activeCardId);
const modal = document.getElementById('info-modal');
if (modal && modal.style.opacity === '1') closeModal();
}
});
</script>
</body>
</html>