-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
512 lines (470 loc) · 18.1 KB
/
index.html
File metadata and controls
512 lines (470 loc) · 18.1 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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bot Sportello's Arcade</title>
<link rel="icon" type="image/jpeg" href="default.jpg">
<link rel="preload" href="default.jpg" as="image">
<script src="site-config.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
color-scheme: dark;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
font-family: 'Courier Prime', monospace;
background: radial-gradient(circle at top, rgba(0,100,150,0.08), transparent 60%), #050505;
color: #7ec8e3;
padding: 40px 20px 120px;
position: relative;
overflow-x: hidden;
}
.stars {
pointer-events: none;
position: fixed;
inset: 0;
z-index: 0;
background: transparent;
}
.star {
position: absolute;
background: rgba(255, 255, 255, 0.8);
border-radius: 999px;
animation: twinkle 3s infinite ease-in-out;
}
.star.blue { background: rgba(126, 200, 227, 0.8); }
.star.cyan { background: rgba(0, 255, 255, 0.8); }
.star.red { background: rgba(255, 0, 0, 0.8); }
@keyframes twinkle {
0%, 100% { opacity: 0.2; transform: scale(0.75); }
50% { opacity: 1; transform: scale(1); }
}
.home-container {
width: min(1200px, 100%);
margin: 0 auto;
position: relative;
z-index: 1;
}
.header-section {
text-align: center;
margin-bottom: 40px;
}
h1 {
margin: 0;
font-size: clamp(1.8rem, 4vw, 3rem);
color: #ff0000;
text-shadow: 0 0 18px rgba(255, 0, 0, 0.3);
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
}
.header-logo {
width: clamp(40px, 6vw, 64px);
height: clamp(40px, 6vw, 64px);
border-radius: 4px;
filter: brightness(0.85) contrast(1.1) hue-rotate(-10deg);
box-shadow: 0 0 12px rgba(255, 0, 0, 0.2), inset 0 0 8px rgba(0, 255, 255, 0.1);
border: 1px solid rgba(126, 200, 227, 0.3);
transition: all 0.3s ease;
}
.header-logo:hover {
filter: brightness(1) contrast(1.2) hue-rotate(0deg);
box-shadow: 0 0 18px rgba(255, 0, 0, 0.4), inset 0 0 12px rgba(0, 255, 255, 0.2);
border-color: rgba(255, 0, 0, 0.5);
}
.subtitle {
color: #00ffff;
letter-spacing: 1px;
font-size: 0.95rem;
margin: 10px 0 5px;
}
.sync-hint {
font-size: 0.85rem;
color: rgba(126, 200, 227, 0.85);
margin: 0;
}
.collection {
margin-bottom: 60px;
}
.collection-header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: baseline;
border-bottom: 2px solid rgba(126,200,227,0.4);
padding-bottom: 8px;
margin-bottom: 20px;
}
.collection-title {
font-size: 1.4rem;
color: #ff0000;
text-shadow: 0 0 12px rgba(255,0,0,0.25);
}
.collection-description {
font-size: 0.9rem;
color: rgba(126, 200, 227, 0.85);
}
.projects-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 18px;
}
.collection-featured .projects-grid {
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.project-card {
border: 1px solid rgba(126, 200, 227, 0.35);
background: rgba(10, 10, 10, 0.85);
box-shadow: 0 10px 40px rgba(0,0,0,0.35);
padding: 20px;
display: flex;
flex-direction: column;
gap: 12px;
transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
min-height: 210px;
}
.collection-featured .project-card {
min-height: 240px;
border-width: 2px;
background: rgba(24, 0, 0, 0.75);
}
.project-card:hover {
transform: translateY(-6px);
border-color: #ff0000;
box-shadow: 0 20px 60px rgba(255, 0, 0, 0.18);
}
.project-name {
font-size: 1.1rem;
margin: 0;
color: #00ffff;
text-shadow: 0 0 8px rgba(0, 255, 255, 0.35);
}
.project-description {
margin: 0;
font-size: 0.95rem;
color: rgba(126, 200, 227, 0.92);
}
.project-meta {
font-size: 0.85rem;
color: rgba(126, 200, 227, 0.8);
}
.project-link {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: auto;
padding: 12px 16px;
border: 1px solid #7ec8e3;
color: #7ec8e3;
text-decoration: none;
letter-spacing: 1px;
transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.project-link:hover {
background: #ff0000;
color: #050505;
transform: translateY(-2px);
}
.status-line {
text-align: center;
margin: 30px auto 10px;
font-size: 0.9rem;
color: rgba(126, 200, 227, 0.75);
}
.error-line {
color: #ff6b6b;
}
.dashboard-btn {
display: inline-flex;
align-items: center;
gap: 10px;
margin-top: 16px;
padding: 12px 24px;
background: rgba(10, 10, 10, 0.9);
border: 2px solid rgba(126, 200, 227, 0.5);
color: #00ffff;
text-decoration: none;
font-family: 'Courier Prime', monospace;
font-size: 0.95rem;
letter-spacing: 1px;
transition: all 0.2s ease;
cursor: pointer;
}
.dashboard-btn:hover {
border-color: #00ffff;
background: rgba(0, 255, 255, 0.1);
box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
transform: translateY(-2px);
}
@media (max-width: 768px) {
body {
padding: 24px 16px 90px;
}
.collection-header {
flex-direction: column;
align-items: flex-start;
gap: 6px;
}
}
/* Gallery Section */
.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 12px;
}
.gallery-item {
position: relative;
aspect-ratio: 1;
overflow: hidden;
border: 1px solid #ff0000;
border-radius: 4px;
background: rgba(10, 10, 10, 0.8);
transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-item:hover {
transform: scale(1.02);
box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}
.gallery-item img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s;
}
.gallery-item:hover img {
transform: scale(1.05);
}
.gallery-caption {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.85);
color: #7ec8e3;
font-size: 10px;
padding: 6px;
opacity: 0;
transition: opacity 0.2s;
line-height: 1.3;
}
.gallery-item:hover .gallery-caption {
opacity: 1;
}
.gallery-empty {
text-align: center;
color: rgba(126, 200, 227, 0.6);
padding: 40px;
font-size: 0.9rem;
}
/* Random display system */
.hidden-item { display: none !important; }
.expand-btn {
width: 100%;
margin-top: 12px;
padding: 12px;
background: rgba(10, 10, 10, 0.9);
border: 1px dashed rgba(126, 200, 227, 0.5);
color: #00ffff;
cursor: pointer;
font-family: 'Courier Prime', monospace;
font-size: 0.9rem;
letter-spacing: 0.5px;
transition: all 0.2s ease;
}
.expand-btn:hover {
border-color: #00ffff;
background: rgba(0, 255, 255, 0.1);
box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
}
</style>
</head>
<body>
<div class="home-container">
<div class="header-section">
<h1><img src="default.jpg" alt="Bot Sportello" class="header-logo"> Bot Sportello's Arcade</h1>
<p class="subtitle">Noir arcade experiments deployed live from Discord</p>
<p class="sync-hint">Add a new page, run <code>/sync-index</code>, and it shows up here automatically.</p>
<a href="/dashboard" class="dashboard-btn" id="dashboard-btn">AGENT DASHBOARD</a>
</div>
<p class="status-line" id="status-line">Syncing latest project metadata…</p>
<div id="collections"></div>
<!-- AI Gallery Section -->
<section class="collection" id="ai-gallery" style="display: none;">
<div class="collection-header">
<h2 class="collection-title">🎨 AI Gallery</h2>
<p class="collection-description">Generated with Nano Banana Pro</p>
</div>
<div class="gallery-grid" id="gallery-grid"></div>
</section>
</div>
<script src="stars.js" defer></script>
<script>
// ========== DISPLAY CONFIG (easy to change) ==========
const DISPLAY_CONFIG = {
itemsPerCategory: 8, // How many items to show per category
shuffleOnLoad: true // Set false for alphabetical order
};
// =====================================================
const statusLine = document.getElementById('status-line');
const collectionsContainer = document.getElementById('collections');
function encodePathSegments(path) {
return path
.split('/')
.filter(Boolean)
.map(segment => encodeURIComponent(segment))
.join('/');
}
function formatLink(slug, project = {}) {
const rawPath = project.path ? project.path : `${slug}.html`;
if (/^(https?:)?\/\//.test(rawPath)) {
return rawPath;
}
const normalized = rawPath.replace(/^\.?\//, '');
const prefixed = normalized.startsWith('src/') ? normalized : `src/${normalized}`;
return encodePathSegments(prefixed);
}
function createProjectCard(slug, project) {
const card = document.createElement('article');
card.className = 'project-card';
const title = document.createElement('h3');
title.className = 'project-name';
title.textContent = `${project.icon || '🌐'} ${project.title || slug}`;
const desc = document.createElement('p');
desc.className = 'project-description';
desc.textContent = project.description || 'Interactive web project';
const meta = document.createElement('div');
meta.className = 'project-meta';
meta.innerHTML = `<span>${project.collection || 'unsorted'}</span>`;
const link = document.createElement('a');
link.className = 'project-link';
link.href = formatLink(slug, project);
link.textContent = 'OPEN →';
link.setAttribute('aria-label', `Open ${project.title || slug}`);
card.appendChild(title);
card.appendChild(desc);
card.appendChild(meta);
card.appendChild(link);
return card;
}
function renderCollections(data) {
const collections = data.collections || {};
const projects = data.projects || {};
const grouped = {};
// Group projects by collection
Object.entries(projects).forEach(([slug, project]) => {
if (project.hidden) return;
const collectionId = collections[project.collection] ? project.collection : 'unsorted';
if (!grouped[collectionId]) grouped[collectionId] = [];
grouped[collectionId].push({ slug, ...project });
});
const orderedCollections = Object.entries(collections)
.sort(([, a], [, b]) => (a.order || 99) - (b.order || 99));
let totalProjects = 0;
orderedCollections.forEach(([id, meta]) => {
const rawItems = grouped[id] || [];
if (!rawItems.length) return;
totalProjects += rawItems.length;
// Shuffle or sort based on config
const items = DISPLAY_CONFIG.shuffleOnLoad
? [...rawItems].sort(() => Math.random() - 0.5)
: [...rawItems].sort((a, b) => (a.title || a.slug).localeCompare(b.title || b.slug));
const section = document.createElement('section');
section.className = `collection ${id === 'featured' ? 'collection-featured' : ''}`;
section.dataset.collection = id;
const header = document.createElement('div');
header.className = 'collection-header';
const title = document.createElement('h2');
title.className = 'collection-title';
title.textContent = meta.title || id;
const description = document.createElement('p');
description.className = 'collection-description';
description.textContent = meta.description || '';
header.appendChild(title);
header.appendChild(description);
const grid = document.createElement('div');
grid.className = 'projects-grid';
// Render all cards, hide extras beyond limit
items.forEach((item, index) => {
const card = createProjectCard(item.slug, item);
if (index >= DISPLAY_CONFIG.itemsPerCategory) {
card.classList.add('hidden-item');
}
grid.appendChild(card);
});
section.appendChild(header);
section.appendChild(grid);
// Add expand button if there are hidden items
const hiddenCount = Math.max(0, items.length - DISPLAY_CONFIG.itemsPerCategory);
if (hiddenCount > 0) {
const expandBtn = document.createElement('button');
expandBtn.className = 'expand-btn';
expandBtn.textContent = `Show ${hiddenCount} more`;
expandBtn.onclick = () => {
grid.querySelectorAll('.hidden-item').forEach(el => el.classList.remove('hidden-item'));
expandBtn.remove();
};
section.appendChild(expandBtn);
}
collectionsContainer.appendChild(section);
});
if (!totalProjects) {
statusLine.textContent = 'No projects found. Run /sync-index after shipping something new.';
} else {
statusLine.textContent = `Showing ${totalProjects} deployed projects.`;
}
}
async function loadProjects() {
try {
const response = await fetch(`projectmetadata.json?${Date.now()}`);
if (!response.ok) {
throw new Error('Failed to load metadata');
}
const data = await response.json();
renderCollections(data);
} catch (error) {
console.error(error);
statusLine.textContent = 'Could not load metadata. Run /sync-index after the next deploy.';
statusLine.classList.add('error-line');
}
}
loadProjects();
// Load AI Gallery
async function loadGallery() {
const gallerySection = document.getElementById('ai-gallery');
const galleryGrid = document.getElementById('gallery-grid');
try {
const response = await fetch(`src/gallery/gallery.json?${Date.now()}`);
if (!response.ok) return;
const data = await response.json();
if (!data.images || data.images.length === 0) return;
// Show section and render last 12 images (newest first)
gallerySection.style.display = 'block';
const images = data.images.slice(-12).reverse();
images.forEach(img => {
const item = document.createElement('a');
item.className = 'gallery-item';
item.href = `src/gallery/${img.filename}`;
item.target = '_blank';
item.innerHTML = `
<img src="src/gallery/${img.filename}" alt="${img.prompt}" loading="lazy">
<div class="gallery-caption">${img.prompt}</div>
`;
galleryGrid.appendChild(item);
});
} catch (e) {
// Gallery not available yet - silently ignore
console.log('Gallery not yet available');
}
}
loadGallery();
</script>
</body>
</html>