Files
claudetools/projects/radio-show/website/src/components/home/StatsSection.astro
Mike Swanson 1b45921493 Radio show website: Full Astro build with 194 episodes imported
Complete website for The Computer Guru Show (radio.azcomputerguru.com):
- Astro 6.0.4 static site with React islands
- 194 episodes imported from gurushow.com RSS feed
- Dark/light mode HSL design system
- Persistent audio player with session persistence
- Episode archive with search and season filtering
- Home page with animated hero, stats, latest episodes
- All pages: About, Subscribe, Community, Live, Contact, Blog, 404
- Podcast RSS feed with iTunes namespace
- Session log updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 20:44:42 -07:00

130 lines
3.1 KiB
Plaintext

---
import { getCollection } from 'astro:content';
const allEpisodes = await getCollection('episodes');
const totalEpisodes = allEpisodes.length;
const seasons = new Set(allEpisodes.map((ep) => ep.data.season).filter((s) => s > 0));
const totalSeasons = seasons.size;
const stats = [
{ value: `${totalEpisodes}+`, label: 'Episodes', sublabel: 'and counting' },
{ value: String(totalSeasons), label: 'Seasons', sublabel: 'on the air' },
{ value: '2014', label: 'Since', sublabel: 'year one' },
{ value: 'Tucson', label: 'Arizona', sublabel: 'home base' },
];
---
<section class="section stats fade-in">
<div class="container">
<div class="stats-grid">
{stats.map((stat) => (
<div class="stat-card">
<span class="stat-card__value">{stat.value}</span>
<span class="stat-card__label">{stat.label}</span>
<span class="stat-card__sublabel">{stat.sublabel}</span>
</div>
))}
</div>
</div>
</section>
<style>
.stats {
position: relative;
}
.stats::before {
content: '';
position: absolute;
inset: 0;
background:
radial-gradient(ellipse at 50% 50%, hsl(200 85% 55% / 0.04), transparent 70%);
pointer-events: none;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-6);
}
.stat-card {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: var(--space-8) var(--space-6);
background: var(--color-bg-secondary);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
position: relative;
overflow: hidden;
transition:
transform var(--transition-base),
box-shadow var(--transition-base),
border-color var(--transition-base);
}
.stat-card::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 2px;
background: var(--color-accent);
transition: width var(--transition-base);
}
.stat-card:hover {
transform: translateY(-4px);
box-shadow:
var(--shadow-md),
0 0 30px hsl(200 85% 55% / 0.08);
border-color: hsl(200 85% 55% / 0.3);
}
.stat-card:hover::after {
width: 60%;
}
.stat-card__value {
font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
font-weight: 800;
line-height: 1;
background: linear-gradient(135deg, var(--color-text-primary), var(--color-accent));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.stat-card__label {
font-size: var(--text-lg);
font-weight: 600;
color: var(--color-text-primary);
margin-top: var(--space-2);
}
.stat-card__sublabel {
font-size: var(--text-xs);
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.06em;
margin-top: var(--space-1);
}
@media (max-width: 768px) {
.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 400px) {
.stats-grid {
grid-template-columns: 1fr;
}
}
</style>