-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
628 lines (561 loc) · 31.6 KB
/
admin.html
File metadata and controls
628 lines (561 loc) · 31.6 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
624
625
626
627
628
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard | KumoFumi by Zeon</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<link rel="stylesheet" href="css/admin.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.31/jspdf.plugin.autotable.min.js"></script>
<script src="https://cdn.sheetjs.com/xlsx-0.20.1/package/dist/xlsx.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script type="module" src="js/admin.js"></script>
<script src="js/dark-mode.js"></script>
</head>
<body>
<div class="admin-container">
<!-- Field Editor Sidebar -->
<aside class="sidebar">
<div class="sidebar-header">
<h2>Admin Panel</h2>
<button id="themeToggle"
style="background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:1.2rem;">
<i class="fa-solid fa-moon"></i>
</button>
</div>
<nav class="sidebar-nav">
<ul class="nav-links">
<li class="nav-item active" data-tab="library">
<i class="fa-solid fa-folder-open"></i> My Forms
</li>
<li class="nav-item hidden" data-tab="builder">
<i class="fa-solid fa-pen-to-square"></i> Form Builder
</li>
<li class="nav-item hidden" data-tab="responses">
<i class="fa-solid fa-table"></i> Responses
</li>
</ul>
</nav>
<!-- Creator Showcase -->
<div class="sidebar-footer">
<div class="creator-label">Creator of KumoFumi</div>
<div class="creator-profile">
<img src="img/dp.jpg" alt="Creator" class="creator-avatar">
<div class="creator-info">
<strong>Zeon</strong>
<span class="creator-role">Developer</span>
</div>
</div>
<div class="social-links">
<a href="https://github.com/ZEON-07" class="social-link" title="GitHub"><i
class="fa-brands fa-github"></i></a>
<a href="https://linkedin.com/in/adithyan07" class="social-link" title="LinkedIn"><i
class="fa-brands fa-linkedin"></i></a>
<a href="https://instagram.com/zeon_ig" class="social-link" title="Instagram"><i
class="fa-brands fa-instagram"></i></a>
<a href="https://mail.google.com/mail/?view=cm&to=mr.adhi125@gmail.com" target="_blank"
class="social-link" title="Email">
<i class="fa-solid fa-envelope"></i>
</a>
</div>
</div>
</aside>
<!-- Main Content -->
<main class="main-content">
<div class="tab-content">
<!-- SECTION: MY FORMS (LIBRARY) -->
<section id="library" class="tab-pane active">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:20px;">
<h3 style="margin:0;"><i class="fa-solid fa-folder-open"></i> My Forms</h3>
<button id="addFormBtn" class="btn btn-primary">
<i class="fa-solid fa-plus"></i> Add Form
</button>
</div>
<div id="formsLibraryList"
style="display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:20px; margin-top:20px;">
<!-- Dynamic Forms Cards -->
<div style="text-align:center; padding:40px; color:#999; grid-column: 1/-1;">
<i class="fa-regular fa-folder-open" style="font-size:2rem; margin-bottom:10px;"></i>
<p>No saved forms yet.</p>
</div>
</div>
</section>
<!-- SECTION: BUILDER -->
<section id="builder" class="tab-pane">
<div class="card">
<h3>Form Builder</h3>
<p class="hint">Add, edit, and reorder form fields. Drag to reorder.</p>
<div id="fieldBuilderList" class="builder-list"></div>
<button id="openAddSidebarBtn" class="btn btn-primary" style="width:100%; margin-top:15px;">
<i class="fa-solid fa-plus"></i> Add Field
</button>
</div>
<!-- Design & Theme Section -->
<div class="card" style="margin-top:20px;">
<h3><i class="fa-solid fa-palette"></i> Design & Theme</h3>
<p class="hint">Customize the appearance of this form.</p>
<div class="form-group">
<label>Form Title</label>
<input type="text" id="formTitleInput" placeholder="e.g., Workshop Registration 2025">
<p class="hint">The main heading displayed on the form page.</p>
</div>
<div class="form-group">
<label>Webpage Title</label>
<input type="text" id="webTitleInput" placeholder="e.g., Workshop | Register Now">
<p class="hint">The title as it appears in the browser tab.</p>
</div>
<div class="form-group">
<label>Form Description</label>
<textarea id="formDescInput" rows="3"
placeholder="e.g., Join us for an amazing workshop experience!"></textarea>
<p class="hint">Optional description shown below the title.</p>
</div>
<div class="form-group">
<label>Response Limit (Optional)</label>
<input type="number" id="responseLimitInput" placeholder="e.g., 100" min="1">
<p class="hint">Automatically close the form after this many responses. Leave empty for no
limit.</p>
</div>
<div class="form-group checkbox-toggle" style="margin-top: 15px;">
<label style="display:flex; align-items:center; cursor:pointer; font-weight: 500;">
<input type="checkbox" id="allowMultipleResponsesInput" checked
style="width:20px; height:20px; margin-right:10px;">
Allow multiple responses
</label>
<p class="hint">Shows a "Submit another response" button on the success screen.</p>
</div>
<hr style="margin:20px 0; border:0; border-top:1px solid var(--border);">
<div class="form-group">
<label>Theme Color</label>
<div class="color-picker-wrapper">
<input type="color" id="themeColorPicker" value="#db4437">
<span id="colorValue">#db4437</span>
</div>
<p class="hint">Updates accent color and custom cursor.</p>
</div>
<div class="form-group">
<label>Header Banner</label>
<input type="file" id="bannerUpload" accept="image/*">
<button id="removeBanner" class="btn btn-outline-danger btn-sm"
style="margin-top:5px;">Remove
Banner</button>
</div>
<div class="form-group">
<label>Club Logo</label>
<button id="manageLogoBtn" class="btn btn-outline-primary" style="width:100%;">
<i class="fa-solid fa-image"></i> Manage / Upload Logo
</button>
<div id="logoUploadSection"
style="display:none; margin-top:10px; padding:10px; border:1px solid var(--border); border-radius:8px;">
<label style="font-size:0.9rem; font-weight:500;">Light Mode Logo</label>
<input type="file" id="logoLightUpload" accept="image/*" style="margin-bottom:10px;">
<label style="font-size:0.9rem; font-weight:500;">Dark Mode Logo</label>
<input type="file" id="logoDarkUpload" accept="image/*">
</div>
</div>
<hr style="margin:20px 0; border:0; border-top:1px solid var(--border);">
<div class="config-card">
<div class="config-title">
<span><i class="fa-solid fa-cloud"></i> Cloudinary Asset Storage</span>
<a href="https://cloudinary.com/documentation/unsigned_upload" target="_blank"
id="cloudinaryHelpLink" class="help-badge">
<i class="fa-solid fa-circle-info"></i> How to connect?
</a>
</div>
<p class="hint" style="margin-bottom:20px; font-size: 0.85rem;">Required for the
<strong>"File
Upload"</strong> field type to store assets securely.
</p>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
<div>
<label>Cloud Name</label>
<input type="text" id="cloudinaryCloudName" class="cloudinary-input"
placeholder="e.g., dxk7sh8w">
</div>
<div>
<label>Upload Preset</label>
<input type="text" id="cloudinaryPreset" class="cloudinary-input"
placeholder="e.g., ml_default">
</div>
</div>
<p class="hint" style="margin-top:5px; font-style: italic;">
<i class="fa-solid fa-key" style="font-size: 0.75rem; margin-right: 4px;"></i>
Find these in Cloudinary Dashboard > Settings > Upload
</p>
</div>
<button id="removeLogosBtn" class="btn btn-outline-danger btn-sm"
style="margin-top:5px; width:100%;">
Remove Logos
</button>
</div>
<!-- Save Button at Bottom -->
<button id="saveToLibraryBtn" class="btn btn-success"
style="margin: 30px auto 10px; font-size: 1rem; padding: 12px 24px; min-width: 250px; display: block; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);">
<i class="fa-solid fa-floppy-disk"></i> Save Form to Library
</button>
</section>
<!-- SECTION: RESPONSES (Integrated Tab) -->
<section id="responses" class="tab-pane">
<div id="responsesPanel" class="responses-panel">
<div class="responses-header">
<h2>Responses</h2>
<div class="responses-header-actions">
<div class="export-dropdown">
<button id="exportDropdownBtn" class="btn btn-outline-primary btn-sm">
<i class="fa-solid fa-file-export"></i> Export <i
class="fa-solid fa-chevron-down"
style="font-size: 0.7rem; margin-left: 4px;"></i>
</button>
<div id="exportMenu" class="dropdown-menu">
<button class="dropdown-item" id="exportCsvBtn">
<i class="fa-solid fa-file-csv"></i> CSV
</button>
<button class="dropdown-item" id="exportExcelBtn">
<i class="fa-solid fa-file-excel"></i> Excel (XLSX)
</button>
<button class="dropdown-item" id="exportPdfBtn">
<i class="fa-solid fa-file-pdf"></i> PDF Report
</button>
</div>
</div>
<button id="clearResponsesBtn" class="btn btn-outline-danger btn-sm">
<i class="fa-solid fa-trash-can"></i> Clear All
</button>
<button onclick="closeResponses()" class="btn btn-outline-danger btn-sm">
<i class="fa-solid fa-xmark"></i> Close
</button>
</div>
</div>
<div class="responses-toolbar">
<div class="search-box">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="text" id="responseSearchInput" placeholder="Search responses...">
</div>
<div class="view-toggles">
<button id="viewTableBtn" class="btn btn-sm active">
<i class="fa-solid fa-table"></i> Table
</button>
<button id="viewStatsBtn" class="btn btn-sm">
<i class="fa-solid fa-chart-pie"></i> Stats
</button>
<button id="viewIndividualBtn" class="btn btn-sm">
<i class="fa-solid fa-user"></i> Individual
</button>
</div>
<button id="toggleFilterBtn" class="btn btn-outline-secondary btn-sm">
<i class="fa-solid fa-filter"></i> Filters
</button>
<div class="sort-box" style="display: flex; align-items: center; gap: 8px;">
<label
style="font-size: 0.8rem; color: var(--text-muted); font-weight: 500;">Sort:</label>
<select id="responseSortOrder" class="modal-input filter-select"
style="margin: 0; padding: 6px 30px 6px 12px; font-size: 0.85rem; min-width: 140px;">
<option value="desc">Newest First</option>
<option value="asc">Oldest First</option>
</select>
</div>
</div>
<div id="filterPanel" class="filter-panel">
<div class="filter-header">
<h4 class="filter-title">Active Filters</h4>
<button id="clearFiltersBtn" class="btn btn-link btn-sm"
style="color:var(--text-muted); padding:0; text-decoration:none;">Clear All</button>
</div>
<div id="filterList" class="filter-list">
<!-- Dynamic filters will go here -->
</div>
</div>
<div id="statsView" class="stats-view">
<div id="statsContent" class="stats-content">
<!-- Aggregated stats will go here -->
</div>
</div>
<div id="individualView" class="stats-view"
style="display:none; max-width:800px; margin:0 auto;">
<div class="filter-header"
style="margin-bottom:20px; background:var(--bg-secondary); padding:10px 15px; border-radius:var(--radius); border:1px solid var(--border);">
<div style="display:flex; align-items:center; gap:15px;">
<button id="prevEntryBtn" class="btn btn-sm btn-outline-secondary"><i
class="fa-solid fa-chevron-left"></i></button>
<span id="entryCounter"
style="font-size:0.9rem; font-weight:600; color:var(--text-main);">Entry 0 of
0</span>
<button id="nextEntryBtn" class="btn btn-sm btn-outline-secondary"><i
class="fa-solid fa-chevron-right"></i></button>
</div>
<div id="entryTimestamp" style="font-size:0.85rem; color:var(--text-muted);"></div>
</div>
<div id="individualEntryContent" class="card"
style="margin:0; padding:25px; border-radius:var(--radius);">
<!-- Single entry fields will go here -->
</div>
</div>
<div id="responsesMeta" class="responses-meta"></div>
<div id="responsesTable" class="responses-table-wrapper"></div>
</div>
</section>
</div>
<!-- Admin Footer -->
<div class="admin-footer">
<p>© <span id="currentYear">2026</span> KumoFumi Cloud Forms by Zeon. All rights reserved.</p>
</div>
<script>
document.getElementById('currentYear').textContent = new Date().getFullYear();
</script>
</main>
<!-- Mobile Menu Toggle -->
<button class="mobile-menu-toggle" id="mobileMenuToggle" aria-label="Toggle Menu">
<i class="fa-solid fa-bars"></i>
</button>
</div>
<!-- Field Editor Sidebar (Popup) -->
<div id="editorSidebar" class="editor-sidebar">
<div class="sidebar-content">
<div class="sidebar-header-panel">
<h3 id="sidebarTitle">Edit Field</h3>
<span class="close-sidebar">×</span>
</div>
<div class="sidebar-body">
<div class="form-group">
<label>Field Label</label>
<input type="text" id="editLabel" placeholder="e.g., T-Shirt Size">
</div>
<div class="form-group">
<label>Field Type</label>
<select id="editType">
<option value="text">Short Text</option>
<option value="textarea">Long Text</option>
<option value="email">Email</option>
<option value="tel">Phone Number</option>
<option value="radio">Single Choice (Radio)</option>
<option value="checkbox_group">Multiple Choice (Checkbox)</option>
<option value="select">Dropdown</option>
<option value="date">Date (Calendar Picker)</option>
<option value="checkbox">Confirmation (Single Checkbox)</option>
<option value="description">Description Text (No Input)</option>
<option value="success_link">Success Page Link (WhatsApp)</option>
<option value="image">Display Image (QR/Banner)</option>
<option value="file">File Upload (PDF/IMG)</option>
</select>
</div>
<div id="mediaUrlContainer" class="form-group theme-hint-box"
style="display:none; padding:10px; border:1px solid var(--border); border-radius:4px; margin-bottom: 15px;">
<label>Image Source URL</label>
<input type="text" id="editMediaUrl" placeholder="https://example.com/qr-code.png"
style="margin-bottom: 10px;">
<div id="sidebarImagePreviewContainer"
style="margin-bottom: 15px; display: none; text-align: center; background: var(--bg-body); padding: 10px; border-radius: 6px; border: 1px solid var(--border);">
<img id="sidebarImagePreview" src=""
style="max-width: 100%; max-height: 150px; border-radius: 4px; display: block; margin: 0 auto;">
</div>
<label style="font-size: 0.8rem; opacity: 0.8;">Or Upload Image</label>
<input type="file" id="editImageUpload" accept="image/*" style="font-size: 0.8rem;">
<p style="margin-top: 5px; font-size: 0.75rem; color: #ea580c; font-style: italic;">
<i class="fa-solid fa-circle-exclamation"></i> Direct upload is W.I.P. Please use "Image Source
URL" for stable results.
</p>
<p id="imageUploadStatus" class="hint" style="margin-top: 5px; font-weight: 500;"></p>
</div>
<div id="linkUrlContainer" class="form-group theme-hint-box"
style="display:none; padding:10px; border:1px solid var(--border); border-radius:4px; margin-bottom: 15px;">
<label>Link URL (e.g., WhatsApp Group)</label>
<input type="text" id="editLinkUrl" placeholder="https://chat.whatsapp.com/...">
</div>
<div class="form-group checkbox-toggle">
<label style="display:flex; align-items:center; cursor:pointer;">
<input type="checkbox" id="editRequired" style="width:20px; height:20px; margin-right:10px;">
Make this field mandatory
</label>
</div>
<!-- Options Editor (for Radio/Checkbox/Select) -->
<div id="optionsContainer"
style="display:none; border-top:1px solid var(--border); padding-top:15px; margin-top:15px;">
<label>Options</label>
<div id="optionsList"></div>
<button id="addOptionBtn" class="btn btn-sm btn-outline-primary" style="margin-top:10px;">+ Add
Option</button>
</div>
</div>
<div class="sidebar-footer-panel">
<button id="deleteFieldBtn" class="btn btn-outline-danger" style="margin-right:auto;">Delete</button>
<button id="saveFieldBtn" class="btn btn-primary" style="width:140px;">Save Field</button>
</div>
</div>
</div>
<div id="sidebarOverlay" class="sidebar-overlay"></div>
<!-- Custom Minimal Modal -->
<div id="customModal" class="modal-overlay">
<div class="modal-card">
<h3 id="modalTitle">Confirm Action</h3>
<p id="modalMessage">Are you sure?</p>
<input type="text" id="modalInput" class="modal-input" placeholder="Enter value...">
<div class="modal-actions">
<button id="modalCancel" class="btn btn-outline-secondary">Cancel</button>
<button id="modalConfirm" class="btn btn-primary">Confirm</button>
</div>
</div>
</div>
<!-- Edit Response Modal -->
<div id="editResponseModal" class="modal-overlay">
<div class="modal-card" style="max-width: 600px; max-height: 80vh; overflow-y: auto;">
<h3>Edit Response</h3>
<div id="editResponseFields" style="margin-top: 15px;">
<!-- Dynamic form fields for editing -->
</div>
<div class="modal-actions" style="margin-top: 20px;">
<button id="cancelEditResponse" class="btn btn-outline-secondary">Cancel</button>
<button id="saveEditResponse" class="btn btn-primary">Save Changes</button>
</div>
</div>
</div>
<!-- Cloudinary Help Modal -->
<div id="cloudinaryHelpModal" class="modal-overlay">
<div class="modal-card" style="max-width: 500px;">
<h3><i class="fa-solid fa-cloud"></i> Cloudinary Setup Guide</h3>
<div style="font-size: 0.95rem; line-height: 1.6; color: var(--text-main); margin-top: 15px;">
<p>To enable <strong>File Uploads</strong>, you need an unsigned upload preset:</p>
<ol style="padding-left: 20px; margin: 15px 0;">
<li>Log in to <a href="https://cloudinary.com/console" target="_blank"
style="color:var(--primary);">Cloudinary Console</a>.</li>
<li>Go to <strong>Settings</strong> (gear icon) > <strong>Upload</strong> tab.</li>
<li>Scroll to <strong>Upload presets</strong> and click <strong>Add upload preset</strong>.</li>
<li>Change "Signing Mode" to <strong>Unsigned</strong>.</li>
<li>Copy the generated <strong>Preset Name</strong> (e.g., <code>ml_default</code>).</li>
<li>Paste your <strong>Cloud Name</strong> and <strong>Preset Name</strong> in the builder.</li>
</ol>
<p class="hint"
style="background: var(--bg-body); padding: 10px; border-radius: 6px; border-left: 4px solid var(--primary);">
<i class="fa-solid fa-circle-info"></i> Unsigned presets allow direct uploads from users without
exposing your API credentials.
</p>
</div>
<div class="modal-actions" style="margin-top: 25px;">
<button id="closeCloudinaryHelp" class="btn btn-primary" style="width: 100%;">Got it!</button>
</div>
</div>
</div>
<style>
/* ===== RESPONSES PANEL ===== */
#responses {
width: 100%;
}
.responses-panel {
background: var(--bg-card);
padding: 20px;
border-radius: var(--radius);
}
.responses-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.responses-meta {
margin-bottom: 15px;
color: var(--text-secondary);
}
.responses-table-wrapper table {
width: 100%;
border-collapse: collapse;
}
.responses-table-wrapper th,
.responses-table-wrapper td {
border: 1px solid var(--border);
padding: 8px;
font-size: 0.9rem;
}
.responses-table-wrapper th {
background: var(--bg-secondary);
font-weight: 600;
}
/* Minimal Modal Styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(4px);
z-index: 4000;
display: none;
justify-content: center;
align-items: center;
opacity: 0;
transition: opacity 0.2s ease;
}
.modal-overlay.show {
display: flex;
opacity: 1;
}
.modal-card {
background: var(--bg-card);
padding: 25px;
border-radius: 12px;
width: 90%;
max-width: 400px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
transform: scale(0.95);
transition: transform 0.2s ease;
border: 1px solid var(--border);
}
.modal-overlay.show .modal-card {
transform: scale(1);
}
.modal-card h3 {
margin: 0 0 10px 0;
color: var(--text-main);
font-size: 1.25rem;
}
.modal-card p {
margin: 0 0 20px 0;
color: var(--text-secondary);
font-size: 0.95rem;
line-height: 1.5;
}
.modal-input {
width: 100%;
padding: 10px;
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 20px;
font-family: inherit;
font-size: 1rem;
background: var(--bg-main);
color: var(--text-main);
}
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
}
</style>
<!-- Image Preview Modal -->
<div id="imagePreviewModal" class="modal-overlay">
<div class="modal-card" style="max-width: 800px; padding: 15px;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:10px;">
<h3 id="previewModalTitle" style="margin:0; font-size:1.1rem;">Image Preview</h3>
<span id="closeImagePreview"
style="cursor:pointer; font-size:1.5rem; line-height:1; color: var(--text-main);">×</span>
</div>
<div
style="text-align:center; background: var(--bg-body); border-radius: 8px; overflow: hidden; min-height: 200px; display: flex; align-items:center; justify-content:center; border: 1px solid var(--border);">
<img id="modalPreviewImage" src=""
style="max-width: 100%; max-height: 70vh; object-fit: contain; display: block;">
</div>
<div style="margin-top: 15px; display: flex; justify-content: flex-end; gap: 10px;">
<a id="downloadPreviewLink" href="" download class="btn btn-outline-primary btn-sm">
<i class="fa-solid fa-download"></i> Download
</a>
<button id="closePreviewBtn" class="btn btn-primary btn-sm">Close</button>
</div>
</div>
</div>
</body>
</html>