mirror of
https://github.com/soconnor0919/robot-plugins.git
synced 2025-12-12 23:24:43 -05:00
254 lines
12 KiB
HTML
254 lines
12 KiB
HTML
<!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>
|
|
<link rel="stylesheet" href="assets/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div id="loading">Loading repository data...</div>
|
|
<div id="content" class="hidden">
|
|
<!-- Banner -->
|
|
<div id="repoBanner" class="header-banner hidden">
|
|
<img alt="Repository Banner">
|
|
</div>
|
|
|
|
<!-- Header Card -->
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="header-content">
|
|
<img id="repoIcon" alt="Repository Icon" class="header-icon hidden">
|
|
<div>
|
|
<h1 id="repoName" class="title"></h1>
|
|
<p id="repoDescription" class="description"></p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabs -->
|
|
<div class="tabs">
|
|
<div class="tabs-list" role="tablist">
|
|
<button class="tab" role="tab" aria-selected="true" data-state="active" data-tab="overview">Overview</button>
|
|
<button class="tab" role="tab" aria-selected="false" data-tab="plugins">Available Plugins</button>
|
|
</div>
|
|
|
|
<!-- Overview Tab -->
|
|
<div class="tab-content" data-state="active" role="tabpanel" data-tab="overview" aria-hidden="false">
|
|
<div class="grid grid-cols-2">
|
|
<!-- Author Info -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>Author</h2>
|
|
</div>
|
|
<div class="card-content">
|
|
<div>
|
|
<span>Name:</span>
|
|
<span id="authorName"></span>
|
|
</div>
|
|
<div id="authorOrgContainer" class="hidden">
|
|
<span>Organization:</span>
|
|
<span id="authorOrg"></span>
|
|
</div>
|
|
<div id="authorUrlContainer" class="hidden">
|
|
<a id="authorUrl" target="_blank">View Profile</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Compatibility -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>Compatibility</h2>
|
|
</div>
|
|
<div class="card-content">
|
|
<div>
|
|
<h3>HRIStudio</h3>
|
|
<div>
|
|
<span>Min Version:</span>
|
|
<span id="hriMin"></span>
|
|
</div>
|
|
<div id="hriRecommendedContainer" class="hidden">
|
|
<span>Recommended:</span>
|
|
<span id="hriRecommended"></span>
|
|
</div>
|
|
</div>
|
|
<div id="ros2Container" class="hidden">
|
|
<h3>ROS 2</h3>
|
|
<div id="ros2Distributions" style="margin: 0.5rem 0;"></div>
|
|
<div id="ros2RecommendedContainer" class="hidden">
|
|
<span>Recommended:</span>
|
|
<span id="ros2Recommended"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tags -->
|
|
<div class="card" style="margin-top: 1.5rem;">
|
|
<div class="card-header">
|
|
<h2>Tags</h2>
|
|
</div>
|
|
<div class="card-content">
|
|
<div id="tags" style="margin: -0.25rem;"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Plugins Tab -->
|
|
<div class="tab-content" role="tabpanel" data-tab="plugins" aria-hidden="true">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
|
<h2 style="margin: 0;">Available Plugins</h2>
|
|
<span class="badge badge-secondary" id="pluginCount"></span>
|
|
</div>
|
|
</div>
|
|
<div class="card-content">
|
|
<div id="pluginGrid" class="plugin-grid">
|
|
<!-- Plugins will be loaded here -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Tab management
|
|
document.querySelectorAll('.tab').forEach(tab => {
|
|
tab.addEventListener('click', () => {
|
|
// Update tab states
|
|
document.querySelectorAll('.tab').forEach(t => {
|
|
t.setAttribute('data-state', '');
|
|
t.setAttribute('aria-selected', 'false');
|
|
});
|
|
tab.setAttribute('data-state', 'active');
|
|
tab.setAttribute('aria-selected', 'true');
|
|
|
|
// Update content states
|
|
const tabId = tab.getAttribute('data-tab');
|
|
document.querySelectorAll('.tab-content').forEach(content => {
|
|
const isActive = content.getAttribute('data-tab') === tabId;
|
|
content.setAttribute('data-state', isActive ? 'active' : '');
|
|
content.setAttribute('aria-hidden', isActive ? 'false' : 'true');
|
|
});
|
|
});
|
|
});
|
|
|
|
// Repository data loading
|
|
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} plugins`;
|
|
|
|
// 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 = 'badge';
|
|
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 = 'badge badge-secondary';
|
|
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.classList.remove('hidden');
|
|
banner.querySelector('img').src = data.assets.banner;
|
|
}
|
|
|
|
// Load plugins
|
|
const pluginGrid = document.getElementById('pluginGrid');
|
|
const pluginsResponse = await fetch('plugins/index.json');
|
|
const pluginFiles = await pluginsResponse.json();
|
|
|
|
for (const pluginFile of pluginFiles) {
|
|
const pluginResponse = await fetch(`plugins/${pluginFile}`);
|
|
const plugin = await pluginResponse.json();
|
|
|
|
const card = document.createElement('div');
|
|
card.className = 'plugin-card';
|
|
card.innerHTML = `
|
|
<div class="plugin-header">
|
|
<img src="${plugin.assets.thumbnailUrl}" alt="${plugin.name}" class="plugin-icon">
|
|
<div class="plugin-info">
|
|
<div class="plugin-title">${plugin.name}</div>
|
|
<div class="plugin-description">${plugin.description || ''}</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<span class="badge badge-secondary">${plugin.platform}</span>
|
|
</div>
|
|
`;
|
|
pluginGrid.appendChild(card);
|
|
}
|
|
|
|
// 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> |