-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
623 lines (552 loc) · 21.5 KB
/
Copy pathadmin.html
File metadata and controls
623 lines (552 loc) · 21.5 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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>URANIII | Admin Dashboard</title>
<link rel="stylesheet" href="./style.css">
<script src="https://unpkg.com/@phosphor-icons/web"></script>
<!-- Quill.js for Rich Text -->
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<!-- Cropper.js for Image Cropping -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.1/cropper.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.1/cropper.min.js"></script>
<style>
/* Admin Specific Styles overriding some showcase styles */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance: textfield;
}
.admin-container {
padding: 20px 5% 50px 5%;
max-width: 1600px;
margin: 0 auto;
}
.tab-nav {
display: flex;
gap: 1rem;
border-bottom: 1px solid var(--border-subtle);
padding-bottom: 10px;
margin-bottom: 20px;
margin-top: 100px;
}
.btn-tab {
background: transparent;
border: none;
color: var(--text-muted);
font-weight: 600;
padding: 10px 20px;
cursor: pointer;
border-bottom: 2px solid transparent;
border-radius: 0;
}
.list-item[draggable="true"] {
cursor: grab;
}
.list-item:active {
cursor: grabbing;
}
.list-item.drag-over {
border-top: 2px solid var(--accent-color);
background: var(--bg-card-hover);
}
.btn-tab:hover {
color: var(--text-main);
background: rgba(255, 255, 255, 0.05);
}
.btn-tab.active {
color: var(--accent-color);
border-bottom-color: var(--accent-color);
}
.ql-toolbar {
background: var(--bg-secondary);
border-color: var(--border-subtle) !important;
}
.ql-toolbar button {
color: var(--text-main) !important;
}
.ql-container {
border-color: var(--border-subtle) !important;
font-family: var(--font-body);
font-size: 0.95rem;
}
.ql-editor.ql-blank::before {
color: var(--text-muted);
}
.panel {
background: var(--bg-card);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
padding: 1.5rem;
max-height: calc(100vh - 150px);
overflow-y: auto;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-subtle);
}
.btn {
padding: 8px 16px;
border-radius: 6px;
border: none;
background: var(--bg-secondary);
color: var(--text-main);
cursor: pointer;
font-weight: 500;
transition: background 0.2s;
display: inline-flex;
align-items: center;
gap: 6px;
}
.btn:hover {
background: var(--border-subtle);
}
.btn-primary {
background: var(--accent-gradient);
color: #000;
font-weight: 700;
}
.btn-primary:hover {
opacity: 0.9;
}
.btn-danger {
background: rgba(255, 50, 50, 0.1);
color: #ff5555;
}
.btn-danger:hover {
background: rgba(255, 50, 50, 0.2);
}
/* Form Styles */
.form-group {
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 6px;
font-size: 0.85rem;
color: var(--text-muted);
font-weight: 500;
}
input,
textarea,
select {
width: 100%;
background: var(--bg-secondary);
border: 1px solid var(--border-subtle);
color: var(--text-main);
padding: 10px 12px;
border-radius: 6px;
font-family: var(--font-body);
font-size: 0.95rem;
transition: border-color 0.2s;
}
input:focus,
textarea:focus,
select:focus {
outline: none;
border-color: var(--accent-color);
}
textarea {
resize: vertical;
min-height: 100px;
}
.spec-row {
display: flex;
gap: 10px;
margin-bottom: 10px;
}
/* Product List */
.list-item {
padding: 12px;
border: 1px solid var(--border-subtle);
border-radius: 6px;
margin-bottom: 10px;
cursor: pointer;
transition: all 0.2s;
display: flex;
justify-content: space-between;
align-items: center;
}
.list-item:hover,
.list-item.active {
border-color: var(--accent-color);
background: rgba(0, 210, 255, 0.05);
}
.list-item-title {
font-weight: 600;
margin-bottom: 4px;
}
.list-item-category {
font-size: 0.75rem;
color: var(--text-muted);
}
.empty-state {
text-align: center;
padding: 3rem 1rem;
color: var(--text-muted);
}
/* Toast Notification */
.toast {
background: var(--text-main);
color: var(--bg-color);
padding: 12px 24px;
border-radius: 6px;
font-weight: 600;
margin-top: 10px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
transform: translateY(100%);
opacity: 0;
transition: all 0.3s ease;
}
.toast.show {
transform: translateY(0);
opacity: 1;
}
/* Login Overlay */
#login-overlay {
position: fixed;
inset: 0;
background: var(--bg-color);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
}
.login-box {
background: var(--bg-card);
padding: 2.5rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-subtle);
width: 100%;
max-width: 400px;
text-align: center;
}
.login-box h2 {
margin-bottom: 1.5rem;
font-family: var(--font-heading);
}
.login-box input {
margin-bottom: 1rem;
}
</style>
<script src="./admin.js" defer></script>
</head>
<body>
<div id="login-overlay">
<div class="login-box">
<h2><i class="ph ph-waves"></i> Master's Secret Vault</h2>
<p style="font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem;">Welcome back master Uraniii, lets
manage your audiophile stuff~~</p>
<form id="login-form">
<input type="text" id="login-username" placeholder="Username" required>
<input type="password" id="login-password" placeholder="Password" required>
<button type="submit" class="btn btn-primary"
style="width: 100%; justify-content: center; margin-top: 10px;">Login</button>
</form>
<div style="margin-top: 1rem;">
<a href="./index.html" style="color: var(--text-muted); font-size: 0.85rem; text-decoration: none;"><i
class="ph ph-arrow-left"></i> Back to Showcase</a>
</div>
</div>
</div>
<div id="admin-app" style="display: none;">
<header>
<div class="container nav-inner">
<a href="./index.html" class="logo">
<i class="ph ph-waves"></i> URANIII <span
style="font-size: 0.8rem; color: var(--text-muted); font-weight: 400; margin-left: 10px;">Admin
Dashboard</span>
</a>
<div class="nav-links">
<button id="btn-import-template" class="btn">
<i class="ph ph-file-code"></i> JSON Template
</button>
<button id="btn-import" class="btn">
<i class="ph ph-upload-simple"></i> Import JSON
</button>
<input type="file" id="file-import" accept=".json" style="display: none;">
<button id="btn-export" class="btn btn-primary">
<i class="ph ph-download-simple"></i> Export products.json
</button>
<button id="btn-logout" class="btn btn-danger" style="margin-left: 10px;">
<i class="ph ph-sign-out"></i> Logout
</button>
</div>
</div>
</header>
<div class="container" style="padding: 0 5%;">
<div class="tab-nav">
<button class="btn-tab active" data-target="tab-products">Products</button>
<button class="btn-tab" data-target="tab-journey">My Journey</button>
<button class="btn-tab" data-target="tab-aboutme">About Me</button>
<button class="btn-tab" data-target="tab-contact">Contact Manage</button>
<button class="btn-tab" data-target="tab-security">Security</button>
</div>
</div>
<main class="admin-container">
<!-- Tab: Products -->
<div id="tab-products" class="tab-content" style="display: grid; grid-template-columns: 350px 1fr; gap: 2rem;">
<!-- Sidebar: Product List -->
<aside class="panel">
<div class="panel-header">
<h3>Products</h3>
<button id="btn-add-new" class="btn"><i class="ph ph-plus"></i> New</button>
</div>
<div id="admin-product-list">
<!-- List populated by JS -->
</div>
</aside>
<!-- Editor -->
<section class="panel">
<div class="panel-header">
<h3 id="editor-title">Edit Product</h3>
<button id="btn-delete" class="btn btn-danger" style="display: none;">
<i class="ph ph-trash"></i> Delete
</button>
</div>
<div id="editor-content" class="empty-state">
Select a product to edit or create a new one.
</div>
<form id="product-form" style="display: none;">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
<div class="form-group">
<label for="prod-id">Product ID (Unique, lowercase, hyphens)</label>
<input type="text" id="prod-id" required placeholder="e.g. fiio-fx17">
</div>
<div class="form-group">
<label for="prod-name">Product Name</label>
<input type="text" id="prod-name" required>
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
<div class="form-group">
<label for="prod-category">Category</label>
<input type="text" id="prod-category" required placeholder="e.g. In-Ear Monitor">
</div>
<div class="form-group">
<label for="prod-price">Price (USD)</label>
<input type="number" id="prod-price" step="0.01" required>
</div>
</div>
<div class="form-group">
<label>Description</label>
<div id="prod-desc-editor"
style="height: 150px; background: var(--bg-secondary); color: var(--text-main);"></div>
</div>
<div class="form-group">
<label>Images (Upload or Add URL)</label>
<div style="display: flex; gap: 10px; margin-bottom: 10px;">
<input type="file" id="prod-image-upload" multiple accept="image/*" style="flex: 1;">
<input type="url" id="prod-image-url" placeholder="Add Image URL..." style="flex: 2;">
<button type="button" id="btn-add-image-url" class="btn">Add URL</button>
</div>
<div id="images-container" style="display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;">
<!-- Image previews will appear here -->
</div>
</div>
<div class="form-group">
<label for="prod-model">3D Model URL (.glb) - Optional</label>
<input type="url" id="prod-model" placeholder="https://...">
</div>
<div class="form-group">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
<label style="margin: 0;">Technical Specs</label>
<button type="button" id="btn-add-spec" class="btn"><i class="ph ph-plus"></i> Add Spec</button>
</div>
<div id="specs-container">
<!-- Spec rows injected here -->
</div>
</div>
<div
style="margin-top: 2rem; border-top: 1px solid var(--border-subtle); padding-top: 1rem; display: flex; justify-content: flex-end; gap: 1rem;">
<button type="button" id="btn-cancel" class="btn">Cancel</button>
<button type="submit" class="btn btn-primary">Save Product</button>
</div>
</form>
</section>
</div> <!-- End Tab: Products -->
<!-- Tab: My Journey (Timeline) -->
<div id="tab-journey" class="tab-content" style="display: none; grid-template-columns: 300px 1fr; gap: 2rem;">
<aside class="panel">
<div class="panel-header" style="flex-wrap: wrap; gap: 10px;">
<h3>Timeline Events</h3>
<button id="btn-add-timeline" class="btn"><i class="ph ph-plus"></i> New</button>
<div style="display: flex; gap: 10px; width: 100%; margin-top: 10px;">
<button id="btn-export-timeline" class="btn btn-primary" style="flex: 1; font-size: 0.8rem;">Export
JSON</button>
<button id="btn-import-timeline" class="btn" style="flex: 1; font-size: 0.8rem;">Import JSON</button>
<input type="file" id="file-import-timeline" accept=".json" style="display: none;">
</div>
</div>
<div id="admin-timeline-list">
<!-- Timeline items populated by JS -->
</div>
</aside>
<section class="panel">
<div class="panel-header">
<h3 id="timeline-editor-title">Edit Timeline Event</h3>
<button id="btn-delete-timeline" class="btn btn-danger" style="display: none;">
<i class="ph ph-trash"></i> Delete
</button>
</div>
<div id="timeline-editor-content" class="empty-state">
Select a timeline event to edit or create a new one.
</div>
<form id="timeline-form" style="display: none;">
<div class="form-group" style="display: flex; gap: 15px;">
<div style="flex: 1;">
<label for="tl-year">Year</label>
<input type="number" id="tl-year" class="input-field" required placeholder="e.g. 2026" min="0">
</div>
<div style="flex: 2;">
<label for="tl-title">Title (Optional)</label>
<input type="text" id="tl-title" class="input-field" placeholder="e.g. The Peak Upgrades">
</div>
</div>
<div class="form-group">
<label>Content</label>
<div id="tl-desc-editor" style="height: 150px; background: var(--bg-secondary); color: var(--text-main);">
</div>
</div>
<div class="form-group">
<label style="font-weight: 600;">Timeline Images (Square 1:1 Recommended)</label>
<div style="display: flex; gap: 10px; align-items: center; margin-bottom: 15px;">
<input type="file" id="tl-image-upload" accept="image/*" class="input-field" style="max-width: 300px;">
<span style="font-size: 0.85rem; color: var(--text-muted);">or</span>
<button type="button" id="btn-import-timeline-img-url" class="btn btn-primary"
style="padding: 10px; background: #333;">Add by URL</button>
</div>
<div id="tl-images-container" style="display: flex; gap: 15px; flex-wrap: wrap; margin-top: 15px;">
<!-- Cropped/Uploaded timeline images previewed here -->
</div>
</div>
<div
style="margin-top: 2rem; border-top: 1px solid var(--border-subtle); padding-top: 1rem; display: flex; justify-content: flex-end; gap: 1rem;">
<button type="button" id="btn-cancel-timeline" class="btn">Cancel</button>
<button type="submit" class="btn btn-primary">Save Event</button>
</div>
</form>
</section>
</div>
<!-- Tab: About Me -->
<div id="tab-aboutme" class="tab-content panel" style="display: none;">
<div class="panel-header">
<h3>Edit About Me</h3>
</div>
<div class="form-group">
<label>Bio (HTML Supported)</label>
<div id="bio-editor" style="height: 300px; background: var(--bg-secondary); color: var(--text-main);"></div>
</div>
<div style="margin-top: 1rem; text-align: right;">
<button id="btn-save-bio" class="btn btn-primary">Save Bio</button>
</div>
</div>
<!-- Tab: Contact Manage -->
<div id="tab-contact" class="tab-content panel" style="display: none;">
<div class="panel-header">
<h3>Manage Social Links</h3>
</div>
<div style="max-width: 600px;">
<div class="form-group">
<label><i class="ph-fill ph-discord-logo"
style="color: #5865F2; font-size: 1.1rem; vertical-align: middle; margin-right: 4px;"></i> Discord
URL</label>
<input type="url" id="social-discord" placeholder="https://discord.gg/...">
</div>
<div class="form-group">
<label><i class="ph-fill ph-facebook-logo"
style="color: #1877F2; font-size: 1.1rem; vertical-align: middle; margin-right: 4px;"></i> Facebook
URL</label>
<input type="url" id="social-facebook" placeholder="https://facebook.com/...">
</div>
<div class="form-group">
<label><i class="ph-fill ph-youtube-logo"
style="color: #FF0000; font-size: 1.1rem; vertical-align: middle; margin-right: 4px;"></i> YouTube
URL</label>
<input type="url" id="social-youtube" placeholder="https://youtube.com/...">
</div>
<div class="form-group">
<label><i class="ph-fill ph-instagram-logo"
style="color: #E1306C; font-size: 1.1rem; vertical-align: middle; margin-right: 4px;"></i> Instagram
URL</label>
<input type="url" id="social-instagram" placeholder="https://instagram.com/...">
</div>
<div class="form-group">
<label><i class="ph-fill ph-envelope"
style="color: #999999; font-size: 1.1rem; vertical-align: middle; margin-right: 4px;"></i> Email
Address</label>
<input type="email" id="social-email" placeholder="hello@example.com">
</div>
<div style="margin-top: 1rem; text-align: right;">
<button id="btn-save-socials" class="btn btn-primary">Save Contacts</button>
</div>
</div>
</div>
<!-- Tab: Security -->
<div id="tab-security" class="tab-content panel" style="display: none;">
<div class="panel-header">
<h3>Change Admin Password</h3>
</div>
<div style="max-width: 400px;">
<form id="password-form">
<div class="form-group">
<label>Current Password</label>
<input type="password" id="sec-current-pass" required>
</div>
<div class="form-group">
<label>New Password</label>
<input type="password" id="sec-new-pass" required>
</div>
<div class="form-group">
<label>Confirm New Password</label>
<input type="password" id="sec-confirm-pass" required>
</div>
<div style="margin-top: 1rem; text-align: right;">
<button type="submit" class="btn btn-primary">Update Password</button>
</div>
</form>
</div>
</div>
</main>
</div>
<div id="toast-container"
style="position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column;"></div>
<!-- Image Cropper Modal -->
<div id="cropper-modal"
style="display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 10000; align-items: center; justify-content: center;">
<div
style="background: var(--bg-card); padding: 20px; border-radius: var(--radius-md); max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column;">
<h3 style="margin-bottom: 10px;">Crop & Rotate Image</h3>
<div style="margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap;">
<button id="btn-aspect-free" class="btn"
style="padding: 5px 10px; font-size: 0.8rem; border-color: var(--accent-color);">Free</button>
<button id="btn-aspect-1-1" class="btn" style="padding: 5px 10px; font-size: 0.8rem;">1:1 (Square)</button>
<button id="btn-aspect-3-4" class="btn" style="padding: 5px 10px; font-size: 0.8rem;">3:4</button>
<button id="btn-aspect-16-9" class="btn" style="padding: 5px 10px; font-size: 0.8rem;">16:9</button>
</div>
<div style="flex: 1; min-height: 0; overflow: hidden; max-height: 60vh;">
<img id="cropper-image" style="max-width: 100%; display: block;">
</div>
<div style="margin-top: 15px; display: flex; gap: 10px; justify-content: space-between; align-items: center;">
<div>
<button id="btn-rotate-left" class="btn"><i class="ph ph-arrow-counter-clockwise"></i> Rotate</button>
<button id="btn-rotate-right" class="btn"><i class="ph ph-arrow-clockwise"></i> Rotate</button>
</div>
<div>
<button id="btn-cancel-crop" class="btn">Cancel</button>
<button id="btn-save-crop" class="btn btn-primary">Apply Crop</button>
</div>
</div>
</div>
</div>
</body>
</html>