-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-library.html
More file actions
264 lines (247 loc) · 19 KB
/
Copy pathapp-library.html
File metadata and controls
264 lines (247 loc) · 19 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
<!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 — App Library</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; }
* { 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 (shared) */
.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; }
.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 { 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); }
.checklist-item.active { color: var(--text); font-weight: 500; }
.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; }
.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; }
.sidebar-foot .open-portal:hover { background: var(--bg-hover); }
/* Main */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.page-top { display: flex; align-items: center; justify-content: space-between; height: 52px; flex-shrink: 0; padding: 0 28px; border-bottom: 1px solid var(--border); }
.page-title { font-size: 13px; font-weight: 500; color: var(--text); }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-actions svg { width: 14px; height: 14px; }
/* Compact buttons matching the product (Figma): 12px text, 4px radius. */
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); background: #fff; border-radius: 4px; font-family: inherit; font-size: 12px; line-height: 20px; font-weight: 500; color: var(--text); cursor: pointer; transition: background 0.12s; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-dark { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid rgba(0,0,0,0.12); background: #212b36; border-radius: 4px; font-family: inherit; font-size: 12px; line-height: 20px; font-weight: 500; color: #fff; cursor: pointer; transition: opacity 0.12s; }
.btn-dark:hover { opacity: 0.9; }
.al-body { flex: 1; display: flex; min-height: 0; }
.al-apps { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 32px; border-right: 1px solid var(--border); }
/* Bleeds off the right + bottom edges (anchored to the corner). */
.al-preview { width: 46%; max-width: 600px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; padding: 26px 0 0 32px; }
.al-h { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 18px; }
/* App list */
.al-panel { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.al-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--border); }
.al-row:first-child { border-top: none; }
.al-ic { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #212b36; }
.al-ic svg { width: 18px; height: 18px; }
.al-name { font-size: 14px; font-weight: 500; color: #212b36; display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.al-name .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-name .eye { color: #9aa0a6; display: flex; flex-shrink: 0; }
.al-vis { font-size: 13px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.al-menu { width: 30px; height: 30px; border: none; background: transparent; border-radius: 7px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.al-menu:hover { background: var(--bg-hover); }
.al-menu svg { width: 18px; height: 18px; }
/* Client preview device */
/* The preview is illustrative only — pointer cursor makes prototype-hints.js
show the "Not part of this prototype" tooltip anywhere inside it. */
.al-device { flex: 1; min-height: 0; border: 1px solid var(--border); border-right: none; border-bottom: none; border-radius: 14px 0 0 0; overflow: hidden; display: flex; background: #fff; cursor: pointer; }
.al-portal-side { width: 196px; flex-shrink: 0; background: #26262a; display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; }
.al-portal-brand { display: flex; align-items: center; gap: 9px; padding: 5px 6px 16px; color: #fff; font-size: 14px; font-weight: 500; }
.al-portal-brand .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-pavatar { width: 26px; height: 26px; border-radius: 7px; background: #3a3a40; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.al-portal-nav { display: flex; flex-direction: column; gap: 2px; }
.al-pnav-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: rgba(255,255,255,0.82); font-size: 13.5px; }
.al-pnav-item:first-child { background: rgba(255,255,255,0.08); color: #fff; }
.al-pnav-item svg { width: 18px; height: 18px; color: rgba(255,255,255,0.6); flex-shrink: 0; }
.al-pnav-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Light mock of the client's Home view (instead of a flat gray block). */
.al-portal-body { flex: 1; min-width: 0; background: #f7f7f5; display: flex; flex-direction: column; overflow: hidden; }
.pb-top { height: 50px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #ececea; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.pb-title { font-size: 13px; font-weight: 500; color: #212b36; }
.pb-ava { width: 26px; height: 26px; border-radius: 50%; background: #e4e4df; }
.pb-content { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pb-hero { background: #fff; border: 1px solid #ececea; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.pb-bar { height: 9px; border-radius: 999px; background: #e7e7e2; }
.pb-bar.w35 { width: 35%; } .pb-bar.w55 { width: 55%; } .pb-bar.w70 { width: 70%; }
.pb-pill { margin-top: 4px; width: 96px; height: 26px; border-radius: 999px; background: #d9ed92; }
.pb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pb-card { background: #fff; border: 1px solid #ececea; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.pb-ic { width: 30px; height: 30px; border-radius: 8px; background: #eef0f3; }
/* On narrow screens there isn't room for the client-portal preview, so hide
it entirely and let the app list use the full width. */
@media (max-width: 980px) {
.al-body { flex-direction: column; }
.al-apps { border-right: none; }
.al-preview { display: none; }
}
</style>
</head>
<body>
<div class="shell">
<!-- Sidebar (shared) -->
<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" data-nav="studio.html"><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 active"><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="page-top">
<div class="page-title">App Library</div>
<div class="page-actions">
<button class="btn-ghost" type="button">Add folder</button>
<button class="btn-dark" id="addAppBtn" type="button" data-live="1">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg>
Add app
</button>
</div>
</div>
<div class="al-body">
<!-- Left: apps + their client visibility -->
<section class="al-apps">
<h1 class="al-h">Apps</h1>
<div class="al-panel" id="appList"></div>
</section>
<!-- Right: how the client sees these apps -->
<section class="al-preview">
<h1 class="al-h">Client Preview</h1>
<div class="al-device">
<div class="al-portal-side">
<div class="al-portal-brand"><span class="al-pavatar" id="pAvatar">S</span><span class="label" id="pName">Studio</span></div>
<nav class="al-portal-nav" id="portalNav"></nav>
</div>
<div class="al-portal-body">
<div class="pb-top"><span class="pb-title">Home</span></div>
</div>
</div>
</section>
</div>
</main>
</div>
<script>
function getHashParam(name) { const m = location.hash.match(new RegExp('[#&]' + name + '=([^&]*)')); return m ? decodeURIComponent(m[1].replace(/\+/g, ' ')) : ''; }
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') || 'Studio';
const letter = (company.trim()[0] || 'S').toUpperCase();
const [avBg, avFg] = avatarColor(company);
// Studio sidebar identity
document.getElementById('wsName').textContent = company;
const wa = document.getElementById('wsAvatar'); wa.textContent = letter; wa.style.background = avBg; wa.style.color = avFg;
// Client-preview brand
document.getElementById('pName').textContent = company;
document.getElementById('pAvatar').textContent = letter;
// Icons (recolored via currentColor for the dark client preview).
const ICONS = {
home: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10.5 12 3l9 7.5"/><path d="M5 9.8V20h14V9.8"/><path d="M9.5 20v-5h5v5"/></svg>',
msg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',
clock: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7.5V12l3 2"/></svg>'
};
const DOTS = '<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>';
const EYE_OFF = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M9.9 5.1A9.5 9.5 0 0 1 12 5c5 0 9 4 10 7a13 13 0 0 1-2.2 3.2M6.6 6.6A13 13 0 0 0 2 12c1 3 5 7 10 7a9.4 9.4 0 0 0 4.4-1.1"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/><path d="M2 2l20 20"/></svg>';
// The client-visible apps: the two defaults every portal has, plus any apps
// the user has built (stored by the builder). NOT the Figma's placeholder set.
const apps = [
{ name: 'Home', icon: 'home', draft: false },
{ name: 'Messages', icon: 'msg', draft: false }
];
try {
let built = JSON.parse(localStorage.getItem('onb.buildApps'));
if (!Array.isArray(built)) { const one = JSON.parse(localStorage.getItem('onb.buildApp')); built = one && one.name ? [one] : []; }
if (Array.isArray(built)) built.forEach(b => { if (b && b.name && !apps.some(a => a.name.toLowerCase() === b.name.toLowerCase())) apps.push({ name: b.name, icon: 'clock', draft: b.status === 'draft' }); });
} catch (e) {}
const list = document.getElementById('appList');
const portalNav = document.getElementById('portalNav');
apps.forEach(a => {
const row = document.createElement('div');
row.className = 'al-row';
row.innerHTML =
'<div class="al-ic">' + ICONS[a.icon] + '</div>' +
'<div class="al-name"><span class="label"></span>' + (a.draft ? '<span class="eye" title="Not visible to clients">' + EYE_OFF + '</span>' : '') + '</div>' +
'<div class="al-vis' + (a.draft ? ' off' : '') + '">' + (a.draft ? 'Not visible to clients' : 'Visible to all clients') + '</div>' +
'<button class="al-menu" type="button" aria-label="More">' + DOTS + '</button>';
row.querySelector('.label').textContent = a.name;
list.appendChild(row);
// Drafts aren't published to the client portal yet, so they're left out
// of the preview — they only live in the left list until published.
if (a.draft) return;
const pnav = document.createElement('div');
pnav.className = 'al-pnav-item';
pnav.innerHTML = ICONS[a.icon] + '<span class="label"></span>';
pnav.querySelector('.label').textContent = a.name;
portalNav.appendChild(pnav);
});
// Carry onboarding params across nav links + portal/add-app destinations.
const navParams = [];
['company','name','email','theme'].forEach(k => { const v = getHashParam(k); if (v) navParams.push(k + '=' + encodeURIComponent(v)); });
const navSuffix = navParams.length ? '#' + navParams.join('&') : '';
document.querySelectorAll('[data-nav]').forEach(a => { a.setAttribute('href', a.dataset.nav + navSuffix); });
const addApp = document.getElementById('addAppBtn'); if (addApp) addApp.addEventListener('click', () => { location.href = 'studio.html' + navSuffix; });
(function () {
const purl = 'portal.html' + navSuffix;
const op = document.querySelector('.open-portal'); if (op) op.addEventListener('click', () => { location.href = purl; });
document.querySelectorAll('.checklist-item').forEach(it => { if (it.textContent.indexOf('Explore the client experience') > -1) { it.style.cursor = 'pointer'; it.addEventListener('click', () => { location.href = purl; }); } });
})();
</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>