Refactor HTML structure with semantic markup and improved component organization

This commit is contained in:
2025-02-14 10:13:38 -05:00
parent 4163f245f2
commit 59bbed96f3
2 changed files with 297 additions and 371 deletions

View File

@@ -5,20 +5,12 @@
--foreground: 200 50% 20%;
--card: 0 0% 100%;
--card-foreground: 200 50% 20%;
--popover: 0 0% 100%;
--popover-foreground: 200 50% 20%;
--primary: 200 85% 45%;
--primary-foreground: 0 0% 100%;
--secondary: 200 30% 96%;
--secondary-foreground: 200 50% 20%;
--muted: 200 30% 96%;
--muted-foreground: 200 30% 40%;
--accent: 200 85% 45%;
--accent-foreground: 0 0% 100%;
--border: 200 30% 90%;
--input: 200 30% 90%;
--ring: 200 85% 45%;
--radius: 0.5rem;
--radius: 0.75rem;
}
@media (prefers-color-scheme: dark) {
@@ -27,24 +19,22 @@
--foreground: 200 20% 96%;
--card: 200 25% 15%;
--card-foreground: 200 15% 85%;
--popover: 200 50% 8%;
--popover-foreground: 200 20% 96%;
--primary: 200 70% 40%;
--primary-foreground: 0 0% 100%;
--secondary: 200 30% 20%;
--secondary-foreground: 200 20% 96%;
--muted: 200 30% 20%;
--muted-foreground: 200 30% 65%;
--accent: 200 70% 40%;
--accent-foreground: 0 0% 100%;
--border: 200 30% 20%;
--input: 200 30% 20%;
--ring: 200 70% 40%;
}
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Global styles */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
@@ -95,6 +85,15 @@ body::after {
max-width: 64rem;
margin: 0 auto;
padding: 2rem 1.5rem;
}
.content {
display: flex;
flex-direction: column;
gap: 2rem;
}
.main {
display: flex;
flex-direction: column;
gap: 2rem;
@@ -102,42 +101,122 @@ body::after {
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 2rem;
}
.grid-cols-2 {
grid-template-columns: repeat(2, 1fr);
}
.space-y-6 > * + * {
margin-top: 2rem;
}
@media (max-width: 768px) {
.grid-cols-2 {
.grid {
grid-template-columns: 1fr;
}
}
/* Card Components */
.card {
border-radius: var(--radius);
border: 1px solid hsl(var(--border));
/* Header */
.header {
text-align: center;
margin-bottom: 1rem;
}
.header-content {
display: inline-flex;
align-items: center;
gap: 1.5rem;
padding: 1.5rem 2rem;
background: hsl(var(--card) / 0.5);
color: hsl(var(--card-foreground));
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
backdrop-filter: blur(16px);
border: 1px solid hsl(var(--border));
border-radius: var(--radius);
backdrop-filter: blur(8px);
}
.card + .card {
margin-top: 1.5rem;
.header-icon {
width: 4rem;
height: 4rem;
border-radius: var(--radius);
object-fit: contain;
background: hsl(var(--muted));
padding: 0.5rem;
}
.card-header {
.header-text {
text-align: left;
}
.header-title {
font-size: 1.875rem;
font-weight: 600;
line-height: 1.2;
letter-spacing: -0.025em;
margin-bottom: 0.5rem;
}
.header-description {
color: hsl(var(--muted-foreground));
font-size: 1.125rem;
}
/* Banner */
.banner {
width: 100%;
height: 16rem;
border-radius: var(--radius);
object-fit: cover;
border: 1px solid hsl(var(--border));
background: hsl(var(--muted));
}
/* Stats */
.stats {
display: grid;
gap: 1.5rem;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.stat {
display: flex;
align-items: center;
gap: 1rem;
padding: 1.5rem;
background: hsl(var(--card) / 0.5);
border: 1px solid hsl(var(--border));
border-radius: var(--radius);
backdrop-filter: blur(8px);
}
.stat-icon {
width: 2rem;
height: 2rem;
color: hsl(var(--primary));
}
.stat-content {
display: flex;
flex-direction: column;
gap: 0.375rem;
gap: 0.25rem;
}
.stat-label {
font-size: 0.875rem;
color: hsl(var(--muted-foreground));
}
.stat-value {
font-size: 1.5rem;
font-weight: 600;
line-height: 1;
}
/* Cards */
.card {
background: hsl(var(--card) / 0.5);
border: 1px solid hsl(var(--border));
border-radius: var(--radius);
backdrop-filter: blur(8px);
}
.card-title {
padding: 1.5rem;
font-size: 1.25rem;
font-weight: 600;
border-bottom: 1px solid hsl(var(--border));
}
@@ -145,243 +224,119 @@ body::after {
padding: 1.5rem;
}
.card-title {
font-size: 1.5rem;
font-weight: 600;
line-height: 1;
letter-spacing: -0.025em;
color: hsl(var(--card-foreground));
}
.card-description {
font-size: 0.875rem;
color: hsl(var(--muted-foreground));
}
/* Sub Card */
.sub-card {
border-radius: calc(var(--radius) - 0.25rem);
border: 1px solid hsl(var(--border));
background: hsl(var(--secondary));
color: hsl(var(--secondary-foreground));
}
.sub-card-content {
padding: 1.25rem;
}
/* Header Card */
.header-card {
margin-bottom: 1.5rem;
}
.header-card .card-header {
flex-direction: row;
align-items: center;
gap: 1rem;
border-bottom: none;
}
.header-card img {
width: 4rem;
height: 4rem;
border-radius: var(--radius);
object-fit: contain;
background: hsl(var(--secondary));
padding: 0.5rem;
}
/* Banner */
.banner {
width: 100%;
height: 12rem;
border-radius: calc(var(--radius) + 0.25rem);
object-fit: cover;
margin-bottom: 2rem;
border: 1px solid hsl(var(--border));
background: hsl(var(--secondary));
}
/* Stats Grid */
.stats-grid {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stat-item {
display: grid;
grid-template-columns: auto 1fr;
grid-template-areas:
"icon label"
"value value";
gap: 0.75rem;
padding: 1.25rem;
background: hsl(var(--secondary));
border-radius: var(--radius);
align-items: center;
}
.stat-item .icon {
grid-area: icon;
width: 1.5rem;
height: 1.5rem;
color: hsl(var(--primary));
}
.stat-label {
grid-area: label;
font-size: 0.875rem;
font-weight: 500;
color: hsl(var(--muted-foreground));
margin-left: 0.75rem;
}
.stat-value {
grid-area: value;
font-size: 1.5rem;
font-weight: 600;
color: hsl(var(--card-foreground));
line-height: 1;
}
/* Info Grid */
.info-grid {
display: grid;
/* Info Lists */
.info-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.info-section {
display: grid;
.info-group {
display: flex;
flex-direction: column;
gap: 1rem;
}
.info-section-header {
display: flex;
align-items: center;
gap: 0.75rem;
padding-bottom: 0.75rem;
.info-group:not(:last-child) {
padding-bottom: 1.5rem;
border-bottom: 1px solid hsl(var(--border));
}
.info-section-header .icon {
width: 1.25rem;
height: 1.25rem;
color: hsl(var(--primary));
}
.info-title {
font-size: 0.875rem;
font-weight: 600;
color: hsl(var(--card-foreground));
line-height: 1;
}
.info-item {
display: grid;
gap: 0.5rem;
}
.info-header {
position: relative;
display: grid;
grid-template-columns: auto 1fr;
.info-group-header {
display: flex;
align-items: center;
gap: 0.75rem;
}
.info-header .icon {
width: 1rem;
height: 1rem;
.info-group-title {
font-size: 1rem;
font-weight: 600;
}
.info {
display: flex;
align-items: flex-start;
gap: 0.75rem;
}
.info-icon {
width: 1.25rem;
height: 1.25rem;
color: hsl(var(--muted-foreground));
flex-shrink: 0;
margin-top: 0.125rem;
}
.info-content {
flex: 1;
min-width: 0;
}
.info-label {
font-size: 0.875rem;
color: hsl(var(--muted-foreground));
margin-bottom: 0.25rem;
}
.info-value {
font-size: 0.875rem;
color: hsl(var(--card-foreground));
margin-left: 1.75rem;
}
.info-link {
color: hsl(var(--primary));
text-decoration: none;
font-size: 0.875rem;
margin-left: 1.75rem;
}
.info-link:hover {
text-decoration: underline;
}
/* Badge List */
.badge-list {
/* Badges and Tags */
.badge-list,
.tag-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-left: 1.75rem;
}
/* Badges and Tags */
.badge {
display: inline-flex;
align-items: center;
height: 1.5rem;
padding: 0 0.75rem;
border-radius: 9999px;
font-size: 0.875rem;
font-weight: 500;
line-height: 1;
background: hsl(var(--primary));
color: hsl(var(--primary-foreground));
white-space: nowrap;
}
.badge.secondary {
background: hsl(var(--card));
color: hsl(var(--card-foreground));
border: 1px solid hsl(var(--border));
}
.badge,
.tag {
display: inline-flex;
align-items: center;
height: 1.5rem;
padding: 0 0.75rem;
border-radius: 9999px;
font-size: 0.875rem;
line-height: 1;
background: hsl(var(--card));
color: hsl(var(--card-foreground));
border: 1px solid hsl(var(--border));
font-size: 0.75rem;
font-weight: 500;
background: hsl(var(--muted));
color: hsl(var(--muted-foreground));
white-space: nowrap;
}
.badge {
background: hsl(var(--primary));
color: hsl(var(--primary-foreground));
}
/* Code */
code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
background: hsl(var(--card));
font-size: 0.875rem;
background: hsl(var(--muted));
padding: 0.25rem 0.5rem;
border-radius: calc(var(--radius) - 0.25rem);
font-size: 0.875rem;
border: 1px solid hsl(var(--border));
}
/* Utilities */
.hidden { display: none; }
#loading {
/* Loading State */
.loading {
text-align: center;
padding: 3rem;
color: hsl(var(--muted-foreground));
font-size: 1.125rem;
}
/* Content Layout */
#content {
display: flex;
flex-direction: column;
gap: 2rem;
/* Utilities */
.hidden {
display: none;
}

View File

@@ -8,192 +8,160 @@
</head>
<body>
<div class="container">
<div id="loading">Loading repository data...</div>
<div id="content" class="hidden">
<!-- Header -->
<div class="card header-card">
<div class="card-header">
<img id="repoIcon" alt="Repository Icon" class="hidden">
<div>
<h3 id="repoName" class="card-title"></h3>
<p id="repoDescription" class="card-description"></p>
<div id="loading" class="loading">Loading repository data...</div>
<div id="content" class="content hidden">
<header class="header">
<div class="header-content">
<img id="repoIcon" alt="Repository Icon" class="header-icon hidden">
<div class="header-text">
<h1 id="repoName" class="header-title"></h1>
<p id="repoDescription" class="header-description"></p>
</div>
</div>
</div>
</header>
<img id="repoBanner" class="banner hidden">
<!-- Stats -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Statistics</h3>
<p class="card-description">Repository information and metrics</p>
</div>
<div class="card-content">
<div class="stats-grid">
<div class="stat-item">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
<path d="M3.3 7l8.7 5 8.7-5"></path>
</svg>
<span class="stat-label">Available Plugins</span>
<span id="pluginCount" class="stat-value"></span>
<main class="main">
<div class="stats">
<div class="stat">
<svg class="stat-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
<path d="M3.3 7l8.7 5 8.7-5"></path>
</svg>
<div class="stat-content">
<div class="stat-label">Available Plugins</div>
<div id="pluginCount" class="stat-value">0</div>
</div>
</div>
</div>
</div>
<!-- Details -->
<div class="grid grid-cols-2">
<!-- Author Info -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Author</h3>
<p class="card-description">Repository maintainer information</p>
</div>
<div class="card-content">
<div class="info-grid">
<div class="sub-card">
<div class="sub-card-content">
<div class="info-item">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
<span class="info-label">Name</span>
</div>
<span id="authorName" class="info-value"></span>
<div class="grid">
<section class="card">
<h2 class="card-title">Author</h2>
<div class="card-content">
<div class="info-list">
<div class="info">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
<div class="info-content">
<div class="info-label">Name</div>
<div id="authorName" class="info-value"></div>
</div>
<div id="authorOrgContainer" class="info-item hidden">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect>
<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path>
</svg>
<span class="info-label">Organization</span>
</div>
<span id="authorOrg" class="info-value"></span>
</div>
<div id="authorOrgContainer" class="info hidden">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect>
<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path>
</svg>
<div class="info-content">
<div class="info-label">Organization</div>
<div id="authorOrg" class="info-value"></div>
</div>
<div id="authorUrlContainer" class="info-item hidden">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
<span class="info-label">Profile</span>
</div>
<a id="authorUrl" target="_blank" class="info-link">View Profile</a>
</div>
<div id="authorUrlContainer" class="info hidden">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
<div class="info-content">
<div class="info-label">Profile</div>
<a id="authorUrl" class="info-link" target="_blank">View Profile</a>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Compatibility -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Compatibility</h3>
<p class="card-description">Version requirements and support</p>
</div>
<div class="card-content">
<div class="info-grid">
<div class="sub-card">
<div class="sub-card-content">
<div class="info-section">
<div class="info-section-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
<path d="m3.3 7 8.7 5 8.7-5"></path>
</svg>
<h4 class="info-title">HRIStudio</h4>
</div>
<div class="info-item">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2v20"></path>
<path d="M2 12h20"></path>
</svg>
<span class="info-label">Min Version</span>
</div>
<section class="card">
<h2 class="card-title">Compatibility</h2>
<div class="card-content">
<div class="info-list">
<div class="info-group">
<div class="info-group-header">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<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>
<path d="m3.3 7 8.7 5 8.7-5"></path>
</svg>
<h3 class="info-group-title">HRIStudio</h3>
</div>
<div class="info">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 2v20"></path>
<path d="M2 12h20"></path>
</svg>
<div class="info-content">
<div class="info-label">Min Version</div>
<code id="hriMin" class="info-value"></code>
</div>
<div id="hriRecommendedContainer" class="info-item hidden">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"></path>
<path d="m9 12 2 2 4-4"></path>
</svg>
<span class="info-label">Recommended</span>
</div>
</div>
<div id="hriRecommendedContainer" class="info hidden">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"></path>
<path d="m9 12 2 2 4-4"></path>
</svg>
<div class="info-content">
<div class="info-label">Recommended</div>
<code id="hriRecommended" class="info-value"></code>
</div>
</div>
<div id="ros2Container" class="info-section hidden">
<div class="info-section-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.4"></path>
<path d="M7.8 7.8c-2.3 2.3-2.3 6.1 0 8.4"></path>
</svg>
<h4 class="info-title">ROS 2</h4>
</div>
<div class="info-item">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M8 2h8"></path>
<path d="M8 6h8"></path>
<path d="M8 10h8"></path>
<path d="M8 14h8"></path>
<path d="M8 18h8"></path>
<path d="M3 22h18"></path>
</svg>
<span class="info-label">Distributions</span>
</div>
</div>
<div id="ros2Container" class="info-group hidden">
<div class="info-group-header">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.4"></path>
<path d="M7.8 7.8c-2.3 2.3-2.3 6.1 0 8.4"></path>
</svg>
<h3 class="info-group-title">ROS 2</h3>
</div>
<div class="info">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M8 2h8"></path>
<path d="M8 6h8"></path>
<path d="M8 10h8"></path>
<path d="M8 14h8"></path>
<path d="M8 18h8"></path>
<path d="M3 22h18"></path>
</svg>
<div class="info-content">
<div class="info-label">Distributions</div>
<div id="ros2Distributions" class="badge-list"></div>
</div>
<div id="ros2RecommendedContainer" class="info-item hidden">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"></path>
<path d="m9 12 2 2 4-4"></path>
</svg>
<span class="info-label">Recommended</span>
</div>
</div>
<div id="ros2RecommendedContainer" class="info hidden">
<svg class="info-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"></path>
<path d="m9 12 2 2 4-4"></path>
</svg>
<div class="info-content">
<div class="info-label">Recommended</div>
<code id="ros2Recommended" class="info-value"></code>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<!-- Tags -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Tags</h3>
<p class="card-description">Repository categories and features</p>
</div>
<div class="card-content">
<div class="sub-card">
<div class="sub-card-content">
<div class="info-item">
<div class="info-header">
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path>
<line x1="7" y1="7" x2="7.01" y2="7"></line>
</svg>
<span class="info-label">Categories</span>
</div>
<div id="tags" class="badge-list"></div>
</div>
</div>
<section class="card">
<h2 class="card-title">Tags</h2>
<div class="card-content">
<div id="tags" class="tag-list"></div>
</div>
</div>
</div>
</section>
</main>
</div>
</div>
@@ -283,4 +251,7 @@
loadRepositoryData();
</script>
</body>
</html>
</script>
</body>
</html>