-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudio.html
More file actions
388 lines (355 loc) · 24.8 KB
/
Copy pathstudio.html
File metadata and controls
388 lines (355 loc) · 24.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>Assembly Studio — Add App</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<style>
:root {
--text: #212b36;
--muted: #6b6f76;
--border: #dfe1e4;
--bg-soft: #f8f9fb;
--bg-hover: #eff1f4;
--dark: #1a1a1a;
--accent: #5b6cf0;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--text); background: #fff; -webkit-font-smoothing: antialiased; }
.shell { display: flex; height: 100vh; overflow: hidden; }
/* ── Sidebar ── */
.sidebar { width: 248px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; }
.ws { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; cursor: pointer; }
.ws:hover { background: var(--bg-hover); }
.ws-avatar { width: 26px; height: 26px; border-radius: 7px; background: #f0f1f3 !important; border: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #5a6068 !important; font-size: 13px; font-weight: 400; }
.ws-name { font-weight: 500; font-size: 14px; flex: 1; }
.ws-caret { color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 1px; margin-top: 8px; }
.nav-group-label { font-size: 11px; font-weight:500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 14px 8px 5px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; font-size: 13.5px; color: var(--text); cursor: pointer; text-decoration: none; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--bg-hover); }
.nav-item svg { color: var(--muted); flex-shrink: 0; }
.nav-item .ic, .ws-caret-img, .checklist-item .ic { display: block; flex-shrink: 0; }
.nav-item.add { color: var(--muted); }
.spacer { flex: 1; }
/* Checklist panel */
.checklist { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 10px; }
.checklist-title { font-size: 12.5px; font-weight:500; margin-bottom: 10px; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--muted); position: relative; }
.checklist-item .dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #c7ccd3; flex-shrink: 0; background: #fff; }
.checklist-item.done .dot { border-color: var(--dark); background: var(--dark); }
.checklist-item.active { color: var(--text); font-weight: 500; }
.checklist-item.active .dot { border-color: var(--dark); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--dark); }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 2px; }
.foot-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-foot .icon-btn { display: flex; align-items: center; justify-content: center; padding: 7px; border: 1px solid var(--border); background: #fff; border-radius: 999px; cursor: pointer; transition: background 0.12s; }
.sidebar-foot .icon-btn:hover { background: var(--bg-hover); }
.sidebar-foot .open-portal { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--border); background: #fff; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text); cursor: pointer; font-family: inherit; transition: background 0.12s; }
.sidebar-foot .open-portal:hover { background: var(--bg-hover); }
/* ── Main ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; height: 52px; flex-shrink: 0; padding: 0 28px; border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 13px; font-weight: 500; color: var(--text); }
.tabs { display: flex; gap: 22px; flex-shrink: 0; border-bottom: 1px solid var(--border); margin-top: 0; padding: 0 28px; }
/* Only this area scrolls — the top bar + tabs stay pinned */
.scroll-area { flex: 1; overflow-y: auto; }
.tab { padding: 10px 2px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); font-weight: 500; border-bottom-color: var(--dark); }
.content { max-width: 740px; margin: 0 auto; width: 100%; padding: 64px 24px 60px; }
.greeting { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 18px; }
@property --asm-prompt-angle { syntax: "<angle>"; inherits: false; initial-value: 150deg; }
.promptbox { border: 1.5px solid transparent; border-radius: 14px; background: linear-gradient(#fff,#fff) padding-box, conic-gradient(from var(--asm-prompt-angle), #c2caf0, #d9ed92, #c2caf0, #d9ed92, #c2caf0) border-box; box-shadow: 0 1px 2px rgba(0,0,0,0.03); overflow: hidden; transition: box-shadow 0.15s; animation: asmPromptGlow 6s linear infinite; }
@keyframes asmPromptGlow { to { --asm-prompt-angle: 510deg; } }
@media (prefers-reduced-motion: reduce) { .promptbox { animation: none; } }
.promptbox:focus-within { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
/* One-app limit tooltip (shown when an app already exists) */
.promptbox-wrap { position: relative; }
.one-app-tip { position: absolute; left: 0; top: calc(100% + 10px); max-width: 360px; background: #1a1a1a; color: #fff; font-size: 13px; line-height: 1.5; padding: 10px 13px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.22); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; z-index: 20; }
.one-app-tip.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.one-app-tip::before { content: ''; position: absolute; bottom: 100%; left: 22px; border: 6px solid transparent; border-bottom-color: #1a1a1a; }
.one-app-tip a { color: #d9ed92; cursor: pointer; white-space: nowrap; font-weight: 500; }
.one-app-tip a:hover { text-decoration: underline; }
.promptbox textarea { width: 100%; border: none; outline: none; resize: none; font-family: inherit; font-size: 15px; line-height: 1.55; color: var(--text); padding: 16px 18px 6px; min-height: 70px; max-height: 240px; background: transparent; }
.promptbox textarea::placeholder { color: #9aa0a6; }
.promptbox-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 12px; }
.attach { width: 30px; height: 30px; border: none; background: transparent; border-radius: 8px; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.attach:hover { background: var(--bg-hover); }
/* Send button: solid dark square, same fill as the portal's dark buttons. */
.start-btn { width: 34px; height: 34px; flex-shrink: 0; background: var(--dark); color: #fff; border: none; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity 0.15s; }
.start-btn svg { width: 16px; height: 16px; }
.start-btn:not(:disabled):hover { opacity: 0.88; }
/* Single row, but scroll instead of clipping when it doesn't fit. */
.chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; font-size: 13px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 7px 13px; cursor: pointer; font-family: inherit; transition: background 0.12s, border-color 0.12s; }
.chip:hover { background: var(--bg-soft); border-color: #c7ccd3; }
.chip-more { width: 34px; padding: 7px 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
/* Templates */
.templates { max-width: 1180px; margin: 0 auto; width: 100%; padding: 36px 24px 60px; }
.templates-panel { border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px 26px; }
.templates-head { margin-bottom: 18px; }
.templates-title { font-size: 15px; font-weight:500; }
/* Auto-fitting columns so cards reflow (4-ish wide → 2 → 1) instead of clipping. */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
/* Remix card: framed app screenshot that bleeds into a soft gray header,
with the name + description below. */
.template-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.template-card:hover { border-color: #c9cdd4; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.template-top { background: #eff1f4; border-bottom: 1px solid var(--border); padding: 12px 12px 0; }
.template-thumb { height: 116px; border-radius: 2px 2px 0 0; overflow: hidden; }
.template-thumb img { width: 100%; height: 116px; object-fit: cover; object-position: top; display: block; }
.template-body { padding: 8px 12px; }
.template-name { font-size: 13px; font-weight: 500; line-height: 21px; color: var(--text); }
.template-desc { font-size: 12px; line-height: 20px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* ── Responsive ── */
/* Tablet: tighten the wide template gutter so cards keep their size. */
@media (max-width: 1024px) {
.templates { padding: 28px 24px 56px; }
}
/* Narrow / mobile: drop the sidebar so the build flow gets the full width,
and pull in the generous desktop paddings. */
@media (max-width: 768px) {
.sidebar { display: none; }
.topbar, .tabs { padding: 0 18px; }
.content { padding: 36px 18px 40px; }
.greeting { font-size: 22px; margin-bottom: 16px; }
.templates { padding: 24px 18px 48px; }
.templates-panel { padding: 18px 16px 22px; }
.templates-head { margin-bottom: 14px; }
}
@media (max-width: 420px) {
.promptbox textarea { font-size: 14px; }
.greeting { font-size: 20px; }
}
</style>
</head>
<body>
<div class="shell">
<!-- ── Sidebar ── -->
<aside class="sidebar">
<div class="ws">
<div class="ws-avatar" id="wsAvatar">S</div>
<span class="ws-name" id="wsName">Studio</span>
<img class="ws-caret-img" src="assets/chevron.svg" alt="" width="12" height="12" />
</div>
<nav class="nav">
<a class="nav-item" data-nav="crm.html"><img class="ic" src="assets/crm.svg" alt="" width="16" height="16" />CRM</a>
<a class="nav-item" data-nav="team.html"><img class="ic" src="assets/team.svg" alt="" width="18" height="18" />Team</a>
<a class="nav-item" data-nav="notifications.html"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="#212B36" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg>Notifications</a>
<div class="nav-group-label">Apps</div>
<a class="nav-item" data-nav="home.html"><img class="ic" src="assets/home.svg" alt="" width="18" height="18" />Home</a>
<a class="nav-item" data-nav="messages.html"><img class="ic" src="assets/message.svg" alt="" width="18" height="18" />Messages</a>
<a class="nav-item add active"><img class="ic" src="assets/pls.svg" alt="" width="15" height="15" />Add app</a>
<div class="nav-group-label">Customize</div>
<a class="nav-item" data-nav="brand.html"><img class="ic" src="assets/brand.svg" alt="" width="18" height="18" />Brand</a>
<a class="nav-item" data-nav="app-library.html"><img class="ic" src="assets/apps.svg" alt="" width="18" height="18" />App Library</a>
</nav>
<div class="spacer"></div>
<div class="checklist" style="visibility:hidden">
<div class="checklist-title">Getting started</div>
<div class="checklist-item"><img class="ic" src="assets/todo.svg" alt="" width="14" height="14" />Publish your first app</div>
<div class="checklist-item"><img class="ic" src="assets/todo.svg" alt="" width="14" height="14" />Create test client</div>
<div class="checklist-item"><img class="ic" src="assets/todo.svg" alt="" width="14" height="14" />Explore the client experience</div>
<div class="checklist-item"><img class="ic" src="assets/todo.svg" alt="" width="14" height="14" />Invite your team</div>
</div>
<div class="sidebar-foot">
<div class="foot-actions">
<button class="icon-btn" type="button"><img src="assets/settings.svg" alt="Settings" width="16" height="16" /></button>
<button class="icon-btn" type="button"><img src="assets/helpcenter.svg" alt="Help" width="16" height="16" /></button>
</div>
<button class="open-portal" type="button">Open Portal <img src="assets/openportal.svg" alt="" width="12" height="12" /></button>
</div>
</aside>
<!-- ── Main ── -->
<main class="main">
<div class="topbar"><div class="topbar-title">Add App</div></div>
<div class="tabs">
<div class="tab active">Build</div>
<div class="tab">Browse</div>
</div>
<div class="scroll-area">
<div class="content">
<h1 class="greeting">What will you build?</h1>
<div class="promptbox-wrap">
<div class="promptbox">
<textarea id="buildPrompt" rows="2" placeholder="Describe the app you want to build for your clients…"></textarea>
<div class="promptbox-bar">
<button class="attach" title="Attach"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg></button>
<button class="start-btn" id="startBuilding" type="button" aria-label="Start building"><svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19V5M5 12l7-7 7 7"/></svg></button>
</div>
</div>
<div class="one-app-tip" id="oneAppTip">For this prototype, you can build just one app. <a class="one-app-edit">Open your app →</a></div>
</div>
<div id="appCategories" style="margin-top:22px"></div>
</div>
<div class="templates">
<div class="templates-panel">
<div class="templates-head">
<div class="templates-title">Remix from app templates</div>
</div>
<div class="template-grid" id="templateGrid"></div>
</div>
</div>
</div>
</main>
</div>
<script src="app-categories.js"></script>
<script>
// Read the prompt passed from the marketing site / chip selection (#prompt=…)
function getHashParam(name) {
const m = location.hash.match(new RegExp('[#&]' + name + '=([^&]*)'));
return m ? decodeURIComponent(m[1].replace(/\+/g, ' ')) : '';
}
// Reflect the company the user entered in the sidebar (name + letter avatar).
// Falls back to "BrandMages" / "B" when none was provided (e.g. the Google path).
// Allowed avatar color combos (light tint bg + matching text), picked by name.
const AVATAR_COLORS = [['#f4f5f7','#1f1f1f'],['#e4f1eb','#44856f'],['#ece8f6','#7a6cb2'],['#f6e5e6','#ac5462'],['#efe9d2','#a5812b'],['#dce9f0','#6e96ad'],['#e8eee0','#8a9070'],['#f2e6f1','#9c4f92']];
function avatarColor(s) { let h = 0; s = (s || '').toString(); for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) >>> 0; return AVATAR_COLORS[h % AVATAR_COLORS.length]; }
const company = getHashParam('company');
const uName = getHashParam('name');
const uEmail = getHashParam('email');
const wsDisplay = company || 'Studio';
if (company) {
document.getElementById('wsName').textContent = company;
document.getElementById('wsAvatar').textContent = company.trim()[0].toUpperCase();
}
(function () { const a = document.getElementById('wsAvatar'); const [bg, fg] = avatarColor(wsDisplay); a.style.background = bg; a.style.color = fg; })();
// Carry company + identity onto cross-page nav links (CRM, Team).
const navParams = [];
if (company) navParams.push('company=' + encodeURIComponent(company));
if (uName) navParams.push('name=' + encodeURIComponent(uName));
if (uEmail) navParams.push('email=' + encodeURIComponent(uEmail));
if (getHashParam('theme')) navParams.push('theme=' + encodeURIComponent(getHashParam('theme')));
const navSuffix = navParams.length ? '#' + navParams.join('&') : '';
document.querySelectorAll('[data-nav]').forEach(a => { a.setAttribute('href', a.dataset.nav + navSuffix); });
(function(){ const purl = 'portal.html' + navSuffix; const op = document.querySelector('.open-portal'); if (op) op.addEventListener('click', function(){ location.href = purl; }); document.querySelectorAll('.checklist-item').forEach(function(it){ if (it.textContent.indexOf('Explore the client experience') > -1) { it.style.cursor = 'pointer'; it.addEventListener('click', function(){ location.href = purl; }); } }); })();
const promptField = document.getElementById('buildPrompt');
const startBtn = document.getElementById('startBuilding');
function autosize() {
promptField.style.height = 'auto';
promptField.style.height = Math.min(promptField.scrollHeight, 240) + 'px';
}
function updateStart() {
const has = promptField.value.trim().length > 0;
startBtn.disabled = !has;
startBtn.style.opacity = has ? '1' : '0.45';
startBtn.style.cursor = has ? 'pointer' : 'default';
}
// A prompt (typed, chip-selected, or carried from the website) flips the
// "Publish your first app" FTUX item from todo to in-progress.
function markPromptEntered() {
if (window.ftuxMarkPublishProgress) { window.ftuxMarkPublishProgress(); return; }
try { var s = JSON.parse(localStorage.getItem('onb.ftux')) || {}; if (!s.publish) { s.publish = 'progress'; localStorage.setItem('onb.ftux', JSON.stringify(s)); } } catch (e) {}
}
// Persist whatever's in the prompt box so leaving and coming back keeps it.
const STUDIO_PROMPT_KEY = 'onb.studioPrompt';
function savePrompt() { try { localStorage.setItem(STUDIO_PROMPT_KEY, promptField.value); } catch (e) {} }
// Pre-fill from the website prompt if one was entered/chosen; otherwise
// restore a draft the user typed before navigating away.
let initial = getHashParam('prompt');
if (!initial) { try { initial = localStorage.getItem(STUDIO_PROMPT_KEY) || ''; } catch (e) {} }
// Persist the prompt (incl. one carried from the website via #prompt=) so it
// survives navigating away and back, not just typing here.
if (initial) { promptField.value = initial; markPromptEntered(); savePrompt(); }
autosize();
updateStart();
promptField.addEventListener('input', () => { autosize(); updateStart(); savePrompt(); if (promptField.value.trim()) markPromptEntered(); });
// Category chips below open a dropdown of related starter apps; picking one
// fills the prompt (same effect the old single-prompt chips had).
if (window.AppCategories) {
window.AppCategories.mount({
host: document.getElementById('appCategories'),
onSelect: function (item) {
promptField.value = item.prompt;
autosize();
updateStart();
savePrompt();
markPromptEntered();
promptField.focus();
}
});
}
// Remix-from-templates gallery. Drop screenshots into assets/templates/
// matching the `img` paths below; until then the soft gray header shows.
const TEMPLATES = [
{ name: 'Proposal Builder', desc: 'Create, send, and track client proposals', img: 'assets/templates/proposal-builder.png', prompt: 'A proposal builder to create, send, and track client proposals' },
{ name: 'Time Tracker', desc: 'Log hours and review time across projects', img: 'assets/templates/time-tracker.png', prompt: 'A time tracker to log hours and review time across projects' },
{ name: 'Pizza Tracker', desc: 'Real-time order status from kitchen to door', img: 'assets/templates/pizza-tracker.png', prompt: 'An order tracker showing real-time status from kitchen to door' },
{ name: 'Client Dashboard', desc: 'A branded overview of status and activity', img: 'assets/templates/dashboard.png', prompt: 'A branded client dashboard with an overview of status and activity' },
{ name: 'Appointments', desc: 'Let clients book and manage appointments', img: 'assets/templates/appointments.png', prompt: 'An appointments app where clients book and manage appointments' },
{ name: 'Document Manager', desc: 'Organize, request, and share documents', img: 'assets/templates/documents.png', prompt: 'A document manager to organize, request, and share documents' },
{ name: 'Order Tracker', desc: 'Track orders from request to delivery', img: 'assets/templates/orders.png', prompt: 'An order tracker that follows orders from request to delivery' },
{ name: 'Invoices', desc: 'Send invoices and collect payments', img: 'assets/templates/invoices.png', prompt: 'An invoicing app to send invoices and collect payments' }
];
(function renderTemplates() {
const grid = document.getElementById('templateGrid');
if (!grid) return;
TEMPLATES.forEach(function (t) {
const card = document.createElement('div');
card.className = 'template-card';
card.innerHTML =
'<div class="template-top"><div class="template-thumb">' +
'<img src="' + t.img + '" alt="" onerror="this.style.display=\'none\'" />' +
'</div></div>' +
'<div class="template-body">' +
'<div class="template-name"></div>' +
'<div class="template-desc"></div>' +
'</div>';
card.querySelector('.template-name').textContent = t.name;
card.querySelector('.template-desc').textContent = t.desc;
card.addEventListener('click', function () {
promptField.value = t.prompt;
autosize();
updateStart();
savePrompt();
markPromptEntered();
promptField.focus();
window.scrollTo({ top: 0, behavior: 'smooth' });
});
grid.appendChild(card);
});
})();
// Start Building → kick off the existing build process (plan mode etc.)
// This prototype is limited to one app. If one already exists, gently explain
// it (tooltip) and route the user back to their app instead of building another.
var existingApp = null;
try { var _al = JSON.parse(localStorage.getItem('onb.buildApps')); if (Array.isArray(_al) && _al.length) existingApp = _al[_al.length - 1]; } catch (e) {}
var oneAppTip = document.getElementById('oneAppTip');
var oneTipTimer = null;
function showOneAppTip() {
if (!existingApp || !oneAppTip) return;
oneAppTip.classList.add('show');
if (oneTipTimer) clearTimeout(oneTipTimer);
oneTipTimer = setTimeout(function () { oneAppTip.classList.remove('show'); }, 5000);
}
if (existingApp && oneAppTip) {
var editLink = oneAppTip.querySelector('.one-app-edit');
if (editLink) editLink.addEventListener('click', function () { location.href = 'builder.html' + (existingApp.hash || navSuffix); });
promptField.addEventListener('focus', showOneAppTip);
promptField.addEventListener('click', showOneAppTip);
}
function startBuilding() {
const p = promptField.value.trim();
if (!p) { promptField.focus(); return; }
if (existingApp) { showOneAppTip(); return; } // one-app limit
// Build kicked off — clear the saved draft so a later visit starts clean.
try { localStorage.removeItem(STUDIO_PROMPT_KEY); } catch (e) {}
window.location.href = 'builder.html#prompt=' + encodeURIComponent(p);
}
startBtn.addEventListener('click', startBuilding);
promptField.addEventListener('keydown', e => {
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) { e.preventDefault(); startBuilding(); }
});
</script>
<script src="ftux.js?v=53"></script>
<script src="apps-nav.js?v=6"></script>
<script src="prototype-hints.js?v=6"></script>
</body>
</html>