Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Project File Explorer</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .file-icon { | |
| width: 18px; | |
| height: 18px; | |
| margin-right: 8px; | |
| display: inline-block; | |
| } | |
| .folder-item:hover { | |
| background-color: #f3f4f6; | |
| } | |
| .file-item:hover { | |
| background-color: #f3f4f6; | |
| } | |
| .directory-container { | |
| transition: all 0.3s ease; | |
| } | |
| .directory-container.collapsed .directory-children { | |
| display: none; | |
| } | |
| .directory-container.collapsed .toggle-icon { | |
| transform: rotate(-90deg); | |
| } | |
| .toggle-icon { | |
| transition: transform 0.3s ease; | |
| } | |
| #context-menu { | |
| transition: opacity 0.1s ease; | |
| } | |
| .context-menu-item { | |
| transition: background-color 0.2s ease; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <div class="container mx-auto p-4 md:p-8 max-w-4xl"> | |
| <div class="bg-white rounded-lg shadow-md overflow-hidden"> | |
| <div class="bg-blue-600 px-6 py-4 flex items-center"> | |
| <i class="fas fa-folder-open text-white mr-3 text-xl"></i> | |
| <h1 class="text-white font-semibold text-xl">Project File Explorer</h1> | |
| <div class="ml-auto flex space-x-2"> | |
| <button class="bg-blue-700 hover:bg-blue-800 text-white p-2 rounded-full"> | |
| <i class="fas fa-search"></i> | |
| </button> | |
| <button class="bg-blue-700 hover:bg-blue-800 text-white p-2 rounded-full"> | |
| <i class="fas fa-cog"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <div class="p-4 border-b"> | |
| <div class="flex items-center text-sm text-gray-600"> | |
| <span class="text-blue-600">Renee/</span> | |
| <span class="mx-1">></span> | |
| <span>Project Root</span> | |
| </div> | |
| </div> | |
| <div class="p-4"> | |
| <div class="directory-container"> | |
| <div class="folder-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="toggle-icon mr-2 text-gray-500"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| <i class="fas fa-folder text-blue-500 mr-2"></i> | |
| <span class="font-medium">Renee/</span> | |
| <span class="ml-auto text-xs text-gray-500">Project Root</span> | |
| </div> | |
| <div class="directory-children pl-6"> | |
| <!-- Root level files --> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-code text-blue-400"></i> | |
| </div> | |
| <span>Dockerfile</span> | |
| <span class="ml-auto text-xs text-gray-500">Multi-stage build definition</span> | |
| </div> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-alt text-gray-400"></i> | |
| </div> | |
| <span>.dockerignore</span> | |
| <span class="ml-auto text-xs text-gray-500">Files to exclude from Docker context</span> | |
| </div> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-alt text-yellow-500"></i> | |
| </div> | |
| <span>requirements.txt</span> | |
| <span class="ml-auto text-xs text-gray-500">Python dependencies</span> | |
| </div> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-code text-green-500"></i> | |
| </div> | |
| <span>build_and_run.sh</span> | |
| <span class="ml-auto text-xs text-gray-500">Bash script to build/run/verify container</span> | |
| </div> | |
| <!-- Directories --> | |
| <div class="directory-container"> | |
| <div class="folder-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="toggle-icon mr-2 text-gray-500"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| <i class="fas fa-folder text-blue-500 mr-2"></i> | |
| <span>src/</span> | |
| <span class="ml-auto text-xs text-gray-500">Application Source Code</span> | |
| </div> | |
| <div class="directory-children pl-6"> | |
| <div class="directory-container"> | |
| <div class="folder-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="toggle-icon mr-2 text-gray-500"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| <i class="fas fa-folder text-blue-500 mr-2"></i> | |
| <span>app/</span> | |
| </div> | |
| <div class="directory-children pl-6"> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-code text-purple-500"></i> | |
| </div> | |
| <span>server.py</span> | |
| <span class="ml-auto text-xs text-gray-500">Python web server</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="directory-container"> | |
| <div class="folder-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="toggle-icon mr-2 text-gray-500"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| <i class="fas fa-folder text-blue-500 mr-2"></i> | |
| <span>scripts/</span> | |
| <span class="ml-auto text-xs text-gray-500">Utility Scripts for the Host System</span> | |
| </div> | |
| <div class="directory-children pl-6"> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-code text-green-500"></i> | |
| </div> | |
| <span>system_status.sh</span> | |
| </div> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-code text-green-500"></i> | |
| </div> | |
| <span>update_system.sh</span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="directory-container"> | |
| <div class="folder-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="toggle-icon mr-2 text-gray-500"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| <i class="fas fa-folder text-blue-500 mr-2"></i> | |
| <span>etc/</span> | |
| <span class="ml-auto text-xs text-gray-500">Configuration Files</span> | |
| </div> | |
| <div class="directory-children pl-6"> | |
| <div class="directory-container"> | |
| <div class="folder-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="toggle-icon mr-2 text-gray-500"> | |
| <i class="fas fa-chevron-down"></i> | |
| </div> | |
| <i class="fas fa-folder text-blue-500 mr-2"></i> | |
| <span>config/</span> | |
| </div> | |
| <div class="directory-children pl-6"> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-alt text-orange-500"></i> | |
| </div> | |
| <span>system.conf</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-alt text-red-500"></i> | |
| </div> | |
| <span>README.md</span> | |
| <span class="ml-auto text-xs text-gray-500">Project documentation</span> | |
| </div> | |
| <div class="file-item flex items-center py-2 px-3 rounded cursor-pointer"> | |
| <div class="file-icon"> | |
| <i class="fas fa-file-alt text-orange-500"></i> | |
| </div> | |
| <span>pineapple_os_phase1.md</span> | |
| <span class="ml-auto text-xs text-gray-500">Pineapple Micro OS System Directory Brainstorming</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-gray-50 px-6 py-3 border-t flex justify-between items-center"> | |
| <div class="text-sm text-gray-600"> | |
| <span>9 files, 4 directories</span> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-sync-alt"></i> | |
| </button> | |
| <button class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-expand"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mt-6 bg-white rounded-lg shadow-md overflow-hidden"> | |
| <div class="bg-gray-100 px-6 py-3 border-b flex items-center"> | |
| <i class="fas fa-info-circle text-blue-500 mr-2"></i> | |
| <h2 class="font-medium">File Information</h2> | |
| </div> | |
| <div class="p-4"> | |
| <div id="file-info-content" class="text-sm text-gray-700"> | |
| <p class="text-center text-gray-500 py-8">Select a file or directory to view details</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Context Menu --> | |
| <div id="context-menu" class="hidden absolute bg-white shadow-lg rounded-md border border-gray-200 w-48 z-50"> | |
| <div class="py-1"> | |
| <a href="#" class="context-menu-item block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Open</a> | |
| <a href="#" class="context-menu-item block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Download</a> | |
| <a href="#" class="context-menu-item block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Rename</a> | |
| <a href="#" class="context-menu-item block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Delete</a> | |
| <div class="border-t border-gray-200"></div> | |
| <a href="#" class="context-menu-item block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Properties</a> | |
| </div> | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Toggle directory collapse/expand | |
| const toggleIcons = document.querySelectorAll('.toggle-icon'); | |
| toggleIcons.forEach(icon => { | |
| icon.addEventListener('click', function(e) { | |
| e.stopPropagation(); | |
| const container = this.closest('.directory-container'); | |
| container.classList.toggle('collapsed'); | |
| }); | |
| }); | |
| // Handle folder item clicks (propagate to toggle icon) | |
| const folderItems = document.querySelectorAll('.folder-item'); | |
| folderItems.forEach(item => { | |
| item.addEventListener('click', function(e) { | |
| if (e.target === this) { | |
| const toggleIcon = this.querySelector('.toggle-icon'); | |
| if (toggleIcon) { | |
| toggleIcon.click(); | |
| } | |
| } | |
| }); | |
| }); | |
| // Handle file selection | |
| const fileItems = document.querySelectorAll('.file-item, .folder-item'); | |
| const fileInfoContent = document.getElementById('file-info-content'); | |
| fileItems.forEach(item => { | |
| item.addEventListener('click', function() { | |
| // Remove active class from all items | |
| fileItems.forEach(i => i.classList.remove('bg-blue-50', 'border', 'border-blue-200')); | |
| // Add active class to clicked item | |
| this.classList.add('bg-blue-50', 'border', 'border-blue-200'); | |
| // Update file info panel | |
| const fileName = this.querySelector('span:not(.text-xs)').textContent; | |
| const fileDescription = this.querySelector('.text-xs')?.textContent || 'No description available'; | |
| fileInfoContent.innerHTML = ` | |
| <div class="mb-4"> | |
| <h3 class="font-medium text-lg mb-1">${fileName}</h3> | |
| <p class="text-gray-600">${fileDescription}</p> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4 text-sm"> | |
| <div> | |
| <p class="text-gray-500">Type</p> | |
| <p>${this.classList.contains('folder-item') ? 'Directory' : 'File'}</p> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Size</p> | |
| <p>${Math.floor(Math.random() * 1024)} KB</p> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Created</p> | |
| <p>${new Date().toLocaleDateString()}</p> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Modified</p> | |
| <p>${new Date().toLocaleDateString()}</p> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Permissions</p> | |
| <p>${generateRandomPermissions(this.classList.contains('folder-item'))}</p> | |
| </div> | |
| <div> | |
| <p class="text-gray-500">Owner</p> | |
| <p>renee</p> | |
| </div> | |
| </div> | |
| <div class="mt-4 pt-4 border-t"> | |
| <button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm"> | |
| <i class="fas fa-download mr-2"></i> Download | |
| </button> | |
| <button class="ml-2 bg-gray-200 hover:bg-gray-300 text-gray-800 px-4 py-2 rounded-md text-sm"> | |
| <i class="fas fa-edit mr-2"></i> Edit | |
| </button> | |
| </div> | |
| `; | |
| }); | |
| }); | |
| // Collapse all directories by default | |
| document.querySelectorAll('.directory-container').forEach(container => { | |
| if (!container.classList.contains('collapsed')) { | |
| container.classList.add('collapsed'); | |
| } | |
| }); | |
| // Expand the root directory | |
| document.querySelector('.directory-container').classList.remove('collapsed'); | |
| // Context menu handling | |
| const contextMenu = document.getElementById('context-menu'); | |
| let selectedItem = null; | |
| document.addEventListener('contextmenu', function(e) { | |
| const fileItem = e.target.closest('.file-item, .folder-item'); | |
| if (fileItem) { | |
| e.preventDefault(); | |
| selectedItem = fileItem; | |
| // Position the context menu | |
| contextMenu.style.left = `${e.pageX}px`; | |
| contextMenu.style.top = `${e.pageY}px`; | |
| contextMenu.classList.remove('hidden'); | |
| } | |
| }); | |
| // Close context menu when clicking elsewhere | |
| document.addEventListener('click', function() { | |
| contextMenu.classList.add('hidden'); | |
| }); | |
| // Context menu actions | |
| document.querySelectorAll('.context-menu-item').forEach(item => { | |
| item.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| const action = this.textContent.toLowerCase(); | |
| handleFileAction(action, selectedItem); | |
| contextMenu.classList.add('hidden'); | |
| }); | |
| }); | |
| function handleFileAction(action, item) { | |
| const fileName = item.querySelector('span:not(.text-xs)').textContent; | |
| const isFolder = item.classList.contains('folder-item'); | |
| switch(action) { | |
| case 'open': | |
| if (isFolder) { | |
| const toggleIcon = item.querySelector('.toggle-icon'); | |
| if (toggleIcon) toggleIcon.click(); | |
| } else { | |
| alert(`Opening file: ${fileName}`); | |
| } | |
| break; | |
| case 'download': | |
| alert(`Downloading: ${fileName}`); | |
| break; | |
| case 'rename': | |
| const newName = prompt('Enter new name:', fileName); | |
| if (newName) { | |
| item.querySelector('span:not(.text-xs)').textContent = newName; | |
| } | |
| break; | |
| case 'delete': | |
| if (confirm(`Are you sure you want to delete ${fileName}?`)) { | |
| item.remove(); | |
| updateFileCount(); | |
| } | |
| break; | |
| case 'properties': | |
| alert(`Properties for: ${fileName}\nType: ${isFolder ? 'Folder' : 'File'}`); | |
| break; | |
| } | |
| } | |
| function updateFileCount() { | |
| const fileCount = document.querySelectorAll('.file-item').length; | |
| const dirCount = document.querySelectorAll('.folder-item').length - 1; // subtract root | |
| const countElement = document.querySelector('.bg-gray-50 .text-sm span'); | |
| countElement.textContent = `${fileCount} files, ${dirCount} directories`; | |
| } | |
| function generateRandomPermissions(isDirectory) { | |
| const types = ['r', 'w', 'x']; | |
| let permissions = isDirectory ? 'd' : '-'; | |
| // Generate owner, group, others permissions | |
| for (let i = 0; i < 3; i++) { | |
| let perm = ''; | |
| for (let j = 0; j < 3; j++) { | |
| perm += Math.random() > 0.3 ? types[j] : '-'; | |
| } | |
| permissions += perm; | |
| } | |
| return permissions; | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=CheekyCheek/renee2-0" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |