From 5fd1ca6fec60eb459abb4514cf713ba984644a9f Mon Sep 17 00:00:00 2001 From: Taylan Aydinli Date: Wed, 4 Mar 2026 20:51:19 +0100 Subject: [PATCH] feat(site): redesign pack cards with three-zone layout Restructure PackCard into title bar, flexible content zone, and status bar for consistent card heights. Add iconOnly mode to AudioPlayer, dateUpdated field to pack data, and remove redundant preview link. --- site/scripts/generate-pack-data.ts | 7 +- site/src/components/ui/AudioPlayer.tsx | 19 ++++ site/src/components/ui/PackCard.tsx | 144 ++++++++++++++----------- site/src/lib/types.ts | 1 + 4 files changed, 107 insertions(+), 64 deletions(-) diff --git a/site/scripts/generate-pack-data.ts b/site/scripts/generate-pack-data.ts index 47f19ce..4152707 100644 --- a/site/scripts/generate-pack-data.ts +++ b/site/scripts/generate-pack-data.ts @@ -137,6 +137,7 @@ interface RegistryEntry { tags?: string[]; quality?: "gold" | "silver" | "flagged" | "unreviewed"; added?: string; + updated?: string; } interface PackData { @@ -159,6 +160,7 @@ interface PackData { sourceRepo?: string; sourcePath?: string; dateAdded?: string; + dateUpdated?: string; } // ── Config ────────────────────────────────────────────────────────────────── @@ -179,7 +181,7 @@ const REGISTRY_INDEX_URL = // ── Helpers ───────────────────────────────────────────────────────────────── // audioBase should be the URL of the directory containing sounds/ // e.g. "https://raw.../og-packs/v1.0.0/peon" or "https://raw.../mypack/v1.0.0" -function processManifest(manifest: Manifest, packName: string, audioBase: string, trustTier: string = "community", registryTags?: string[], sourceRepo?: string, sourcePath?: string, quality?: "gold" | "silver" | "flagged" | "unreviewed", dateAdded?: string): PackData { +function processManifest(manifest: Manifest, packName: string, audioBase: string, trustTier: string = "community", registryTags?: string[], sourceRepo?: string, sourcePath?: string, quality?: "gold" | "silver" | "flagged" | "unreviewed", dateAdded?: string, dateUpdated?: string): PackData { const categories: PackData["categories"] = []; const previewSounds: PackData["previewSounds"] = []; let soundCount = 0; @@ -224,6 +226,7 @@ function processManifest(manifest: Manifest, packName: string, audioBase: string sourceRepo, sourcePath, dateAdded, + dateUpdated, }; } @@ -305,7 +308,7 @@ async function generateFromRemote(): Promise { ? `${rawBase}/${entry.source_path}` : rawBase; - return processManifest(manifest, packName, audioBase, entry.trust_tier || "community", entry.tags, entry.source_repo, entry.source_path || undefined, entry.quality, entry.added); + return processManifest(manifest, packName, audioBase, entry.trust_tier || "community", entry.tags, entry.source_repo, entry.source_path || undefined, entry.quality, entry.added, entry.updated); }) ); diff --git a/site/src/components/ui/AudioPlayer.tsx b/site/src/components/ui/AudioPlayer.tsx index 6707403..9370405 100644 --- a/site/src/components/ui/AudioPlayer.tsx +++ b/site/src/components/ui/AudioPlayer.tsx @@ -60,11 +60,13 @@ export function AudioPlayer({ label, id, compact, + iconOnly, }: { url: string; label: string; id: string; compact?: boolean; + iconOnly?: boolean; }) { const { play, stop, currentId } = useAudio(); const isPlaying = currentId === id; @@ -79,6 +81,23 @@ export function AudioPlayer({ } }; + if (iconOnly) { + return ( + + ); + } + return ( - )} + {/* Stats */} +
+ + ♫ {pack.totalSoundCount} + + · + v{pack.version} + {(pack.dateUpdated || pack.dateAdded) && ( + <> + · + + + )} +
+ ); } diff --git a/site/src/lib/types.ts b/site/src/lib/types.ts index d9c648d..701cf8b 100644 --- a/site/src/lib/types.ts +++ b/site/src/lib/types.ts @@ -34,6 +34,7 @@ export interface PackMeta { sourceRepo?: string; sourcePath?: string; dateAdded?: string; + dateUpdated?: string; } export interface PacksData {