Spaces:
Running
Running
the minimize/maximize button is inside the thing being minimized bro lol
Browse files- index.html +23 -7
index.html
CHANGED
|
@@ -84,7 +84,7 @@
|
|
| 84 |
</div>
|
| 85 |
<!-- Main Content Area -->
|
| 86 |
<div class="flex-1 flex flex-col min-w-0">
|
| 87 |
-
<!-- Top Bar -->
|
| 88 |
<div class="bg-gray-800 border-b border-gray-700 p-4 flex justify-between items-center">
|
| 89 |
<div class="flex items-center gap-4">
|
| 90 |
<button id="mobile-menu" class="lg:hidden p-2 rounded hover:bg-gray-700">
|
|
@@ -93,6 +93,9 @@
|
|
| 93 |
<h1 class="text-xl font-bold text-primary-400">CodeCanvas AI Studio</h1>
|
| 94 |
</div>
|
| 95 |
<div class="flex items-center gap-3">
|
|
|
|
|
|
|
|
|
|
| 96 |
<button class="p-2 rounded hover:bg-gray-700">
|
| 97 |
<i data-feather="play" class="w-4 h-4 text-green-400"></i>
|
| 98 |
</button>
|
|
@@ -101,7 +104,7 @@
|
|
| 101 |
</button>
|
| 102 |
</div>
|
| 103 |
</div>
|
| 104 |
-
|
| 105 |
<div class="flex-1 flex flex-col lg:flex-row overflow-hidden">
|
| 106 |
<!-- Code Editor -->
|
| 107 |
<div class="flex-1 flex flex-col min-w-0">
|
|
@@ -174,7 +177,6 @@
|
|
| 174 |
// Initial preview update
|
| 175 |
updatePreview(editor.getValue());
|
| 176 |
});
|
| 177 |
-
|
| 178 |
function updatePreview(code) {
|
| 179 |
const preview = document.getElementById('preview');
|
| 180 |
try {
|
|
@@ -198,23 +200,37 @@
|
|
| 198 |
`;
|
| 199 |
}
|
| 200 |
}
|
|
|
|
| 201 |
// Panel toggle functionality
|
| 202 |
document.getElementById('toggle-filesystem').addEventListener('click', function() {
|
| 203 |
const panel = document.getElementById('filesystem-panel');
|
|
|
|
| 204 |
const isExpanded = panel.classList.contains('w-64');
|
| 205 |
|
| 206 |
if (isExpanded) {
|
| 207 |
panel.classList.remove('w-64');
|
| 208 |
panel.classList.add('w-0', 'overflow-hidden', 'p-0', 'border-r-0');
|
| 209 |
-
|
| 210 |
} else {
|
| 211 |
panel.classList.remove('w-0', 'overflow-hidden', 'p-0', 'border-r-0');
|
| 212 |
panel.classList.add('w-64');
|
| 213 |
-
|
| 214 |
}
|
| 215 |
feather.replace();
|
| 216 |
});
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
document.getElementById('mobile-menu').addEventListener('click', function() {
|
| 219 |
const panel = document.getElementById('filesystem-panel');
|
| 220 |
panel.classList.toggle('hidden');
|
|
@@ -222,6 +238,6 @@
|
|
| 222 |
|
| 223 |
// Initialize feather icons
|
| 224 |
feather.replace();
|
| 225 |
-
|
| 226 |
</body>
|
| 227 |
</html>
|
|
|
|
| 84 |
</div>
|
| 85 |
<!-- Main Content Area -->
|
| 86 |
<div class="flex-1 flex flex-col min-w-0">
|
| 87 |
+
<!-- Top Bar -->
|
| 88 |
<div class="bg-gray-800 border-b border-gray-700 p-4 flex justify-between items-center">
|
| 89 |
<div class="flex items-center gap-4">
|
| 90 |
<button id="mobile-menu" class="lg:hidden p-2 rounded hover:bg-gray-700">
|
|
|
|
| 93 |
<h1 class="text-xl font-bold text-primary-400">CodeCanvas AI Studio</h1>
|
| 94 |
</div>
|
| 95 |
<div class="flex items-center gap-3">
|
| 96 |
+
<button id="restore-filesystem" class="p-2 rounded hover:bg-gray-700 hidden">
|
| 97 |
+
<i data-feather="folder" class="w-4 h-4"></i>
|
| 98 |
+
</button>
|
| 99 |
<button class="p-2 rounded hover:bg-gray-700">
|
| 100 |
<i data-feather="play" class="w-4 h-4 text-green-400"></i>
|
| 101 |
</button>
|
|
|
|
| 104 |
</button>
|
| 105 |
</div>
|
| 106 |
</div>
|
| 107 |
+
<!-- Editor and Preview Area -->
|
| 108 |
<div class="flex-1 flex flex-col lg:flex-row overflow-hidden">
|
| 109 |
<!-- Code Editor -->
|
| 110 |
<div class="flex-1 flex flex-col min-w-0">
|
|
|
|
| 177 |
// Initial preview update
|
| 178 |
updatePreview(editor.getValue());
|
| 179 |
});
|
|
|
|
| 180 |
function updatePreview(code) {
|
| 181 |
const preview = document.getElementById('preview');
|
| 182 |
try {
|
|
|
|
| 200 |
`;
|
| 201 |
}
|
| 202 |
}
|
| 203 |
+
|
| 204 |
// Panel toggle functionality
|
| 205 |
document.getElementById('toggle-filesystem').addEventListener('click', function() {
|
| 206 |
const panel = document.getElementById('filesystem-panel');
|
| 207 |
+
const restoreButton = document.getElementById('restore-filesystem');
|
| 208 |
const isExpanded = panel.classList.contains('w-64');
|
| 209 |
|
| 210 |
if (isExpanded) {
|
| 211 |
panel.classList.remove('w-64');
|
| 212 |
panel.classList.add('w-0', 'overflow-hidden', 'p-0', 'border-r-0');
|
| 213 |
+
restoreButton.classList.remove('hidden');
|
| 214 |
} else {
|
| 215 |
panel.classList.remove('w-0', 'overflow-hidden', 'p-0', 'border-r-0');
|
| 216 |
panel.classList.add('w-64');
|
| 217 |
+
restoreButton.classList.add('hidden');
|
| 218 |
}
|
| 219 |
feather.replace();
|
| 220 |
});
|
| 221 |
+
|
| 222 |
+
// Restore filesystem panel from top bar
|
| 223 |
+
document.getElementById('restore-filesystem').addEventListener('click', function() {
|
| 224 |
+
const panel = document.getElementById('filesystem-panel');
|
| 225 |
+
const restoreButton = document.getElementById('restore-filesystem');
|
| 226 |
+
|
| 227 |
+
panel.classList.remove('w-0', 'overflow-hidden', 'p-0', 'border-r-0');
|
| 228 |
+
panel.classList.add('w-64');
|
| 229 |
+
restoreButton.classList.add('hidden');
|
| 230 |
+
feather.replace();
|
| 231 |
+
});
|
| 232 |
+
|
| 233 |
+
// Mobile menu toggle
|
| 234 |
document.getElementById('mobile-menu').addEventListener('click', function() {
|
| 235 |
const panel = document.getElementById('filesystem-panel');
|
| 236 |
panel.classList.toggle('hidden');
|
|
|
|
| 238 |
|
| 239 |
// Initialize feather icons
|
| 240 |
feather.replace();
|
| 241 |
+
</script>
|
| 242 |
</body>
|
| 243 |
</html>
|