Spaces:
Running
Running
File size: 23,526 Bytes
020750b 4897ebf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Office Space Visualization</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.floor-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.progress-bar {
transition: width 1s ease-in-out;
}
.department-tag {
transition: all 0.3s ease;
}
.department-tag:hover {
transform: scale(1.05);
}
</style>
</head>
<body class="bg-gray-50">
<header class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center">
<h1 class="text-3xl font-bold text-gray-900">
<i data-feather="layout" class="inline mr-2"></i>
Office Space Visualization
</h1>
<div class="flex items-center space-x-4">
<span class="text-sm text-gray-500">Last updated: Today</span>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md flex items-center">
<i data-feather="refresh-cw" class="w-4 h-4 mr-2"></i>
Refresh
</button>
</div>
</div>
</div>
</header>
<main class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<!-- Summary Cards -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-lg shadow p-6" data-aos="fade-up">
<div class="flex items-center justify-between">
<h3 class="text-lg font-medium text-gray-900">Total Workstations</h3>
<div class="bg-blue-100 p-2 rounded-full">
<i data-feather="monitor" class="text-blue-600 w-5 h-5"></i>
</div>
</div>
<p class="mt-2 text-3xl font-bold text-gray-900">187</p>
<div class="mt-4">
<div class="flex justify-between text-sm text-gray-500">
<span>Occupied</span>
<span>91%</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
<div class="bg-blue-600 h-2.5 rounded-full progress-bar" style="width: 91%"></div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6" data-aos="fade-up" data-aos-delay="100">
<div class="flex items-center justify-between">
<h3 class="text-lg font-medium text-gray-900">Available Spaces</h3>
<div class="bg-green-100 p-2 rounded-full">
<i data-feather="check-circle" class="text-green-600 w-5 h-5"></i>
</div>
</div>
<p class="mt-2 text-3xl font-bold text-gray-900">17</p>
<div class="mt-4">
<div class="flex justify-between text-sm text-gray-500">
<span>Shared</span>
<span>4</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-1">
<div class="bg-green-500 h-2.5 rounded-full progress-bar" style="width: 24%"></div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6" data-aos="fade-up" data-aos-delay="200">
<div class="flex items-center justify-between">
<h3 class="text-lg font-medium text-gray-900">Departments</h3>
<div class="bg-purple-100 p-2 rounded-full">
<i data-feather="users" class="text-purple-600 w-5 h-5"></i>
</div>
</div>
<p class="mt-2 text-3xl font-bold text-gray-900">12</p>
<div class="mt-4 flex flex-wrap gap-2">
<span class="department-tag bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">Finance</span>
<span class="department-tag bg-green-100 text-green-800 text-xs px-2 py-1 rounded">Housing</span>
<span class="department-tag bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded">CGP</span>
<span class="department-tag bg-purple-100 text-purple-800 text-xs px-2 py-1 rounded">IT</span>
</div>
</div>
</div>
<!-- Floor Navigation -->
<div class="mb-8">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Floors Overview</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<div class="floor-card bg-white rounded-lg shadow p-6 cursor-pointer transition-all duration-300" onclick="showFloorData(9)">
<div class="flex items-center space-x-3">
<div class="bg-blue-100 p-3 rounded-full">
<i data-feather="home" class="text-blue-600 w-6 h-6"></i>
</div>
<div>
<h3 class="font-medium text-gray-900">9th Floor</h3>
<p class="text-sm text-gray-500">94 workstations</p>
</div>
</div>
<div class="mt-4">
<div class="flex justify-between text-xs text-gray-500">
<span>91 occupied</span>
<span>2 open</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-1.5 mt-1">
<div class="bg-blue-600 h-1.5 rounded-full" style="width: 97%"></div>
</div>
</div>
</div>
<div class="floor-card bg-white rounded-lg shadow p-6 cursor-pointer transition-all duration-300" onclick="showFloorData(8)">
<div class="flex items-center space-x-3">
<div class="bg-green-100 p-3 rounded-full">
<i data-feather="home" class="text-green-600 w-6 h-6"></i>
</div>
<div>
<h3 class="font-medium text-gray-900">8th Floor</h3>
<p class="text-sm text-gray-500">22 workstations</p>
</div>
</div>
<div class="mt-4">
<div class="flex justify-between text-xs text-gray-500">
<span>14 occupied</span>
<span>8 open</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-1.5 mt-1">
<div class="bg-green-500 h-1.5 rounded-full" style="width: 64%"></div>
</div>
</div>
</div>
<div class="floor-card bg-white rounded-lg shadow p-6 cursor-pointer transition-all duration-300" onclick="showFloorData(6)">
<div class="flex items-center space-x-3">
<div class="bg-yellow-100 p-3 rounded-full">
<i data-feather="home" class="text-yellow-600 w-6 h-6"></i>
</div>
<div>
<h3 class="font-medium text-gray-900">6th Floor</h3>
<p class="text-sm text-gray-500">54 workstations</p>
</div>
</div>
<div class="mt-4">
<div class="flex justify-between text-xs text-gray-500">
<span>42 occupied</span>
<span>11 open</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-1.5 mt-1">
<div class="bg-yellow-500 h-1.5 rounded-full" style="width: 78%"></div>
</div>
</div>
</div>
<div class="floor-card bg-white rounded-lg shadow p-6 cursor-pointer transition-all duration-300" onclick="showFloorData(4)">
<div class="flex items-center space-x-3">
<div class="bg-purple-100 p-3 rounded-full">
<i data-feather="home" class="text-purple-600 w-6 h-6"></i>
</div>
<div>
<h3 class="font-medium text-gray-900">4th Floor</h3>
<p class="text-sm text-gray-500">34 workstations</p>
</div>
</div>
<div class="mt-4">
<div class="flex justify-between text-xs text-gray-500">
<span>25 occupied</span>
<span>2 open</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-1.5 mt-1">
<div class="bg-purple-500 h-1.5 rounded-full" style="width: 93%"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Data Visualization -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Department Distribution Chart -->
<div class="bg-white p-6 rounded-lg shadow" data-aos="fade-right">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold text-gray-800">Department Distribution</h2>
<div class="relative">
<select class="appearance-none bg-gray-100 border border-gray-300 text-gray-700 py-2 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500">
<option>All Floors</option>
<option>9th Floor</option>
<option>8th Floor</option>
<option>6th Floor</option>
<option>4th Floor</option>
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
<i data-feather="chevron-down" class="w-4 h-4"></i>
</div>
</div>
</div>
<div class="h-80">
<canvas id="departmentChart"></canvas>
</div>
</div>
<!-- Occupancy vs Availability -->
<div class="bg-white p-6 rounded-lg shadow" data-aos="fade-left">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold text-gray-800">Occupancy vs Availability</h2>
<div class="flex space-x-2">
<button class="bg-gray-100 hover:bg-gray-200 text-gray-800 px-3 py-1 rounded-md text-sm flex items-center">
<i data-feather="download" class="w-4 h-4 mr-1"></i>
Export
</button>
</div>
</div>
<div class="h-80">
<canvas id="occupancyChart"></canvas>
</div>
</div>
</div>
<!-- Detailed Floor Data -->
<div class="mt-8 bg-white rounded-lg shadow overflow-hidden" data-aos="fade-up">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-800">Detailed Floor Data</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Floor</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Area</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Occupied</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Open</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Notes</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="floorDataTable">
<!-- Data will be inserted here by JavaScript -->
</tbody>
</table>
</div>
</div>
</main>
<footer class="bg-white border-t border-gray-200 mt-12">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
<div class="flex flex-col md:flex-row justify-between items-center">
<p class="text-gray-500 text-sm">© 2023 Office Space Visualization. All rights reserved.</p>
<div class="flex space-x-6 mt-4 md:mt-0">
<a href="#" class="text-gray-400 hover:text-gray-500">
<i data-feather="github" class="w-5 h-5"></i>
</a>
<a href="#" class="text-gray-400 hover:text-gray-500">
<i data-feather="twitter" class="w-5 h-5"></i>
</a>
<a href="#" class="text-gray-400 hover:text-gray-500">
<i data-feather="linkedin" class="w-5 h-5"></i>
</a>
</div>
</div>
</div>
</footer>
<script>
// Initialize AOS and Feather Icons
AOS.init();
feather.replace();
// Sample data
const floorData = {
9: [
{ area: "Development/Communications", total: 5, occupied: 5, open: 0, notes: "" },
{ area: "Housing", total: 6, occupied: 6, open: 0, notes: "" },
{ area: "Finance", total: 29, occupied: 28, open: 1, notes: "" },
{ area: "CGP", total: 8, occupied: 7, open: 1, notes: "Shared" },
{ area: "Services", total: 15, occupied: 15, open: 0, notes: "" },
{ area: "Outside Meredith - Help Desk", total: 3, occupied: 3, open: 0, notes: "" },
{ area: "Marina's Area", total: 4, occupied: 4, open: 0, notes: "" },
{ area: "Development/Communications", total: 2, occupied: 2, open: 0, notes: "Shared" },
{ area: "Services Project Manager/SD BI", total: 2, occupied: 1, open: 1, notes: "Accounting for a currently fully remote staff" },
{ area: "Outside Mail Room", total: 4, occupied: 4, open: 0, notes: "" },
{ area: "Finance", total: 3, occupied: 3, open: 0, notes: "" },
{ area: "HR", total: 1, occupied: 1, open: 0, notes: "" },
{ area: "Operations", total: 3, occupied: 3, open: 0, notes: "" },
{ area: "Receptionist", total: 1, occupied: 1, open: 0, notes: "" },
{ area: "Executive Assistant", total: 1, occupied: 1, open: 0, notes: "" },
{ area: "Office Manager", total: 1, occupied: 1, open: 0, notes: "" }
],
8: [
{ area: "Workstations - IT", total: 11, occupied: 3, open: 8, notes: "" },
{ area: "Workstations - Care Transitions", total: 8, occupied: 8, open: 0, notes: "" },
{ area: "Conference Room", total: 1, occupied: 1, open: 0, notes: "Dev Storage" },
{ area: "Offices", total: 2, occupied: 2, open: 0, notes: "Shared" }
],
6: [
{ area: "CGP Workstations", total: 33, occupied: 24, open: 9, notes: "Increased to reflect added staff" },
{ area: "CGP Office(s)", total: 4, occupied: 4, open: 0, notes: "3 Shared Offices - 1-2 Staff; 1-3 Staff" },
{ area: "APS Workstations", total: 16, occupied: 14, open: 2, notes: "" },
{ area: "APS Office(s)", total: 1, occupied: 1, open: 0, notes: "" },
{ area: "Reception", total: 1, occupied: 1, open: 0, notes: "" }
],
4: [
{ area: "Workstations", total: 34, occupied: 25, open: 2, notes: "" },
{ area: "Training Room", total: 1, occupied: 0, open: 0, notes: "" },
{ area: "Reception", total: 1, occupied: 0, open: 0, notes: "" },
{ area: "Conference Room", total: 1, occupied: 0, open: 0, notes: "" },
{ area: "Offices", total: 8, occupied: 0, open: 0, notes: "" }
]
};
// Function to show floor data in table
function showFloorData(floor) {
const tableBody = document.getElementById('floorDataTable');
tableBody.innerHTML = '';
floorData[floor].forEach(item => {
const row = document.createElement('tr');
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${floor}th</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.area}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.total}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.occupied}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.open}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.notes}</td>
`;
tableBody.appendChild(row);
});
}
// Initialize with 9th floor data
showFloorData(9);
// Charts
document.addEventListener('DOMContentLoaded', function() {
// Department Distribution Chart
const deptCtx = document.getElementById('departmentChart').getContext('2d');
const deptChart = new Chart(deptCtx, {
type: 'doughnut',
data: {
labels: ['Finance', 'Housing', 'CGP', 'IT', 'Services', 'Development', 'Operations', 'HR', 'APS'],
datasets: [{
data: [32, 12, 37, 11, 17, 7, 3, 1, 17],
backgroundColor: [
'#3B82F6',
'#10B981',
'#F59E0B',
'#8B5CF6',
'#EC4899',
'#6366F1',
'#14B8A6',
'#F97316',
'#64748B'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
},
tooltip: {
callbacks: {
label: function(context) {
const label = context.label || '';
const value = context.raw || 0;
const total = context.dataset.data.reduce((a, b) => a + b, 0);
const percentage = Math.round((value / total) * 100);
return `${label}: ${value} (${percentage}%)`;
}
}
}
}
}
});
// Occupancy vs Availability Chart
const occCtx = document.getElementById('occupancyChart').getContext('2d');
const occChart = new Chart(occCtx, {
type: 'bar',
data: {
labels: ['9th Floor', '8th Floor', '6th Floor', '4th Floor'],
datasets: [
{
label: 'Occupied',
data: [91, 14, 42, 25],
backgroundColor: '#3B82F6',
borderRadius: 4
},
{
label: 'Available',
data: [2, 8, 11, 2],
backgroundColor: '#10B981',
borderRadius: 4
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
stacked: true,
},
y: {
stacked: true,
beginAtZero: true
}
},
plugins: {
legend: {
position: 'top',
},
tooltip: {
callbacks: {
afterBody: function(context) {
const dataset = context[0];
const total = dataset.dataset.data.reduce((a, b) => a + b, 0);
const percentage = Math.round((dataset.raw / total) * 100);
return `Percentage: ${percentage}%`;
}
}
}
}
}
});
});
// Add hover effects to floor cards
document.querySelectorAll('.floor-card').forEach(card => {
card.addEventListener('mouseenter', function() {
this.querySelector('i').style.transform = 'scale(1.1)';
});
card.addEventListener('mouseleave', function() {
this.querySelector('i').style.transform = 'scale(1)';
});
});
</script>
</body>
</html>
|