Spaces:
Running
Running
🐳 12/03 - 06:56 - i dont see any changes
Browse files- editor.html +64 -28
editor.html
CHANGED
|
@@ -128,31 +128,45 @@
|
|
| 128 |
<!-- Toolbar -->
|
| 129 |
<div class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-6 shrink-0">
|
| 130 |
<div class="flex items-center gap-4">
|
| 131 |
-
<div class="
|
| 132 |
-
<button onclick="editor.
|
| 133 |
-
<i data-lucide="
|
| 134 |
-
Title
|
| 135 |
-
|
| 136 |
-
<button onclick="editor.setLayout('split')" class="tool-btn px-3 py-1.5 rounded-md text-sm font-medium text-gray-700 flex items-center gap-1" data-layout="split">
|
| 137 |
-
<i data-lucide="columns" class="w-4 h-4"></i>
|
| 138 |
-
Split
|
| 139 |
-
</button>
|
| 140 |
-
<button onclick="editor.setLayout('image')" class="tool-btn px-3 py-1.5 rounded-md text-sm font-medium text-gray-700 flex items-center gap-1" data-layout="image">
|
| 141 |
-
<i data-lucide="image" class="w-4 h-4"></i>
|
| 142 |
-
Image
|
| 143 |
-
</button>
|
| 144 |
-
<button onclick="editor.setLayout('grid')" class="tool-btn px-3 py-1.5 rounded-md text-sm font-medium text-gray-700 flex items-center gap-1" data-layout="grid">
|
| 145 |
-
<i data-lucide="layout-grid" class="w-4 h-4"></i>
|
| 146 |
-
Grid
|
| 147 |
-
</button>
|
| 148 |
-
<button onclick="editor.setLayout('comparison')" class="tool-btn px-3 py-1.5 rounded-md text-sm font-medium text-gray-700 flex items-center gap-1" data-layout="comparison">
|
| 149 |
-
<i data-lucide="table" class="w-4 h-4"></i>
|
| 150 |
-
Compare
|
| 151 |
-
</button>
|
| 152 |
-
<button onclick="editor.setLayout('compare3')" class="tool-btn px-3 py-1.5 rounded-md text-sm font-medium text-gray-700 flex items-center gap-1" data-layout="compare3">
|
| 153 |
-
<i data-lucide="columns-3" class="w-4 h-4"></i>
|
| 154 |
-
3-Col
|
| 155 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
</div>
|
| 157 |
|
| 158 |
<!-- View Toggle -->
|
|
@@ -290,6 +304,19 @@
|
|
| 290 |
this.renderSlidesList();
|
| 291 |
this.renderEditor();
|
| 292 |
this.updatePreview();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
}
|
| 294 |
|
| 295 |
generateId() {
|
|
@@ -387,10 +414,19 @@
|
|
| 387 |
this.renderEditor();
|
| 388 |
this.updatePreview();
|
| 389 |
|
| 390 |
-
// Update
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
}
|
| 395 |
|
| 396 |
updateField(field, value) {
|
|
|
|
| 128 |
<!-- Toolbar -->
|
| 129 |
<div class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-6 shrink-0">
|
| 130 |
<div class="flex items-center gap-4">
|
| 131 |
+
<div class="relative">
|
| 132 |
+
<button onclick="editor.toggleLayoutMenu()" id="layout-dropdown-btn" class="tool-btn px-4 py-1.5 rounded-lg text-sm font-medium text-gray-700 flex items-center gap-2 bg-white border border-gray-300 shadow-sm hover:bg-gray-50">
|
| 133 |
+
<i data-lucide="layout" class="w-4 h-4"></i>
|
| 134 |
+
<span id="current-layout-label">Title</span>
|
| 135 |
+
<i data-lucide="chevron-down" class="w-4 h-4 ml-1"></i>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
</button>
|
| 137 |
+
<div id="layout-menu" class="hidden absolute top-full left-0 mt-2 w-56 bg-white rounded-xl shadow-xl border border-gray-200 py-2 z-50">
|
| 138 |
+
<div class="px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider">Content</div>
|
| 139 |
+
<button onclick="editor.setLayout('title')" class="w-full px-4 py-2 text-sm text-gray-700 hover:bg-indigo-50 hover:text-indigo-600 flex items-center gap-3 transition-colors" data-layout="title">
|
| 140 |
+
<i data-lucide="type" class="w-4 h-4"></i>
|
| 141 |
+
Title
|
| 142 |
+
</button>
|
| 143 |
+
<button onclick="editor.setLayout('split')" class="w-full px-4 py-2 text-sm text-gray-700 hover:bg-indigo-50 hover:text-indigo-600 flex items-center gap-3 transition-colors" data-layout="split">
|
| 144 |
+
<i data-lucide="columns" class="w-4 h-4"></i>
|
| 145 |
+
Split
|
| 146 |
+
</button>
|
| 147 |
+
<button onclick="editor.setLayout('image')" class="w-full px-4 py-2 text-sm text-gray-700 hover:bg-indigo-50 hover:text-indigo-600 flex items-center gap-3 transition-colors" data-layout="image">
|
| 148 |
+
<i data-lucide="image" class="w-4 h-4"></i>
|
| 149 |
+
Image
|
| 150 |
+
</button>
|
| 151 |
+
<div class="border-t border-gray-100 my-1">
|
| 152 |
+
<div class="px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider mt-1">Grid</div>
|
| 153 |
+
</button>
|
| 154 |
+
<button onclick="editor.setLayout('grid')" class="w-full px-4 py-2 text-sm text-gray-700 hover:bg-indigo-50 hover:text-indigo-600 flex items-center gap-3 transition-colors" data-layout="grid">
|
| 155 |
+
<i data-lucide="layout-grid" class="w-4 h-4"></i>
|
| 156 |
+
Grid Cards
|
| 157 |
+
</button>
|
| 158 |
+
<div class="border-t border-gray-100 my-1">
|
| 159 |
+
<div class="px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider mt-1">Compare</div>
|
| 160 |
+
</div>
|
| 161 |
+
<button onclick="editor.setLayout('comparison')" class="w-full px-4 py-2 text-sm text-gray-700 hover:bg-indigo-50 hover:text-indigo-600 flex items-center gap-3 transition-colors" data-layout="comparison">
|
| 162 |
+
<i data-lucide="table" class="w-4 h-4"></i>
|
| 163 |
+
2-Column Table
|
| 164 |
+
</button>
|
| 165 |
+
<button onclick="editor.setLayout('compare3')" class="w-full px-4 py-2 text-sm text-gray-700 hover:bg-indigo-50 hover:text-indigo-600 flex items-center gap-3 transition-colors" data-layout="compare3">
|
| 166 |
+
<i data-lucide="columns-3" class="w-4 h-4"></i>
|
| 167 |
+
3-Column Table
|
| 168 |
+
</button>
|
| 169 |
+
</div>
|
| 170 |
</div>
|
| 171 |
|
| 172 |
<!-- View Toggle -->
|
|
|
|
| 304 |
this.renderSlidesList();
|
| 305 |
this.renderEditor();
|
| 306 |
this.updatePreview();
|
| 307 |
+
|
| 308 |
+
// Close layout dropdown when clicking outside
|
| 309 |
+
document.addEventListener('click', (e) => {
|
| 310 |
+
const menu = document.getElementById('layout-menu');
|
| 311 |
+
const btn = document.getElementById('layout-dropdown-btn');
|
| 312 |
+
if (menu && btn && !menu.contains(e.target) && !btn.contains(e.target)) {
|
| 313 |
+
menu.classList.add('hidden');
|
| 314 |
+
}
|
| 315 |
+
});
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
toggleLayoutMenu() {
|
| 319 |
+
document.getElementById('layout-menu').classList.toggle('hidden');
|
| 320 |
}
|
| 321 |
|
| 322 |
generateId() {
|
|
|
|
| 414 |
this.renderEditor();
|
| 415 |
this.updatePreview();
|
| 416 |
|
| 417 |
+
// Update layout button label
|
| 418 |
+
const layoutLabels = {
|
| 419 |
+
'title': 'Title',
|
| 420 |
+
'split': 'Split',
|
| 421 |
+
'image': 'Image',
|
| 422 |
+
'grid': 'Grid Cards',
|
| 423 |
+
'comparison': '2-Column Table',
|
| 424 |
+
'compare3': '3-Column Table'
|
| 425 |
+
};
|
| 426 |
+
document.getElementById('current-layout-label').textContent = layoutLabels[layout] || layout;
|
| 427 |
+
|
| 428 |
+
// Close menu if open
|
| 429 |
+
document.getElementById('layout-menu').classList.add('hidden');
|
| 430 |
}
|
| 431 |
|
| 432 |
updateField(field, value) {
|