-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
324 lines (266 loc) · 9.91 KB
/
index.html
File metadata and controls
324 lines (266 loc) · 9.91 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>CUNY CAIL Sandbox — Documentation</title>
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<style>
:root {
--vibrant-50: rgb(232, 244, 252);
--vibrant-100: rgb(209, 233, 249);
--vibrant-200: rgb(163, 211, 243);
--vibrant-600: rgb(59, 115, 230);
--vibrant-700: rgb(42, 111, 184);
--vibrant-800: rgb(29, 58, 131);
--cuny-blue: rgb(29, 58, 131);
--neutral-cream: rgb(250, 252, 248);
--neutral-stone: rgb(51, 51, 51);
--text-muted: rgb(107, 114, 128);
--border: rgb(229, 231, 235);
--sidebar-w: 260px;
--header-h: 72px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
font: 400 16px/1.7 "Inter", system-ui, sans-serif;
color: var(--neutral-stone);
background: var(--neutral-cream);
}
a { color: var(--vibrant-600); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--vibrant-700); }
code {
font-family: "IBM Plex Mono", Menlo, monospace;
font-size: 0.9em; background: rgb(243, 244, 246);
padding: 2px 6px; border-radius: 4px;
}
pre {
background: rgb(243, 244, 246); padding: 16px 20px;
border-radius: 8px; overflow-x: auto; margin: 1.2em 0;
font-size: 0.88em; line-height: 1.6;
border-left: 3px solid var(--vibrant-600);
}
pre code { background: none; padding: 0; }
.site-header {
position: fixed; top: 0; left: 0; right: 0;
height: var(--header-h);
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid rgba(229, 231, 235, 0.8);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
display: flex; align-items: center; padding: 0 24px; z-index: 100;
}
.site-header .logo {
font-family: "Outfit", system-ui, sans-serif;
font-weight: 700; font-size: 1.1rem;
letter-spacing: -0.01em; color: var(--neutral-stone);
}
.site-header .logo span {
opacity: 0.6; font-weight: 400; margin-left: 6px; font-size: 0.85rem;
}
.site-header nav {
margin-left: auto; display: flex; gap: 16px;
font-size: 0.875rem; font-weight: 500;
}
.site-header nav a {
padding: 8px 18px; border-radius: 9999px;
transition: all 0.2s; color: var(--neutral-stone);
}
.site-header nav a:hover { background: var(--vibrant-50); color: var(--vibrant-600); }
.hamburger {
display: none; background: none; border: none;
color: var(--neutral-stone); font-size: 1.4rem;
cursor: pointer; margin-left: auto; padding: 8px;
border-radius: 6px; transition: all 0.2s;
}
.hamburger:hover { background: var(--vibrant-50); color: var(--vibrant-600); }
.sidebar {
position: fixed; top: var(--header-h); left: 0; bottom: 0;
width: var(--sidebar-w);
background: rgba(255, 255, 255, 0.7);
backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
border-right: 1px solid var(--border);
overflow-y: auto; padding: 24px 0; z-index: 90;
}
.sidebar .section-label {
padding: 8px 24px 4px; font-size: 0.7rem;
text-transform: uppercase; letter-spacing: 0.08em;
color: var(--text-muted); font-weight: 600;
font-family: "Outfit", system-ui, sans-serif;
}
.sidebar a {
display: block; padding: 8px 24px;
color: var(--neutral-stone); transition: all 0.15s;
font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.sidebar a:hover { background: var(--vibrant-50); color: var(--vibrant-600); }
.sidebar a.active {
color: var(--vibrant-600); font-weight: 600;
border-right: 3px solid var(--vibrant-600);
background: rgba(209, 233, 249, 0.4);
}
.main {
margin-left: var(--sidebar-w); margin-top: var(--header-h);
padding: 48px 64px 100px; max-width: 880px;
}
.main h1 {
font-family: "Outfit", system-ui, sans-serif;
font-size: 2.25rem; font-weight: 700;
margin-bottom: 12px; letter-spacing: -0.02em; line-height: 1.2;
}
.main h2 {
font-family: "Outfit", system-ui, sans-serif;
font-size: 1.5rem; font-weight: 600;
margin: 2.5em 0 0.8em; padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.main h3 {
font-family: "Outfit", system-ui, sans-serif;
font-size: 1.125rem; font-weight: 600; margin: 1.8em 0 0.6em;
}
.main h4 {
font-family: "Outfit", system-ui, sans-serif;
font-size: 1rem; font-weight: 600; margin: 1.4em 0 0.5em;
}
.main p { margin: 0.9em 0; line-height: 1.7; }
.main ul, .main ol { margin: 1em 0 1em 1.8em; line-height: 1.7; }
.main li { margin: 0.4em 0; }
.main blockquote {
border-left: 4px solid var(--vibrant-200);
padding: 12px 20px; margin: 1.2em 0;
background: rgba(232, 244, 252, 0.5);
border-radius: 0 6px 6px 0; font-size: 0.95rem;
}
.main table {
width: 100%; border-collapse: collapse;
margin: 1.2em 0; font-size: 0.92rem;
}
.main th, .main td {
padding: 10px 14px; text-align: left;
border-bottom: 1px solid var(--border);
}
.main th {
font-weight: 600; background: rgb(243, 244, 246);
font-family: "Outfit", system-ui, sans-serif;
}
.main hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }
.callout {
border-left: 4px solid var(--vibrant-600);
background: var(--vibrant-50);
padding: 16px 20px; margin: 1.4em 0;
border-radius: 0 6px 6px 0; font-size: 0.95rem;
}
.callout strong { color: var(--vibrant-700); font-weight: 600; }
.site-footer {
margin-left: var(--sidebar-w); padding: 24px 64px;
border-top: 1px solid var(--border);
font-size: 0.8rem; color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--vibrant-600); }
.loading {
text-align: center; padding: 80px 0;
color: var(--text-muted); font-size: 0.95rem;
}
@media (max-width: 768px) {
.sidebar { display: none; width: 100%; z-index: 95; }
.sidebar.open { display: block; }
.main, .site-footer { margin-left: 0; }
.main { padding: 28px 24px 80px; }
.hamburger { display: block; }
.site-header nav.desk { display: none; }
.site-header { padding: 0 16px; }
}
</style>
</head>
<body>
<header class="site-header">
<a href="https://ailab.gc.cuny.edu" target="_blank" style="text-decoration:none;color:inherit;display:flex;align-items:center;gap:10px">
<img src="cail-logo.png" alt="CUNY AI Lab" style="height:32px">
<span class="logo">docs</span>
</a>
<nav class="desk">
<a href="https://chat.ailab.gc.cuny.edu" target="_blank">Sandbox</a>
<a href="https://ailab.gc.cuny.edu/models/" target="_blank">Registry</a>
<a href="https://ailab.gc.cuny.edu/tools/" target="_blank">Tools</a>
</nav>
<button class="hamburger" onclick="document.querySelector('.sidebar').classList.toggle('open')">☰</button>
</header>
<aside class="sidebar" id="sidebar">
<a data-page="index" class="nav-link active">Home</a>
<div class="section-label">Getting Started</div>
<a data-page="getting-started" class="nav-link">Getting Started</a>
<a data-page="sandbox-basics" class="nav-link">Sandbox Basics</a>
<div class="section-label">Design & Test</div>
<a data-page="models" class="nav-link">Custom Models</a>
<a data-page="knowledge-bases" class="nav-link">Knowledge Bases</a>
<a data-page="tools-skills" class="nav-link">Tools & Skills</a>
<a data-page="roles-permissions" class="nav-link">Roles & Permissions</a>
<div class="section-label">Teach & Refine</div>
<a data-page="teaching-tips" class="nav-link">Teaching Tips</a>
<a data-page="sample-activities" class="nav-link">Sample Activities</a>
<a data-page="student-onboarding" class="nav-link">Student Onboarding</a>
<a data-page="use-cases" class="nav-link">Use Cases</a>
</aside>
<div class="main" id="content">
<div class="loading">Loading...</div>
</div>
<footer class="site-footer">
<a href="https://ailab.gc.cuny.edu" target="_blank">CUNY AI Lab</a> · <a href="https://www.gc.cuny.edu" target="_blank">CUNY Graduate Center</a>
</footer>
<script>
const contentEl = document.getElementById('content');
async function loadPage(pageId) {
const file = pageId === 'index' ? 'index.md' : `${pageId}.md`;
contentEl.innerHTML = '<div class="loading">Loading...</div>';
try {
const resp = await fetch(file);
if (!resp.ok) throw new Error(`${resp.status}`);
let md = await resp.text();
// Strip nav footer lines
md = md.replace(/\n---\n\n\[←[^\]]*\]\([^)]*\)\s*\|\s*\[.*→\]\([^)]*\)\s*$/, '');
contentEl.innerHTML = marked.parse(md);
// Rewrite internal .md links to SPA navigation
contentEl.querySelectorAll('a').forEach(a => {
const href = a.getAttribute('href');
if (!href || href.startsWith('http') || href.startsWith('#') || href.startsWith('mailto:')) return;
if (href.endsWith('.md')) {
const pageKey = href.replace(/\.md$/, '').replace(/^\.\//, '');
a.href = '#';
a.onclick = (e) => { e.preventDefault(); navigateTo(pageKey); };
}
});
// Update sidebar
document.querySelectorAll('.nav-link').forEach(el => el.classList.remove('active'));
const activeLink = document.querySelector(`[data-page="${pageId}"]`);
if (activeLink) activeLink.classList.add('active');
document.querySelector('.sidebar').classList.remove('open');
window.scrollTo(0, 0);
} catch (err) {
contentEl.innerHTML = `<div class="loading">Failed to load page: ${err.message}</div>`;
}
}
function navigateTo(pageId) {
history.pushState({ page: pageId }, '', `#${pageId}`);
loadPage(pageId);
}
document.querySelectorAll('.nav-link').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
navigateTo(link.dataset.page);
});
});
window.addEventListener('popstate', (e) => {
loadPage((e.state && e.state.page) || getPageFromHash());
});
function getPageFromHash() {
const hash = location.hash.replace('#', '');
return hash || 'index';
}
loadPage(getPageFromHash());
</script>
</body>
</html>