-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.html
More file actions
460 lines (433 loc) · 25.2 KB
/
Copy pathedit.html
File metadata and controls
460 lines (433 loc) · 25.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Beacon Editor • Visual Config Builder for Link in Bio</title>
<meta name="description" content="Visual editor for Beacon link in bio template. Drag-and-drop links, change themes, edit profile data, and deploy directly to GitHub.">
<meta name="keywords" content="beacon editor, bio link editor, linktree admin dashboard, static bio link builder">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://beacon.shazee.dev/edit.html">
<link rel="icon" href="assets/icons/beacon.png" type="image/x-icon">
<!-- Fonts & Icons -->
<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&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet">
<link rel="stylesheet" href="edit.css">
<script src="config.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
</head>
<body>
<!-- Welcome/Awareness Modal -->
<div id="welcome-modal" class="modal-overlay" style="display: none;">
<div class="modal-content">
<h2>Automate Your Setup</h2>
<p style="margin: 12px 0; color: var(--text-muted); line-height: 1.5;">Welcome to the Bio Link Editor! Did you know you can automate file uploads and config deployments directly to GitHub?</p>
<p style="margin-bottom: 24px; color: var(--text-muted); line-height: 1.5;">To enable this, head over to the <strong>Settings</strong> tab and add your GitHub Personal Access Token.</p>
<div class="modal-actions" style="display:flex; justify-content:flex-end; gap:12px;">
<button class="btn btn-secondary" id="btn-dismiss-modal">Dismiss</button>
<button class="btn btn-primary" id="btn-go-settings">Go to Settings</button>
</div>
</div>
</div>
<div class="admin-layout">
<!-- Sidebar Navigation -->
<aside class="sidebar">
<div class="sidebar-header">
<h2>Bio Link Editor</h2>
</div>
<nav class="sidebar-nav">
<button class="nav-btn active" data-tab="profile"><span class="material-symbols-outlined">person</span> Profile</button>
<button class="nav-btn" data-tab="skills"><span class="material-symbols-outlined">palette</span> Skills</button>
<button class="nav-btn" data-tab="socials"><span class="material-symbols-outlined">share</span> Socials</button>
<button class="nav-btn" data-tab="cta-footer"><span class="material-symbols-outlined">call_to_action</span> CTA</button>
<button class="nav-btn" data-tab="featured"><span class="material-symbols-outlined">featured_play_list</span> Featured</button>
<button class="nav-btn" data-tab="links"><span class="material-symbols-outlined">link</span> Links</button>
<button class="nav-btn" data-tab="theme"><span class="material-symbols-outlined">brush</span> Theme</button>
<button class="nav-btn" data-tab="seo"><span class="material-symbols-outlined">search</span> SEO</button>
<button class="nav-btn" data-tab="settings"><span class="material-symbols-outlined">settings</span> Settings</button>
<div class="spacer"></div>
<button class="nav-btn export-btn" data-tab="export"><span class="material-symbols-outlined">save</span> Save & Deploy</button>
</nav>
</aside>
<!-- Main Content Area -->
<main class="main-content">
<!-- Draft Warning Banner -->
<div id="draft-warning-banner" class="draft-warning-banner" style="display: none;">
<span class="material-symbols-outlined warning-icon" style="color: #f4b908;">warning</span>
<span>You are editing an unsaved local draft. Deploy or discard changes.</span>
</div>
<!-- Top Right Editor Controls -->
<div class="editor-controls-topright">
<button class="btn-discard-pill" id="btn-discard-draft-top" style="display: none;">
<span class="material-symbols-outlined">delete</span> Discard Changes
</button>
<div class="draft-status-pill saved" id="draft-status-indicator">
<span class="material-symbols-outlined status-icon">check_circle</span>
<span class="status-text">Saved</span>
</div>
</div>
<!-- Profile Tab -->
<div id="profile" class="tab-pane active">
<header class="pane-header">
<h3>Profile Settings</h3>
<p>Update your main identity information.</p>
</header>
<div class="form-group">
<label>Username</label>
<input type="text" id="prof-username" placeholder="shazee">
</div>
<div class="form-group">
<label>Name</label>
<input type="text" id="prof-name">
</div>
<div class="form-group">
<label>Title</label>
<input type="text" id="prof-title">
</div>
<div class="form-group">
<label>Bio</label>
<textarea id="prof-bio" rows="3"></textarea>
</div>
<div class="form-group">
<label>Avatar (URL or Monogram)</label>
<div style="display:flex; gap:8px;">
<input type="text" id="prof-avatar" style="flex:1;">
<input type="file" id="prof-avatar-file" accept="image/*" style="display:none;">
<button class="btn btn-secondary" onclick="document.getElementById('prof-avatar-file').click()" title="Upload to GitHub"><span class="material-symbols-outlined" style="font-size:18px;">upload_file</span></button>
</div>
<small id="avatar-upload-status" style="display:block; margin-top:4px; color:var(--primary); font-weight:500;"></small>
</div>
</div>
<!-- SEO Tab -->
<div id="seo" class="tab-pane">
<header class="pane-header">
<h3>SEO & Metadata Settings</h3>
<p>Customize Open Graph share links, meta tags, and search engine metadata.</p>
</header>
<div class="form-group">
<label>Canonical Site URL</label>
<input type="text" id="seo-site-url" placeholder="https://beacon.shazee.dev">
<small style="color:var(--text-muted); font-size:12px;">Your deployed URL (important for canonical tags and social sharing).</small>
</div>
<div class="form-group">
<label>Open Graph Share Image URL</label>
<input type="text" id="seo-og-image" placeholder="https://beacon.shazee.dev/assets/icons/Beacon.png">
<small style="color:var(--text-muted); font-size:12px;">Image displayed when sharing your bio link on Discord, Twitter, or WhatsApp.</small>
</div>
<div class="form-group">
<label>Twitter / X Handle</label>
<input type="text" id="seo-twitter-handle" placeholder="@shazee_04">
</div>
<div class="form-group">
<label>Meta Keywords</label>
<textarea id="seo-keywords" rows="2" placeholder="bio link, portfolio, linktree alternative"></textarea>
<small style="color:var(--text-muted); font-size:12px;">Comma-separated keywords for search engine indexing.</small>
</div>
<!-- Advanced SEO (Collapsible) -->
<div class="form-group mt-4">
<div class="list-item-header collapsed" onclick="toggleCollapse(this, 'ui', 'advanced-seo')" style="cursor:pointer; background:var(--surface); border:1px solid var(--border); padding:12px 16px; border-radius:8px; display:flex; justify-content:space-between; align-items:center;">
<div>
<h4 style="margin:0; font-size:14px; font-weight:600;">Advanced SEO Options</h4>
<small style="color:var(--text-muted); font-size:12px;">Leave blank to auto-generate from your profile data.</small>
</div>
<span class="material-symbols-outlined expand-icon">expand_more</span>
</div>
<div class="list-item-body collapsed" id="advanced-seo-body" style="border:1px solid var(--border); border-top:none; border-radius:0 0 8px 8px; padding:16px;">
<div class="form-group">
<label>Page Title Override</label>
<input type="text" id="seo-page-title" placeholder="e.g. My Custom Title | Link in Bio">
<small style="color:var(--text-muted); font-size:12px;">Overrides the auto-generated <title> tag.</small>
</div>
<div class="form-group">
<label>Meta Description Override</label>
<textarea id="seo-meta-desc" rows="2" placeholder="Custom description for search results..."></textarea>
<small style="color:var(--text-muted); font-size:12px;">Overrides the auto-generated description derived from your bio.</small>
</div>
<div class="grid-2">
<div class="form-group mb-0">
<label>Language</label>
<select id="seo-language">
<option value="en">English (en)</option>
<option value="es">Spanish (es)</option>
<option value="fr">French (fr)</option>
<option value="de">German (de)</option>
<option value="ja">Japanese (ja)</option>
<option value="zh">Chinese (zh)</option>
<option value="hi">Hindi (hi)</option>
<option value="ar">Arabic (ar)</option>
<option value="pt">Portuguese (pt)</option>
<option value="ru">Russian (ru)</option>
<option value="ko">Korean (ko)</option>
<option value="it">Italian (it)</option>
<option value="nl">Dutch (nl)</option>
<option value="tr">Turkish (tr)</option>
<option value="pl">Polish (pl)</option>
<option value="id">Indonesian (id)</option>
<option value="th">Thai (th)</option>
<option value="vi">Vietnamese (vi)</option>
</select>
<small style="color:var(--text-muted); font-size:12px;">HTML lang attribute.</small>
</div>
<div class="form-group mb-0">
<label>Theme Color Override</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="seo-theme-color-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;">
<input type="text" id="seo-theme-color" style="flex: 1;" placeholder="e.g. #222222">
</div>
<small style="color:var(--text-muted); font-size:12px;">Mobile browser tab color. Defaults to theme primary.</small>
</div>
</div>
</div>
</div>
</div>
<!-- Theme Tab -->
<div id="theme" class="tab-pane">
<header class="pane-header">
<h3>Theme Settings</h3>
<p>Customize the look and feel of your bio page.</p>
</header>
<div class="form-group">
<label>Theme Preset</label>
<select id="theme-preset" onchange="handleThemePresetChange(this.value)">
<option value="deep-indigo">Deep Indigo (Default)</option>
<option value="sunset-peach">Sunset Peach</option>
<option value="emerald-sage">Emerald Sage</option>
<option value="midnight-tech">Midnight Tech (Dark)</option>
<option value="monochrome-ink">Monochrome Ink</option>
<option value="cyberpunk-neon">Cyberpunk Neon</option>
<option value="abyss-slate">Abyss Slate</option>
<option value="forest-shadow">Forest Shadow</option>
<option value="custom">Custom Theme</option>
</select>
</div>
<div id="custom-theme-colors" style="display: none;">
<h4 style="margin: 24px 0 12px 0; font-size: 1rem; font-weight: 600;">Custom Colors</h4>
<div class="grid-2">
<div class="form-group">
<label>Primary Brand Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-primary-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('primary', this.value)">
<input type="text" id="theme-primary" style="flex: 1;" onchange="updateCustomColor('primary', this.value)">
</div>
</div>
<div class="form-group">
<label>Primary Hover Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-primaryHover-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('primaryHover', this.value)">
<input type="text" id="theme-primaryHover" style="flex: 1;" onchange="updateCustomColor('primaryHover', this.value)">
</div>
</div>
</div>
<div class="grid-2">
<div class="form-group">
<label>Secondary Accent Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-secondary-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('secondary', this.value)">
<input type="text" id="theme-secondary" style="flex: 1;" onchange="updateCustomColor('secondary', this.value)">
</div>
</div>
<div class="form-group">
<label>Tertiary Mesh Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-tertiary-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('tertiary', this.value)">
<input type="text" id="theme-tertiary" style="flex: 1;" onchange="updateCustomColor('tertiary', this.value)">
</div>
</div>
</div>
<div class="grid-2">
<div class="form-group">
<label>Background Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-bg-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('bg', this.value)">
<input type="text" id="theme-bg" style="flex: 1;" onchange="updateCustomColor('bg', this.value)">
</div>
</div>
<div class="form-group">
<label>Card Background</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-cardBg-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('cardBg', this.value)">
<input type="text" id="theme-cardBg" style="flex: 1;" onchange="updateCustomColor('cardBg', this.value)">
</div>
</div>
</div>
<div class="grid-2">
<div class="form-group">
<label>Border Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-border-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('border', this.value)">
<input type="text" id="theme-border" style="flex: 1;" onchange="updateCustomColor('border', this.value)">
</div>
</div>
<div class="form-group">
<label>Text Main Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-textMain-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('textMain', this.value)">
<input type="text" id="theme-textMain" style="flex: 1;" onchange="updateCustomColor('textMain', this.value)">
</div>
</div>
</div>
<div class="grid-2">
<div class="form-group">
<label>Text Muted Color</label>
<div style="display: flex; gap: 8px;">
<input type="color" id="theme-textMuted-picker" style="width: 42px; height: 42px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer;" oninput="updateCustomColor('textMuted', this.value)">
<input type="text" id="theme-textMuted" style="flex: 1;" onchange="updateCustomColor('textMuted', this.value)">
</div>
</div>
</div>
</div>
</div>
<!-- Skills Tab -->
<div id="skills" class="tab-pane">
<header class="pane-header">
<h3>Skills</h3>
<p>Manage the skill chips displayed under your identity.</p>
</header>
<div id="skills-list" class="list-container"></div>
<button class="btn btn-secondary mt-3" id="add-skill">
<span class="material-symbols-outlined">add</span> Add Skill
</button>
</div>
<!-- Socials Tab -->
<div id="socials" class="tab-pane">
<header class="pane-header">
<h3>Socials</h3>
<p>Quick action icons on your profile card.</p>
</header>
<div id="socials-list" class="list-container"></div>
<button class="btn btn-secondary mt-3" id="add-social">
<span class="material-symbols-outlined">add</span> Add Social
</button>
</div>
<!-- Featured Tab -->
<div id="featured" class="tab-pane">
<header class="pane-header">
<h3>Featured Items</h3>
<p>Highlight your best projects or products in a rich grid layout.</p>
</header>
<div class="form-group">
<label>Featured Section Title</label>
<input type="text" id="featured-title-input" placeholder="e.g. Featured Projects">
</div>
<div id="featured-list" class="list-container"></div>
<button class="btn btn-secondary mt-3" id="add-featured">
<span class="material-symbols-outlined">add</span> Add Featured Item
</button>
</div>
<!-- Links Tab -->
<div id="links" class="tab-pane">
<header class="pane-header">
<h3>Primary Links</h3>
<p>Your main vertical links and sublinks.</p>
</header>
<div id="links-list" class="list-container"></div>
<button class="btn btn-secondary mt-3" id="add-link">
<span class="material-symbols-outlined">add</span> Add Link
</button>
</div>
<!-- CTA & Footer Tab -->
<div id="cta-footer" class="tab-pane">
<header class="pane-header">
<h3>CTA Buttons</h3>
<p>Manage the Call-To-Action buttons on your profile card.</p>
</header>
<div id="ctas-list" class="list-container"></div>
<button class="btn btn-secondary mt-3 mb-5" id="add-cta">
<span class="material-symbols-outlined">add</span> Add CTA Button
</button>
</div>
<!-- Export Tab -->
<div id="export" class="tab-pane">
<header class="pane-header">
<h3>Deploy Configuration</h3>
<p>Deploy directly to GitHub, or generate the code to copy manually.</p>
</header>
<div class="export-actions mb-3 mt-4">
<button class="btn btn-primary" id="btn-deploy" style="background-color: #2da44e; color: #fff;">
<span class="material-symbols-outlined">cloud_upload</span> Deploy to GitHub
</button>
</div>
<div id="deploy-status" style="margin-top: 12px; margin-bottom: 32px; font-size: 0.9rem; font-weight: 500;"></div>
<header class="pane-header" style="border-top: 1px solid var(--border); padding-top: 32px;">
<h3>Manual Export</h3>
<p>Generate both configuration and the main HTML file. Download and replace them in your repository.</p>
</header>
<div class="export-actions mb-3">
<button class="btn btn-primary" id="btn-generate">
<span class="material-symbols-outlined">sync</span> Generate Code
</button>
</div>
<div id="export-areas" style="display:none;">
<h4 style="font-size: 14px; margin-bottom: 8px;">1. config.js</h4>
<div class="export-actions mb-2" style="justify-content: flex-start; gap: 8px;">
<button class="btn btn-secondary btn-sm" id="btn-copy-config">
<span class="material-symbols-outlined" style="font-size: 16px;">content_copy</span> Copy
</button>
<button class="btn btn-secondary btn-sm" id="btn-download-config">
<span class="material-symbols-outlined" style="font-size: 16px;">download</span> Download config.js
</button>
</div>
<textarea id="export-code-config" class="code-area mb-4" readonly placeholder="Your generated config.js will appear here..."></textarea>
<h4 style="font-size: 14px; margin-bottom: 8px;">2. index.html (SEO Optimized)</h4>
<div class="export-actions mb-2" style="justify-content: flex-start; gap: 8px;">
<button class="btn btn-secondary btn-sm" id="btn-copy-index">
<span class="material-symbols-outlined" style="font-size: 16px;">content_copy</span> Copy
</button>
<button class="btn btn-secondary btn-sm" id="btn-download-index">
<span class="material-symbols-outlined" style="font-size: 16px;">download</span> Download index.html
</button>
</div>
<textarea id="export-code-index" class="code-area mb-4" readonly placeholder="Your generated index.html will appear here..."></textarea>
<h4 style="font-size: 14px; margin-bottom: 8px;">3. sitemap.xml</h4>
<div class="export-actions mb-2" style="justify-content: flex-start; gap: 8px;">
<button class="btn btn-secondary btn-sm" id="btn-copy-sitemap">
<span class="material-symbols-outlined" style="font-size: 16px;">content_copy</span> Copy
</button>
<button class="btn btn-secondary btn-sm" id="btn-download-sitemap">
<span class="material-symbols-outlined" style="font-size: 16px;">download</span> Download sitemap.xml
</button>
</div>
<textarea id="export-code-sitemap" class="code-area" readonly placeholder="Your generated sitemap.xml will appear here..."></textarea>
</div>
</div>
<!-- Settings Tab -->
<div id="settings" class="tab-pane">
<header class="pane-header">
<h3>GitHub Integration</h3>
<p>Automate your deployments and file uploads directly to your GitHub repository.</p>
</header>
<div class="form-group">
<label>GitHub Username</label>
<div style="position:relative;">
<input type="text" id="gh-username" placeholder="e.g. shazee-04">
<span id="saved-bioLinkGhUsername" style="position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:0.75rem; font-weight:600; opacity:0; transition:opacity 0.3s; pointer-events:none; color: var(--text-muted);">Saved</span>
</div>
</div>
<div class="form-group">
<label>Repository Name</label>
<div style="position:relative;">
<input type="text" id="gh-repo" placeholder="e.g. bio-link">
<span id="saved-bioLinkGhRepo" style="position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:0.75rem; font-weight:600; opacity:0; transition:opacity 0.3s; pointer-events:none; color: var(--text-muted);">Saved</span>
</div>
</div>
<div class="form-group">
<label>Personal Access Token <a href="https://github.com/settings/tokens/new?scopes=repo" target="_blank" style="font-size: 0.8rem; text-decoration: underline; color: blue;">(create one)</a></label>
<div style="position:relative;">
<input type="password" id="gh-token" placeholder="ghp_xxxxxxxxxxxx" style="width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.9rem; background: var(--surface); color: var(--text-main);">
<span id="saved-bioLinkGhToken" style="position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:0.75rem; font-weight:600; opacity:0; transition:opacity 0.3s; pointer-events:none; color: var(--text-muted);">Saved</span>
</div>
<small style="display:block; margin-top: 4px; color: var(--text-muted); font-size: 0.8rem;">Your token is saved securely in your browser's local storage and is never sent to any third-party server.</small>
</div>
</div>
</main>
<!-- Preview Panel -->
<div class="preview-panel">
<div class="phone-simulator">
<iframe id="preview-iframe" src="index.html"></iframe>
</div>
</div>
</div>
<script src="edit.js"></script>
</body>
</html>