Repository navigation
Expand file tree
/
Copy patheditor.html
More file actions
249 lines (240 loc) · 14.6 KB
/
Copy patheditor.html
File metadata and controls
249 lines (240 loc) · 14.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editor - WebSlider</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.8/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://unpkg.com/html-to-image@latest/dist/html-to-image.js"></script>
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/editor.css">
</head>
<body class="bg-dark text-white">
<nav class="navbar navbar-dark bg-dark border-bottom border-secondary fixed-top">
<div class="container-fluid px-2 px-md-3">
<div class="d-flex align-items-center gap-2 gap-md-3 navbar-left">
<a href="index.html" class="btn btn-outline-secondary btn-sm" id="btnHome">
<span class="d-none d-sm-inline">← Home</span>
<span class="d-sm-none">←</span>
</a>
<div class="vr text-secondary d-none d-md-block"></div>
<div class="project-info">
<div class="fw-semibold text-truncate" id="projectTitle">Untitled</div>
<div class="text-secondary project-meta d-none d-sm-block" id="projectInfo"></div>
</div>
<button class="btn btn-sm btn-link text-secondary p-0 ms-1 d-none d-sm-inline" data-bs-toggle="modal" data-bs-target="#settingsModal" title="Settings">⚙️</button>
</div>
<div class="d-none d-md-flex align-items-center gap-2">
<button class="btn btn-outline-secondary btn-sm" data-bs-toggle="modal" data-bs-target="#shortcutsModal" title="Shortcuts">⌨️</button>
<button class="btn btn-success btn-sm" id="btnPresent">▶️ Present</button>
<div class="vr text-secondary mx-1"></div>
<button class="btn btn-outline-light btn-sm" id="btnSave">💾 Save</button>
<button class="btn btn-danger btn-sm" id="btnPDF">📄 PDF</button>
</div>
<div class="d-flex d-md-none align-items-center gap-1">
<button class="btn btn-success btn-sm" id="btnPresentMobile">▶️</button>
<div class="dropdown">
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown">⋮</button>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-dark">
<li><a class="dropdown-item" href="#" id="btnSettingsMobile">⚙️ Settings</a></li>
<li><a class="dropdown-item" href="#" id="btnSaveMobile">💾 Save Project</a></li>
<li><a class="dropdown-item" href="#" id="btnPDFMobile">📄 Export PDF</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#shortcutsModal">⌨️ Shortcuts</a></li>
</ul>
</div>
</div>
</div>
</nav>
<div class="app-layout">
<div class="sidebar-left d-none d-md-flex">
<div class="sidebar-header">
<span class="fw-medium">Slides</span>
<button class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#addSlideModal">+</button>
</div>
<div class="thumbnails-container" id="thumbnails"></div>
</div>
<div class="main-canvas" id="mainCanvas">
<div id="mainSlideArea"></div>
<div id="slideActions" class="slide-actions d-flex gap-2 justify-content-center mt-3 flex-wrap"></div>
</div>
<div class="bottom-bar d-md-none">
<div class="bottom-bar-header">
<span class="fw-medium small">Slides</span>
<button class="btn btn-sm btn-primary py-0 px-2" data-bs-toggle="modal" data-bs-target="#addSlideModal">+</button>
</div>
<div class="thumbnails-horizontal" id="thumbnailsMobile"></div>
</div>
</div>
<!-- Add Slide Modal -->
<div class="modal fade" id="addSlideModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content bg-dark-custom border-secondary">
<div class="modal-header border-secondary">
<h5 class="modal-title" id="addSlideTitle">Add New Slide</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="row g-3">
<div class="col-md-6">
<h6 class="text-secondary mb-2">HTML File Only</h6>
<div class="upload-area" id="uploadAreaHtml">
<div class="text-center py-4">
<div class="upload-icon mb-3">
<svg width="40" height="40" fill="none" stroke="currentColor" viewBox="0 0 24 24" style="margin: 0 auto; opacity: 0.6;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<p class="mb-1 fw-medium small">Drop HTML file or click</p>
<p class="text-secondary small mb-0">.html, .htm files</p>
</div>
</div>
</div>
<div class="col-md-6">
<h6 class="text-secondary mb-2">Folder with Assets</h6>
<div class="upload-area" id="uploadAreaFolder">
<div class="text-center py-4">
<div class="upload-icon mb-3">
<svg width="40" height="40" fill="none" stroke="currentColor" viewBox="0 0 24 24" style="margin: 0 auto; opacity: 0.6;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
</svg>
</div>
<p class="mb-1 fw-medium small">Click to select folder</p>
<p class="text-secondary small mb-0">Include images, CSS, JS, fonts, etc.</p>
</div>
</div>
</div>
</div>
<hr class="border-secondary my-3">
<div class="text-center">
<h6 class="text-secondary mb-3">Or generate with AI</h6>
<button type="button" class="btn btn-outline-info btn-lg px-4" id="btnOpenAI" data-bs-toggle="modal" data-bs-target="#aiModal">
<span class="me-2">🤖</span>Generate with AI
</button>
</div>
<div class="alert alert-info mt-3 mb-0 small">
<strong>💡 Tip:</strong> Use "Folder with Assets" for slides with local files. All file types are supported (images, fonts, audio, video, 3D models, WASM, etc.)
</div>
</div>
</div>
</div>
</div>
<!-- AI Generate Modal -->
<div class="modal fade" id="aiModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content bg-dark-custom border-secondary">
<div class="modal-header border-secondary">
<h5 class="modal-title">🤖 Generate Slide with AI</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Describe the slide you want</label>
<textarea class="form-control" id="aiSlideDescription" rows="4" placeholder="Example: Create a title slide with a gradient background, large centered heading 'Welcome to Our Product', a tagline below, and modern minimalist design with blue and purple colors..."></textarea>
</div>
<div class="mb-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="aiIncludePrevSlide">
<label class="form-check-label text-secondary" for="aiIncludePrevSlide">
Include previous slide content (for style matching)
</label>
</div>
</div>
<div class="mb-3">
<label class="form-label">Choose an AI Provider</label>
<div id="aiProvidersList" class="row g-2">
<!-- Populated by JavaScript -->
</div>
</div>
<div class="alert alert-secondary small mb-0">
<strong>ℹ️ How it works:</strong> Click an AI provider to open it with a pre-filled prompt. Copy the generated HTML and paste it using the HTML upload option.
</div>
</div>
<div class="modal-footer border-secondary">
<button type="button" class="btn btn-outline-light" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-info" id="btnCopyPrompt">📋 Copy Prompt</button>
</div>
</div>
</div>
</div>
<!-- Settings Modal -->
<div class="modal fade" id="settingsModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-dark-custom border-secondary">
<div class="modal-header border-secondary">
<h5 class="modal-title">Project Settings</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Project Name</label>
<input type="text" class="form-control" id="editProjectName">
</div>
<div class="mb-3">
<label class="form-label">Slide Size</label>
<select class="form-select" id="editSizePreset"></select>
</div>
<div class="row g-3">
<div class="col-6">
<label class="form-label">Width (px)</label>
<input type="number" class="form-control" id="editSlideWidth">
</div>
<div class="col-6">
<label class="form-label">Height (px)</label>
<input type="number" class="form-control" id="editSlideHeight">
</div>
</div>
</div>
<div class="modal-footer border-secondary">
<button type="button" class="btn btn-outline-light" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="btnSaveSettings">Save</button>
</div>
</div>
</div>
</div>
<!-- Shortcuts Modal -->
<div class="modal fade" id="shortcutsModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-dark-custom border-secondary">
<div class="modal-header border-secondary">
<h5 class="modal-title">Keyboard Shortcuts</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="d-flex justify-content-between py-2 border-bottom border-secondary">
<span class="text-secondary">Start presentation</span>
<kbd class="bg-dark px-2 py-1 rounded small">F5</kbd>
</div>
<div class="d-flex justify-content-between py-2 border-bottom border-secondary">
<span class="text-secondary">Start from current slide</span>
<kbd class="bg-dark px-2 py-1 rounded small">Shift + F5</kbd>
</div>
<div class="d-flex justify-content-between py-2 border-bottom border-secondary">
<span class="text-secondary">Next slide</span>
<kbd class="bg-dark px-2 py-1 rounded small">→ / Space</kbd>
</div>
<div class="d-flex justify-content-between py-2 border-bottom border-secondary">
<span class="text-secondary">Previous slide</span>
<kbd class="bg-dark px-2 py-1 rounded small">← / Backspace</kbd>
</div>
<div class="d-flex justify-content-between py-2 border-bottom border-secondary">
<span class="text-secondary">Exit presentation</span>
<kbd class="bg-dark px-2 py-1 rounded small">Escape</kbd>
</div>
<div class="d-flex justify-content-between py-2">
<span class="text-secondary">Save project</span>
<kbd class="bg-dark px-2 py-1 rounded small">Ctrl + S</kbd>
</div>
</div>
</div>
</div>
</div>
<input type="file" id="htmlFileInput" accept=".html,.htm" style="display:none;">
<input type="file" id="folderInput" webkitdirectory multiple style="display:none;">
<div id="pdf-capture"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.8/js/bootstrap.bundle.min.js"></script>
<script src="js/common.js"></script>
<script src="js/editor.js"></script>
</body>
</html>