Spaces:
Running
Running
Update index.html
Browse files- index.html +19 -15
index.html
CHANGED
|
@@ -38,14 +38,15 @@
|
|
| 38 |
|
| 39 |
.list-item {
|
| 40 |
transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
|
|
|
| 41 |
}
|
| 42 |
.list-item:hover {
|
| 43 |
background-color: rgba(59, 130, 246, 0.1);
|
| 44 |
-
transform:
|
| 45 |
}
|
| 46 |
.list-item.active {
|
| 47 |
background-color: rgba(59, 130, 246, 0.25);
|
| 48 |
-
|
| 49 |
}
|
| 50 |
|
| 51 |
.panel-content::-webkit-scrollbar { width: 6px; }
|
|
@@ -73,27 +74,27 @@
|
|
| 73 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
|
| 74 |
</button>
|
| 75 |
|
| 76 |
-
<aside id="model-panel" class="side-panel left glass-ui fixed top-0 left-0 h-full w-
|
| 77 |
<div class="h-full flex flex-col">
|
| 78 |
-
<div class="flex-shrink-0 flex justify-between items-center p-
|
| 79 |
<h2 class="text-xl font-bold text-white">Models</h2>
|
| 80 |
<button id="close-model-panel" class="p-2 rounded-full hover:bg-gray-700">
|
| 81 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
|
| 82 |
</button>
|
| 83 |
</div>
|
| 84 |
-
<div id="model-selector" class="panel-content flex-grow overflow-y-auto
|
| 85 |
</div>
|
| 86 |
</aside>
|
| 87 |
|
| 88 |
<aside id="panorama-panel" class="side-panel right glass-ui fixed top-0 right-0 h-full w-80 max-w-[80vw] z-30">
|
| 89 |
<div class="h-full flex flex-col">
|
| 90 |
-
<div class="flex-shrink-0 flex justify-between items-center p-
|
| 91 |
<h2 class="text-xl font-bold text-white">Panoramas</h2>
|
| 92 |
<button id="close-panorama-panel" class="p-2 rounded-full hover:bg-gray-700">
|
| 93 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
|
| 94 |
</button>
|
| 95 |
</div>
|
| 96 |
-
<div id="panorama-gallery" class="panel-content flex-grow overflow-y-auto
|
| 97 |
</div>
|
| 98 |
</aside>
|
| 99 |
|
|
@@ -211,31 +212,33 @@
|
|
| 211 |
const modelSelector = document.getElementById('model-selector');
|
| 212 |
modelFiles.forEach(fileName => {
|
| 213 |
const container = document.createElement('div');
|
| 214 |
-
container.className = 'list-item
|
| 215 |
container.dataset.model = fileName;
|
| 216 |
container.onclick = () => loadAndSwitchModel(fileName);
|
| 217 |
|
| 218 |
const thumb = document.createElement('img');
|
| 219 |
-
// Assumes a .png thumbnail exists for each .glb model in '/glb/thumbnails/'
|
| 220 |
thumb.src = `/glb/thumbnails/${fileName.replace('.glb', '.png')}`;
|
| 221 |
thumb.alt = `Thumbnail for ${fileName}`;
|
| 222 |
-
thumb.className = 'w-
|
| 223 |
-
//
|
| 224 |
-
|
|
|
|
|
|
|
| 225 |
|
| 226 |
const name = document.createElement('span');
|
| 227 |
name.textContent = fileName.replace('.glb', '').replace(/(\d)/, ' $1').toUpperCase();
|
| 228 |
-
name.className = 'text-white font-medium';
|
| 229 |
|
|
|
|
| 230 |
container.appendChild(thumb);
|
| 231 |
-
container.appendChild(
|
| 232 |
modelSelector.appendChild(container);
|
| 233 |
});
|
| 234 |
|
| 235 |
const panoramaGallery = document.getElementById('panorama-gallery');
|
| 236 |
panoramaFiles.forEach(fileName => {
|
| 237 |
const container = document.createElement('div');
|
| 238 |
-
container.className = 'list-item aspect-video rounded-lg overflow-hidden cursor-pointer
|
| 239 |
container.dataset.image = fileName;
|
| 240 |
container.onclick = () => setPanorama(fileName);
|
| 241 |
|
|
@@ -243,6 +246,7 @@
|
|
| 243 |
thumb.src = `/jpg/thumbnails/${fileName}`;
|
| 244 |
thumb.className = 'w-full h-full object-cover';
|
| 245 |
thumb.alt = `Thumbnail for ${fileName}`;
|
|
|
|
| 246 |
|
| 247 |
container.appendChild(thumb);
|
| 248 |
panoramaGallery.appendChild(container);
|
|
|
|
| 38 |
|
| 39 |
.list-item {
|
| 40 |
transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
| 41 |
+
border: 2px solid transparent;
|
| 42 |
}
|
| 43 |
.list-item:hover {
|
| 44 |
background-color: rgba(59, 130, 246, 0.1);
|
| 45 |
+
transform: scale(1.03);
|
| 46 |
}
|
| 47 |
.list-item.active {
|
| 48 |
background-color: rgba(59, 130, 246, 0.25);
|
| 49 |
+
border-color: #3b82f6;
|
| 50 |
}
|
| 51 |
|
| 52 |
.panel-content::-webkit-scrollbar { width: 6px; }
|
|
|
|
| 74 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
|
| 75 |
</button>
|
| 76 |
|
| 77 |
+
<aside id="model-panel" class="side-panel left glass-ui fixed top-0 left-0 h-full w-80 max-w-[80vw] z-30">
|
| 78 |
<div class="h-full flex flex-col">
|
| 79 |
+
<div class="flex-shrink-0 flex justify-between items-center p-4 border-b border-gray-700">
|
| 80 |
<h2 class="text-xl font-bold text-white">Models</h2>
|
| 81 |
<button id="close-model-panel" class="p-2 rounded-full hover:bg-gray-700">
|
| 82 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
|
| 83 |
</button>
|
| 84 |
</div>
|
| 85 |
+
<div id="model-selector" class="panel-content flex-grow overflow-y-auto p-4 grid grid-cols-2 gap-4"></div>
|
| 86 |
</div>
|
| 87 |
</aside>
|
| 88 |
|
| 89 |
<aside id="panorama-panel" class="side-panel right glass-ui fixed top-0 right-0 h-full w-80 max-w-[80vw] z-30">
|
| 90 |
<div class="h-full flex flex-col">
|
| 91 |
+
<div class="flex-shrink-0 flex justify-between items-center p-4 border-b border-gray-700">
|
| 92 |
<h2 class="text-xl font-bold text-white">Panoramas</h2>
|
| 93 |
<button id="close-panorama-panel" class="p-2 rounded-full hover:bg-gray-700">
|
| 94 |
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
|
| 95 |
</button>
|
| 96 |
</div>
|
| 97 |
+
<div id="panorama-gallery" class="panel-content flex-grow overflow-y-auto p-4 grid grid-cols-2 gap-4"></div>
|
| 98 |
</div>
|
| 99 |
</aside>
|
| 100 |
|
|
|
|
| 212 |
const modelSelector = document.getElementById('model-selector');
|
| 213 |
modelFiles.forEach(fileName => {
|
| 214 |
const container = document.createElement('div');
|
| 215 |
+
container.className = 'list-item flex flex-col rounded-lg cursor-pointer overflow-hidden bg-gray-800/50';
|
| 216 |
container.dataset.model = fileName;
|
| 217 |
container.onclick = () => loadAndSwitchModel(fileName);
|
| 218 |
|
| 219 |
const thumb = document.createElement('img');
|
|
|
|
| 220 |
thumb.src = `/glb/thumbnails/${fileName.replace('.glb', '.png')}`;
|
| 221 |
thumb.alt = `Thumbnail for ${fileName}`;
|
| 222 |
+
thumb.className = 'w-full h-auto aspect-square object-cover';
|
| 223 |
+
thumb.onerror = () => { thumb.classList.add('bg-gray-700'); } // Add bg on error
|
| 224 |
+
|
| 225 |
+
const nameWrapper = document.createElement('div');
|
| 226 |
+
nameWrapper.className = 'p-2 w-full';
|
| 227 |
|
| 228 |
const name = document.createElement('span');
|
| 229 |
name.textContent = fileName.replace('.glb', '').replace(/(\d)/, ' $1').toUpperCase();
|
| 230 |
+
name.className = 'text-white text-sm font-medium text-center block';
|
| 231 |
|
| 232 |
+
nameWrapper.appendChild(name);
|
| 233 |
container.appendChild(thumb);
|
| 234 |
+
container.appendChild(nameWrapper);
|
| 235 |
modelSelector.appendChild(container);
|
| 236 |
});
|
| 237 |
|
| 238 |
const panoramaGallery = document.getElementById('panorama-gallery');
|
| 239 |
panoramaFiles.forEach(fileName => {
|
| 240 |
const container = document.createElement('div');
|
| 241 |
+
container.className = 'list-item aspect-video rounded-lg overflow-hidden cursor-pointer bg-gray-800/50';
|
| 242 |
container.dataset.image = fileName;
|
| 243 |
container.onclick = () => setPanorama(fileName);
|
| 244 |
|
|
|
|
| 246 |
thumb.src = `/jpg/thumbnails/${fileName}`;
|
| 247 |
thumb.className = 'w-full h-full object-cover';
|
| 248 |
thumb.alt = `Thumbnail for ${fileName}`;
|
| 249 |
+
thumb.onerror = () => { thumb.classList.add('bg-gray-700'); } // Add bg on error
|
| 250 |
|
| 251 |
container.appendChild(thumb);
|
| 252 |
panoramaGallery.appendChild(container);
|