mirror of
https://github.com/soconnor0919/robot-plugins.git
synced 2025-12-12 23:24:43 -05:00
Refactor README with comprehensive repository structure and web interface details
This commit is contained in:
191
index.html
Normal file
191
index.html
Normal file
@@ -0,0 +1,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>HRIStudio Robot Plugins</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap">
|
||||
<style>
|
||||
body { font-family: 'Inter', sans-serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto p-6">
|
||||
<div id="loading" class="text-center py-12">Loading repository data...</div>
|
||||
<div id="content" class="hidden space-y-8">
|
||||
<!-- Header -->
|
||||
<div class="space-y-4">
|
||||
<div class="flex items-center gap-4">
|
||||
<img id="repoIcon" alt="Repository Icon" class="w-16 h-16 rounded-lg bg-white shadow-sm border hidden">
|
||||
<div>
|
||||
<h1 id="repoName" class="text-3xl font-bold"></h1>
|
||||
<p id="repoDescription" class="text-gray-600"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="repoBanner" class="w-full h-48 rounded-xl bg-cover bg-center hidden"></div>
|
||||
</div>
|
||||
|
||||
<!-- Stats -->
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="bg-white p-4 rounded-lg shadow-sm border">
|
||||
<div class="text-sm text-gray-600">Plugins</div>
|
||||
<div id="pluginCount" class="text-2xl font-semibold"></div>
|
||||
</div>
|
||||
<div class="bg-white p-4 rounded-lg shadow-sm border">
|
||||
<div class="text-sm text-gray-600">Downloads</div>
|
||||
<div id="downloadCount" class="text-2xl font-semibold"></div>
|
||||
</div>
|
||||
<div class="bg-white p-4 rounded-lg shadow-sm border">
|
||||
<div class="text-sm text-gray-600">Stars</div>
|
||||
<div id="starCount" class="text-2xl font-semibold"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Details -->
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<!-- Author Info -->
|
||||
<div class="bg-white p-6 rounded-lg shadow-sm border">
|
||||
<h2 class="text-lg font-semibold mb-4">Author</h2>
|
||||
<div class="space-y-2">
|
||||
<div>
|
||||
<span class="text-gray-600">Name:</span>
|
||||
<span id="authorName" class="ml-2"></span>
|
||||
</div>
|
||||
<div id="authorOrgContainer" class="hidden">
|
||||
<span class="text-gray-600">Organization:</span>
|
||||
<span id="authorOrg" class="ml-2"></span>
|
||||
</div>
|
||||
<div id="authorUrlContainer" class="hidden">
|
||||
<a id="authorUrl" class="text-blue-600 hover:underline" target="_blank">View Profile</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Compatibility -->
|
||||
<div class="bg-white p-6 rounded-lg shadow-sm border">
|
||||
<h2 class="text-lg font-semibold mb-4">Compatibility</h2>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<div class="text-gray-600 mb-2">HRIStudio</div>
|
||||
<div class="space-y-1">
|
||||
<div>
|
||||
<span class="text-sm text-gray-600">Min Version:</span>
|
||||
<code id="hriMin" class="ml-2 px-2 py-1 bg-gray-100 rounded text-sm"></code>
|
||||
</div>
|
||||
<div id="hriRecommendedContainer" class="hidden">
|
||||
<span class="text-sm text-gray-600">Recommended:</span>
|
||||
<code id="hriRecommended" class="ml-2 px-2 py-1 bg-gray-100 rounded text-sm"></code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ros2Container" class="hidden">
|
||||
<div class="text-gray-600 mb-2">ROS 2</div>
|
||||
<div class="space-y-1">
|
||||
<div id="ros2Distributions"></div>
|
||||
<div id="ros2RecommendedContainer" class="hidden">
|
||||
<span class="text-sm text-gray-600">Recommended:</span>
|
||||
<code id="ros2Recommended" class="ml-2 px-2 py-1 bg-gray-100 rounded text-sm"></code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tags -->
|
||||
<div class="bg-white p-6 rounded-lg shadow-sm border">
|
||||
<h2 class="text-lg font-semibold mb-4">Tags</h2>
|
||||
<div id="tags" class="flex flex-wrap gap-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function loadRepositoryData() {
|
||||
try {
|
||||
const response = await fetch('repository.json');
|
||||
const data = await response.json();
|
||||
|
||||
// Update page title
|
||||
document.title = data.name;
|
||||
|
||||
// Update header
|
||||
document.getElementById('repoName').textContent = data.name;
|
||||
document.getElementById('repoDescription').textContent = data.description || '';
|
||||
|
||||
// Update stats
|
||||
document.getElementById('pluginCount').textContent = data.stats?.plugins || 0;
|
||||
document.getElementById('downloadCount').textContent = data.stats?.downloads || 0;
|
||||
document.getElementById('starCount').textContent = data.stats?.stars || 0;
|
||||
|
||||
// Update author info
|
||||
document.getElementById('authorName').textContent = data.author.name;
|
||||
if (data.author.organization) {
|
||||
document.getElementById('authorOrgContainer').classList.remove('hidden');
|
||||
document.getElementById('authorOrg').textContent = data.author.organization;
|
||||
}
|
||||
if (data.author.url) {
|
||||
document.getElementById('authorUrlContainer').classList.remove('hidden');
|
||||
document.getElementById('authorUrl').href = data.author.url;
|
||||
}
|
||||
|
||||
// Update compatibility
|
||||
document.getElementById('hriMin').textContent = data.compatibility.hristudio.min;
|
||||
if (data.compatibility.hristudio.recommended) {
|
||||
document.getElementById('hriRecommendedContainer').classList.remove('hidden');
|
||||
document.getElementById('hriRecommended').textContent = data.compatibility.hristudio.recommended;
|
||||
}
|
||||
|
||||
if (data.compatibility.ros2) {
|
||||
document.getElementById('ros2Container').classList.remove('hidden');
|
||||
const distributionsDiv = document.getElementById('ros2Distributions');
|
||||
data.compatibility.ros2.distributions.forEach(dist => {
|
||||
const badge = document.createElement('span');
|
||||
badge.className = 'inline-block px-2 py-1 bg-gray-100 rounded text-sm mr-2';
|
||||
badge.textContent = dist;
|
||||
distributionsDiv.appendChild(badge);
|
||||
});
|
||||
|
||||
if (data.compatibility.ros2.recommended) {
|
||||
document.getElementById('ros2RecommendedContainer').classList.remove('hidden');
|
||||
document.getElementById('ros2Recommended').textContent = data.compatibility.ros2.recommended;
|
||||
}
|
||||
}
|
||||
|
||||
// Update tags
|
||||
const tagsContainer = document.getElementById('tags');
|
||||
data.tags.forEach(tag => {
|
||||
const badge = document.createElement('span');
|
||||
badge.className = 'px-2 py-1 bg-gray-100 rounded-full text-sm text-gray-700';
|
||||
badge.textContent = tag;
|
||||
tagsContainer.appendChild(badge);
|
||||
});
|
||||
|
||||
// Handle assets
|
||||
if (data.assets?.icon) {
|
||||
const iconImg = document.getElementById('repoIcon');
|
||||
iconImg.src = data.assets.icon;
|
||||
iconImg.classList.remove('hidden');
|
||||
}
|
||||
|
||||
if (data.assets?.banner) {
|
||||
const banner = document.getElementById('repoBanner');
|
||||
banner.style.backgroundImage = `url(${data.assets.banner})`;
|
||||
banner.classList.remove('hidden');
|
||||
}
|
||||
|
||||
// Show content
|
||||
document.getElementById('loading').classList.add('hidden');
|
||||
document.getElementById('content').classList.remove('hidden');
|
||||
} catch (error) {
|
||||
console.error('Error loading repository data:', error);
|
||||
document.getElementById('loading').textContent = 'Error loading repository data';
|
||||
}
|
||||
}
|
||||
|
||||
// Load data when page loads
|
||||
loadRepositoryData();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user