<!DOCTYPE html>
Browse files<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HuggingSpace Dashboard</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-50 min-h-screen">
<custom-navbar></custom-navbar>
<div class="container mx-auto px-4 py-8">
<div class="flex justify-between items-center mb-8">
<div>
<h1 class="text-3xl font-bold text-gray-800">HuggingSpace Dashboard</h1>
<p class="text-gray-600">Manage your Hugging Face Space assets with ease</p>
</div>
<button id="uploadBtn" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
<i data-feather="upload" class="mr-2"></i> Upload Files
</button>
</div>
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Preview</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URL</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody id="assetsTable" class="bg-white divide-y divide-gray-200">
<!-- Table rows will be populated by JavaScript -->
</tbody>
</table>
</div>
</div>
<div class="mt-8 bg-white rounded-xl shadow-md p-6">
<h2 class="text-xl font-bold text-gray-800 mb-4">Export Data</h2>
<div class="flex items-center">
<button id="exportBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center mr-4">
<i data-feather="download" class="mr-2"></i> Export as JSON
</button>
<div class="flex-1">
<textarea id="jsonData" class="w-full h-32 p-3 border border-gray-300 rounded-lg font-mono text-sm" readonly></textarea>
</div>
</div>
</div>
</div>
<!-- Upload Modal -->
<div id="uploadModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg p-6 w-96">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-bold">Upload Files</h3>
<button id="closeModal" class="text-gray-500 hover:text-gray-700">
<i data-feather="x"></i>
</button>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="fileInput">
Select files to upload
</label>
<input type="file" id="fileInput" multiple class="w-full p-2 border border-gray-300 rounded-lg">
</div>
<button id="confirmUpload" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg w-full">
Upload
</button>
</div>
</div>
<script src="components/navbar.js"></script>
<script src="script.js"></script>
<script>feather.replace();</script>
</body>
</html>// Sample initial data
let assetsData = [
{
id: 1,
name: "nature-image.jpg",
type: "image/jpeg",
url: "https://huggingface.co/spaces/username/space/resolve/main/nature-image.jpg",
preview: "http://static.photos/nature/320x240/1"
},
{
id: 2,
name: "logo.png",
type: "image/png",
url: "https://huggingface.co/spaces/username/space/resolve/main/logo.png",
preview: "http://static.photos/abstract/320x240/2"
},
{
id: 3,
name: "document.pdf",
type: "application/pdf",
url: "https://huggingface.co/spaces/username/space/resolve/main/document.pdf",
preview: "http://static.photos/office/320x240/3"
}
];
// DOM Elements
const assetsTable = document.getElementById('assetsTable');
const uploadBtn = document.getElementById('uploadBtn');
const uploadModal = document.getElementById('uploadModal');
const closeModal = document.getElementById('closeModal');
const fileInput = document.getElementById('fileInput');
const confirmUpload = document.getElementById('confirmUpload');
const exportBtn = document.getElementById('exportBtn');
const jsonData = document.getElementById('jsonData');
// Initialize the dashboard
document.addEventListener('DOMContentLoaded', () => {
renderAssetsTable();
updateJsonData();
});
// Render assets table
function renderAssetsTable() {
assetsTable.innerHTML = '';
assetsData.forEach(asset => {
const row = document.createElement('tr');
row.className = 'hover:bg-gray-50';
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap">
<img src="${asset.preview}" alt="${asset.name}" class="file-preview">
</td>
<td class="px-6 py-4 whitespace-nowrap editable-cell" data-id="${asset.id}" data-field="name">${asset.name}</td>
<td class="px-6 py-4 whitespace-nowrap">${asset.type}</td>
<td class="px-6 py-4 whitespace-nowrap url-cell">${asset.url}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium table-actions">
<button class="text-indigo-600 hover:text-indigo-900" data-action="copy" data-url="${asset.url}">
<i data-feather="copy"></i>
</button>
<button class="text-red-600 hover:text-red-900" data-action="delete" data-id="${asset.id}">
<i data-feather="trash-2"></i>
</button>
</td>
`;
assetsTable.appendChild(row);
});
// Reinitialize feather icons
feather.replace();
// Add event listeners for editable cells
document.querySelectorAll('.editable-cell').forEach(cell => {
cell.addEventListener('dblclick', makeEditable);
});
// Add event listeners for action buttons
document.querySelectorAll('[data-action="copy"]').forEach(button => {
button.addEventListener('click', copyUrl);
});
document.querySelectorAll('[data-action="delete"]').forEach(button => {
button.addEventListener('click', deleteAsset);
});
}
// Make cell editable
function makeEditable(e) {
const cell = e.target;
const originalValue = cell.textContent;
const id = cell.dataset.id;
const field = cell.dataset.field;
cell.innerHTML = `<input type="text" value="${originalValue}" class="w-full p-1 border border-gray-300 rounded">`;
const input = cell.querySelector('input');
input.focus();
input.addEventListener('blur', () => {
const newValue = input.value;
cell.textContent = newValue;
// Update data
const asset = assetsData.find(a => a.id == id);
if (asset) {
asset[field] = newValue;
updateJsonData();
}
});
input.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
input.blur();
}
});
}
// Copy URL to clipboard
function copyUrl(e) {
const url = e.target.closest('button').dataset.url;
navigator.clipboard.writeText(url).then(() => {
// Show feedback
const originalHTML = e.target.closest('button').innerHTML;
e.target.closest('button').innerHTML = '<i data-feather="check"></i>';
feather.replace();
setTimeout(() => {
e.target.closest('button').innerHTML = originalHTML;
feather.replace();
}, 2000);
});
}
// Delete asset
function deleteAsset(e) {
const id = e.target.closest('button').dataset.id;
assetsData = assetsData.filter(asset => asset.id != id);
renderAssetsTable();
updateJsonData();
}
// Upload files
uploadBtn.addEventListener('click', () => {
uploadModal.classList.remove('hidden');
});
closeModal.addEventListener('click', () => {
uploadModal.classList.add('hidden');
fileInput.value = '';
});
confirmUpload.addEventListener('click', () => {
const files = fileInput.files;
if (files.length === 0) {
alert('Please select files to upload');
return;
}
// Simulate file upload and generate new assets
for (let i = 0; i < files.length; i++) {
const file = files[i];
const newAsset = {
id: assetsData.length + 1,
name: file.name,
type: file.type || 'unknown',
url: `https://huggingface.co/spaces/username/space/resolve/main/${file.name}`,
preview: `http://static.photos/${getRandomCategory()}/320x240/${assetsData.length + 1}`
};
assetsData.push(newAsset);
}
renderAssetsTable();
updateJsonData();
// Close modal and reset
uploadModal.classList.add('hidden');
fileInput.value = '';
});
// Export as JSON
exportBtn.addEventListener('click', () => {
const dataStr = JSON.stringify(assetsData, null, 2);
const dataUri = 'data:application/json;charset=utf-8,'+ encodeURIComponent(dataStr);
const exportFileDefaultName = 'huggingspace-data.json';
const linkElement = document.c
- README.md +8 -5
- components/navbar.js +136 -0
- index.html +102 -19
- script.js +256 -0
- style.css +67 -18
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: HuggingSpace Asset Manager π
|
| 3 |
+
colorFrom: purple
|
| 4 |
+
colorTo: purple
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
width: 100%;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
.navbar {
|
| 12 |
+
background: linear-gradient(135deg, var(--primary-500) 0%, var(--secondary-500) 100%);
|
| 13 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
| 14 |
+
color: white;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.nav-container {
|
| 18 |
+
max-width: 1200px;
|
| 19 |
+
margin: 0 auto;
|
| 20 |
+
padding: 0 1rem;
|
| 21 |
+
display: flex;
|
| 22 |
+
justify-content: space-between;
|
| 23 |
+
align-items: center;
|
| 24 |
+
height: 64px;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.logo {
|
| 28 |
+
display: flex;
|
| 29 |
+
align-items: center;
|
| 30 |
+
font-weight: 700;
|
| 31 |
+
font-size: 1.25rem;
|
| 32 |
+
text-decoration: none;
|
| 33 |
+
color: white;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.logo svg {
|
| 37 |
+
margin-right: 0.5rem;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.nav-links {
|
| 41 |
+
display: flex;
|
| 42 |
+
list-style: none;
|
| 43 |
+
gap: 1.5rem;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.nav-links a {
|
| 47 |
+
color: rgba(255, 255, 255, 0.9);
|
| 48 |
+
text-decoration: none;
|
| 49 |
+
font-weight: 500;
|
| 50 |
+
transition: color 0.3s ease;
|
| 51 |
+
display: flex;
|
| 52 |
+
align-items: center;
|
| 53 |
+
gap: 0.5rem;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.nav-links a:hover {
|
| 57 |
+
color: white;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.user-menu {
|
| 61 |
+
display: flex;
|
| 62 |
+
align-items: center;
|
| 63 |
+
gap: 0.75rem;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.user-avatar {
|
| 67 |
+
width: 32px;
|
| 68 |
+
height: 32px;
|
| 69 |
+
border-radius: 50%;
|
| 70 |
+
background-color: rgba(255, 255, 255, 0.2);
|
| 71 |
+
display: flex;
|
| 72 |
+
align-items: center;
|
| 73 |
+
justify-content: center;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
@media (max-width: 768px) {
|
| 77 |
+
.nav-links {
|
| 78 |
+
display: none;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.nav-container {
|
| 82 |
+
padding: 0 1rem;
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
</style>
|
| 86 |
+
|
| 87 |
+
<nav class="navbar">
|
| 88 |
+
<div class="nav-container">
|
| 89 |
+
<a href="#" class="logo">
|
| 90 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 91 |
+
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
|
| 92 |
+
<polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
|
| 93 |
+
<line x1="12" y1="22.08" x2="12" y2="12"></line>
|
| 94 |
+
</svg>
|
| 95 |
+
<span>HuggingSpace</span>
|
| 96 |
+
</a>
|
| 97 |
+
|
| 98 |
+
<ul class="nav-links">
|
| 99 |
+
<li><a href="#">
|
| 100 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 101 |
+
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
|
| 102 |
+
<polyline points="9 22 9 12 15 12 15 22"></polyline>
|
| 103 |
+
</svg>
|
| 104 |
+
Dashboard
|
| 105 |
+
</a></li>
|
| 106 |
+
<li><a href="#">
|
| 107 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 108 |
+
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 2h5a2 2 0 0 1 2 2z"></path>
|
| 109 |
+
</svg>
|
| 110 |
+
Spaces
|
| 111 |
+
</a></li>
|
| 112 |
+
<li><a href="#">
|
| 113 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 114 |
+
<circle cx="12" cy="12" r="3"></circle>
|
| 115 |
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
| 116 |
+
</svg>
|
| 117 |
+
Settings
|
| 118 |
+
</a></li>
|
| 119 |
+
</ul>
|
| 120 |
+
|
| 121 |
+
<div class="user-menu">
|
| 122 |
+
<div class="user-avatar">
|
| 123 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 124 |
+
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
|
| 125 |
+
<circle cx="12" cy="7" r="4"></circle>
|
| 126 |
+
</svg>
|
| 127 |
+
</div>
|
| 128 |
+
<span>User</span>
|
| 129 |
+
</div>
|
| 130 |
+
</div>
|
| 131 |
+
</nav>
|
| 132 |
+
`;
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
customElements.define('custom-navbar', CustomNavbar);
|
|
@@ -1,19 +1,102 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>HuggingSpace Asset Manager</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script>
|
| 10 |
+
tailwind.config = {
|
| 11 |
+
theme: {
|
| 12 |
+
extend: {
|
| 13 |
+
colors: {
|
| 14 |
+
primary: {
|
| 15 |
+
500: '#6366F1',
|
| 16 |
+
600: '#4F46E5'
|
| 17 |
+
},
|
| 18 |
+
secondary: {
|
| 19 |
+
500: '#8B5CF6',
|
| 20 |
+
600: '#7C3AED'
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
</script>
|
| 27 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 28 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 29 |
+
</head>
|
| 30 |
+
<body class="bg-gray-50 min-h-screen">
|
| 31 |
+
<custom-navbar></custom-navbar>
|
| 32 |
+
|
| 33 |
+
<div class="container mx-auto px-4 py-8">
|
| 34 |
+
<div class="flex justify-between items-center mb-8">
|
| 35 |
+
<div>
|
| 36 |
+
<h1 class="text-3xl font-bold text-gray-800">Asset Manager</h1>
|
| 37 |
+
<p class="text-gray-600">Manage your Hugging Face Space assets</p>
|
| 38 |
+
</div>
|
| 39 |
+
<button id="uploadBtn" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center transition-colors">
|
| 40 |
+
<i data-feather="upload" class="mr-2"></i> Upload Files
|
| 41 |
+
</button>
|
| 42 |
+
</div>
|
| 43 |
+
|
| 44 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 45 |
+
<div class="overflow-x-auto">
|
| 46 |
+
<table class="min-w-full divide-y divide-gray-200">
|
| 47 |
+
<thead class="bg-gray-50">
|
| 48 |
+
<tr>
|
| 49 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Preview</th>
|
| 50 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
| 51 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
|
| 52 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URL</th>
|
| 53 |
+
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
| 54 |
+
</tr>
|
| 55 |
+
</thead>
|
| 56 |
+
<tbody id="assetsTable" class="bg-white divide-y divide-gray-200">
|
| 57 |
+
<!-- Table rows will be populated by JavaScript -->
|
| 58 |
+
</tbody>
|
| 59 |
+
</table>
|
| 60 |
+
</div>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<div class="mt-8 bg-white rounded-xl shadow-md p-6">
|
| 64 |
+
<h2 class="text-xl font-bold text-gray-800 mb-4">Export Data</h2>
|
| 65 |
+
<div class="flex flex-col md:flex-row md:items-center gap-4">
|
| 66 |
+
<button id="exportBtn" class="bg-secondary-500 hover:bg-secondary-600 text-white px-4 py-2 rounded-lg flex items-center transition-colors">
|
| 67 |
+
<i data-feather="download" class="mr-2"></i> Export as JSON
|
| 68 |
+
</button>
|
| 69 |
+
<div class="flex-1">
|
| 70 |
+
<textarea id="jsonData" class="w-full h-32 p-3 border border-gray-300 rounded-lg font-mono text-sm" readonly></textarea>
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<!-- Upload Modal -->
|
| 77 |
+
<div id="uploadModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
|
| 78 |
+
<div class="bg-white rounded-lg p-6 w-full max-w-md">
|
| 79 |
+
<div class="flex justify-between items-center mb-4">
|
| 80 |
+
<h3 class="text-lg font-bold">Upload Files</h3>
|
| 81 |
+
<button id="closeModal" class="text-gray-500 hover:text-gray-700">
|
| 82 |
+
<i data-feather="x"></i>
|
| 83 |
+
</button>
|
| 84 |
+
</div>
|
| 85 |
+
<div class="mb-4">
|
| 86 |
+
<label class="block text-gray-700 text-sm font-bold mb-2" for="fileInput">
|
| 87 |
+
Select files to upload
|
| 88 |
+
</label>
|
| 89 |
+
<input type="file" id="fileInput" multiple class="w-full p-2 border border-gray-300 rounded-lg">
|
| 90 |
+
</div>
|
| 91 |
+
<button id="confirmUpload" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg w-full transition-colors">
|
| 92 |
+
Upload
|
| 93 |
+
</button>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
|
| 97 |
+
<script src="components/navbar.js"></script>
|
| 98 |
+
<script src="script.js"></script>
|
| 99 |
+
<script>feather.replace();</script>
|
| 100 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 101 |
+
</body>
|
| 102 |
+
</html>
|
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Enhanced asset management with more flexibility
|
| 2 |
+
class AssetManager {
|
| 3 |
+
constructor() {
|
| 4 |
+
this.assets = this.loadAssets() || [
|
| 5 |
+
{
|
| 6 |
+
id: 1,
|
| 7 |
+
name: "nature-image.jpg",
|
| 8 |
+
type: "image/jpeg",
|
| 9 |
+
url: "https://huggingface.co/spaces/username/space/resolve/main/nature-image.jpg",
|
| 10 |
+
preview: "http://static.photos/nature/320x240/1"
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
id: 2,
|
| 14 |
+
name: "logo.png",
|
| 15 |
+
type: "image/png",
|
| 16 |
+
url: "https://huggingface.co/spaces/username/space/resolve/main/logo.png",
|
| 17 |
+
preview: "http://static.photos/abstract/320x240/2"
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
id: 3,
|
| 21 |
+
name: "document.pdf",
|
| 22 |
+
type: "application/pdf",
|
| 23 |
+
url: "https://huggingface.co/spaces/username/space/resolve/main/document.pdf",
|
| 24 |
+
preview: "http://static.photos/office/320x240/3"
|
| 25 |
+
}
|
| 26 |
+
];
|
| 27 |
+
this.currentId = this.assets.length > 0 ? Math.max(...this.assets.map(a => a.id)) : 0;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
loadAssets() {
|
| 31 |
+
const saved = localStorage.getItem('huggingSpaceAssets');
|
| 32 |
+
return saved ? JSON.parse(saved) : null;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
saveAssets() {
|
| 36 |
+
localStorage.setItem('huggingSpaceAssets', JSON.stringify(this.assets));
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
addAsset(asset) {
|
| 40 |
+
this.currentId++;
|
| 41 |
+
const newAsset = {
|
| 42 |
+
id: this.currentId,
|
| 43 |
+
...asset
|
| 44 |
+
};
|
| 45 |
+
this.assets.push(newAsset);
|
| 46 |
+
this.saveAssets();
|
| 47 |
+
return newAsset;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
updateAsset(id, updates) {
|
| 51 |
+
const index = this.assets.findIndex(a => a.id === id);
|
| 52 |
+
if (index !== -1) {
|
| 53 |
+
this.assets[index] = { ...this.assets[index], ...updates };
|
| 54 |
+
this.saveAssets();
|
| 55 |
+
return this.assets[index];
|
| 56 |
+
}
|
| 57 |
+
return null;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
deleteAsset(id) {
|
| 61 |
+
this.assets = this.assets.filter(a => a.id !== id);
|
| 62 |
+
this.saveAssets();
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
getAssets() {
|
| 66 |
+
return [...this.assets];
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
exportAsJSON() {
|
| 70 |
+
return JSON.stringify(this.assets, null, 2);
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
// Main application
|
| 75 |
+
class HuggingSpaceApp {
|
| 76 |
+
constructor() {
|
| 77 |
+
this.assetManager = new AssetManager();
|
| 78 |
+
this.initElements();
|
| 79 |
+
this.initEventListeners();
|
| 80 |
+
this.render();
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
initElements() {
|
| 84 |
+
this.elements = {
|
| 85 |
+
assetsTable: document.getElementById('assetsTable'),
|
| 86 |
+
uploadBtn: document.getElementById('uploadBtn'),
|
| 87 |
+
uploadModal: document.getElementById('uploadModal'),
|
| 88 |
+
closeModal: document.getElementById('closeModal'),
|
| 89 |
+
fileInput: document.getElementById('fileInput'),
|
| 90 |
+
confirmUpload: document.getElementById('confirmUpload'),
|
| 91 |
+
exportBtn: document.getElementById('exportBtn'),
|
| 92 |
+
jsonData: document.getElementById('jsonData')
|
| 93 |
+
};
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
initEventListeners() {
|
| 97 |
+
this.elements.uploadBtn.addEventListener('click', () => this.toggleModal(true));
|
| 98 |
+
this.elements.closeModal.addEventListener('click', () => this.toggleModal(false));
|
| 99 |
+
this.elements.confirmUpload.addEventListener('click', () => this.handleFileUpload());
|
| 100 |
+
this.elements.exportBtn.addEventListener('click', () => this.exportData());
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
render() {
|
| 104 |
+
this.renderAssetsTable();
|
| 105 |
+
this.updateJsonPreview();
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
renderAssetsTable() {
|
| 109 |
+
const { assetsTable } = this.elements;
|
| 110 |
+
assetsTable.innerHTML = '';
|
| 111 |
+
|
| 112 |
+
this.assetManager.getAssets().forEach(asset => {
|
| 113 |
+
const row = document.createElement('tr');
|
| 114 |
+
row.className = 'hover:bg-gray-50';
|
| 115 |
+
row.innerHTML = this.createAssetRowHTML(asset);
|
| 116 |
+
assetsTable.appendChild(row);
|
| 117 |
+
|
| 118 |
+
// Add event listeners for this row
|
| 119 |
+
this.addRowEventListeners(row, asset.id);
|
| 120 |
+
});
|
| 121 |
+
|
| 122 |
+
feather.replace();
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
createAssetRowHTML(asset) {
|
| 126 |
+
return `
|
| 127 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
| 128 |
+
<img src="${asset.preview}" alt="${asset.name}" class="file-preview">
|
| 129 |
+
</td>
|
| 130 |
+
<td class="px-6 py-4 whitespace-nowrap editable-cell" data-id="${asset.id}" data-field="name">${asset.name}</td>
|
| 131 |
+
<td class="px-6 py-4 whitespace-nowrap editable-cell" data-id="${asset.id}" data-field="type">${asset.type}</td>
|
| 132 |
+
<td class="px-6 py-4 whitespace-nowrap url-cell editable-cell" data-id="${asset.id}" data-field="url">${asset.url}</td>
|
| 133 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium table-actions">
|
| 134 |
+
<button class="text-primary-500 hover:text-primary-600" data-action="copy" data-url="${asset.url}">
|
| 135 |
+
<i data-feather="copy"></i>
|
| 136 |
+
</button>
|
| 137 |
+
<button class="text-red-500 hover:text-red-600" data-action="delete" data-id="${asset.id}">
|
| 138 |
+
<i data-feather="trash-2"></i>
|
| 139 |
+
</button>
|
| 140 |
+
</td>
|
| 141 |
+
`;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
addRowEventListeners(row, assetId) {
|
| 145 |
+
// Editable cells
|
| 146 |
+
row.querySelectorAll('.editable-cell').forEach(cell => {
|
| 147 |
+
cell.addEventListener('dblclick', () => this.makeCellEditable(cell));
|
| 148 |
+
});
|
| 149 |
+
|
| 150 |
+
// Action buttons
|
| 151 |
+
row.querySelector('[data-action="copy"]')?.addEventListener('click', (e) => this.copyUrl(e));
|
| 152 |
+
row.querySelector('[data-action="delete"]')?.addEventListener('click', (e) => this.deleteAsset(e));
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
makeCellEditable(cell) {
|
| 156 |
+
const originalValue = cell.textContent;
|
| 157 |
+
const id = parseInt(cell.dataset.id);
|
| 158 |
+
const field = cell.dataset.field;
|
| 159 |
+
|
| 160 |
+
cell.innerHTML = `<input type="text" value="${originalValue}" class="w-full p-1 border border-gray-300 rounded">`;
|
| 161 |
+
const input = cell.querySelector('input');
|
| 162 |
+
input.focus();
|
| 163 |
+
|
| 164 |
+
const handleBlur = () => {
|
| 165 |
+
const newValue = input.value;
|
| 166 |
+
cell.textContent = newValue;
|
| 167 |
+
this.assetManager.updateAsset(id, { [field]: newValue });
|
| 168 |
+
this.updateJsonPreview();
|
| 169 |
+
|
| 170 |
+
// Re-add event listeners
|
| 171 |
+
cell.addEventListener('dblclick', () => this.makeCellEditable(cell));
|
| 172 |
+
};
|
| 173 |
+
|
| 174 |
+
input.addEventListener('blur', handleBlur);
|
| 175 |
+
input.addEventListener('keypress', (e) => {
|
| 176 |
+
if (e.key === 'Enter') {
|
| 177 |
+
handleBlur();
|
| 178 |
+
}
|
| 179 |
+
});
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
copyUrl(e) {
|
| 183 |
+
const url = e.target.closest('button').dataset.url;
|
| 184 |
+
navigator.clipboard.writeText(url).then(() => {
|
| 185 |
+
const originalHTML = e.target.closest('button').innerHTML;
|
| 186 |
+
e.target.closest('button').innerHTML = '<i data-feather="check"></i>';
|
| 187 |
+
feather.replace();
|
| 188 |
+
|
| 189 |
+
setTimeout(() => {
|
| 190 |
+
e.target.closest('button').innerHTML = originalHTML;
|
| 191 |
+
feather.replace();
|
| 192 |
+
}, 2000);
|
| 193 |
+
});
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
deleteAsset(e) {
|
| 197 |
+
const id = parseInt(e.target.closest('button').dataset.id);
|
| 198 |
+
if (confirm('Are you sure you want to delete this asset?')) {
|
| 199 |
+
this.assetManager.deleteAsset(id);
|
| 200 |
+
this.render();
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
toggleModal(show) {
|
| 205 |
+
this.elements.uploadModal.classList.toggle('hidden', !show);
|
| 206 |
+
if (!show) {
|
| 207 |
+
this.elements.fileInput.value = '';
|
| 208 |
+
}
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
handleFileUpload() {
|
| 212 |
+
const files = this.elements.fileInput.files;
|
| 213 |
+
|
| 214 |
+
if (files.length === 0) {
|
| 215 |
+
alert('Please select files to upload');
|
| 216 |
+
return;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
Array.from(files).forEach(file => {
|
| 220 |
+
const newAsset = {
|
| 221 |
+
name: file.name,
|
| 222 |
+
type: file.type || 'unknown',
|
| 223 |
+
url: `https://huggingface.co/spaces/username/space/resolve/main/${file.name}`,
|
| 224 |
+
preview: `http://static.photos/${this.getRandomCategory()}/320x240/${this.assetManager.currentId + 1}`
|
| 225 |
+
};
|
| 226 |
+
this.assetManager.addAsset(newAsset);
|
| 227 |
+
});
|
| 228 |
+
|
| 229 |
+
this.render();
|
| 230 |
+
this.toggleModal(false);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
exportData() {
|
| 234 |
+
const dataStr = this.assetManager.exportAsJSON();
|
| 235 |
+
const dataUri = 'data:application/json;charset=utf-8,'+ encodeURIComponent(dataStr);
|
| 236 |
+
|
| 237 |
+
const linkElement = document.createElement('a');
|
| 238 |
+
linkElement.setAttribute('href', dataUri);
|
| 239 |
+
linkElement.setAttribute('download', 'hugging-space-assets.json');
|
| 240 |
+
linkElement.click();
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
updateJsonPreview() {
|
| 244 |
+
this.elements.jsonData.value = this.assetManager.exportAsJSON();
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
getRandomCategory() {
|
| 248 |
+
const categories = ['nature', 'office', 'people', 'technology', 'abstract'];
|
| 249 |
+
return categories[Math.floor(Math.random() * categories.length)];
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
// Initialize the application when DOM is loaded
|
| 254 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 255 |
+
new HuggingSpaceApp();
|
| 256 |
+
});
|
|
@@ -1,28 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
font-size: 15px;
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 2 |
+
|
| 3 |
+
:root {
|
| 4 |
+
--primary-500: #6366F1;
|
| 5 |
+
--primary-600: #4F46E5;
|
| 6 |
+
--secondary-500: #8B5CF6;
|
| 7 |
+
--secondary-600: #7C3AED;
|
| 8 |
+
--dark-color: #1E293B;
|
| 9 |
+
--light-color: #F8FAFC;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
* {
|
| 13 |
+
margin: 0;
|
| 14 |
+
padding: 0;
|
| 15 |
+
box-sizing: border-box;
|
| 16 |
+
font-family: 'Inter', sans-serif;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
body {
|
| 20 |
+
background-color: var(--light-color);
|
| 21 |
+
color: var(--dark-color);
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.file-preview {
|
| 25 |
+
max-width: 100px;
|
| 26 |
+
max-height: 100px;
|
| 27 |
+
object-fit: cover;
|
| 28 |
+
border-radius: 0.25rem;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.url-cell {
|
| 32 |
+
max-width: 200px;
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
text-overflow: ellipsis;
|
| 35 |
+
white-space: nowrap;
|
| 36 |
}
|
| 37 |
|
| 38 |
+
.editable-cell {
|
| 39 |
+
cursor: pointer;
|
| 40 |
+
transition: background-color 0.2s;
|
| 41 |
}
|
| 42 |
|
| 43 |
+
.editable-cell:hover {
|
| 44 |
+
background-color: rgba(99, 102, 241, 0.1);
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
+
.editable-cell input {
|
| 48 |
+
width: 100%;
|
| 49 |
+
padding: 0.25rem 0.5rem;
|
| 50 |
+
border: 1px solid #E2E8F0;
|
| 51 |
+
border-radius: 0.25rem;
|
| 52 |
+
outline: none;
|
| 53 |
}
|
| 54 |
|
| 55 |
+
.table-actions button {
|
| 56 |
+
padding: 0.25rem 0.5rem;
|
| 57 |
+
border-radius: 0.25rem;
|
| 58 |
+
margin-right: 0.5rem;
|
| 59 |
+
transition: background-color 0.2s;
|
| 60 |
}
|
| 61 |
+
|
| 62 |
+
.table-actions button:hover {
|
| 63 |
+
background-color: rgba(0, 0, 0, 0.05);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/* Responsive adjustments */
|
| 67 |
+
@media (max-width: 768px) {
|
| 68 |
+
.container {
|
| 69 |
+
padding: 1rem;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
table {
|
| 73 |
+
display: block;
|
| 74 |
+
overflow-x: auto;
|
| 75 |
+
white-space: nowrap;
|
| 76 |
+
}
|
| 77 |
+
}
|