fix: Improve match header UX and remove excessive page whitespace

- Shorten date format in match header (remove year)
- Change meta cards from grid to flex for better alignment
- Disable demo download for matches older than 4 weeks (Valve retention limit)
- Fix avg_rank card to only show valid CS Ratings (>1000)
- Remove min-h-screen from 8 pages to eliminate footer gap

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-07 20:27:20 +01:00
parent 83caf1b858
commit 848dc95e77
8 changed files with 34 additions and 19 deletions

View File

@@ -64,7 +64,7 @@
<title>{status} - {getErrorTitle(status)} | teamflash.rip</title> <title>{status} - {getErrorTitle(status)} | teamflash.rip</title>
</svelte:head> </svelte:head>
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative Background --> <!-- Decorative Background -->
<div class="pointer-events-none absolute inset-0 overflow-hidden"> <div class="pointer-events-none absolute inset-0 overflow-hidden">
<!-- Blur orbs --> <!-- Blur orbs -->

View File

@@ -6,7 +6,7 @@
<title>About - teamflash.rip</title> <title>About - teamflash.rip</title>
</svelte:head> </svelte:head>
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative Background --> <!-- Decorative Background -->
<div class="pointer-events-none absolute inset-0 overflow-hidden"> <div class="pointer-events-none absolute inset-0 overflow-hidden">
<!-- Blur orbs --> <!-- Blur orbs -->

View File

@@ -108,7 +108,7 @@
/> />
</svelte:head> </svelte:head>
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative Background --> <!-- Decorative Background -->
<div class="pointer-events-none absolute inset-0 overflow-hidden"> <div class="pointer-events-none absolute inset-0 overflow-hidden">
<div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div> <div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div>

View File

@@ -33,9 +33,13 @@
{ label: 'Chat', href: `/match/${match.match_id}/chat` } { label: 'Chat', href: `/match/${match.match_id}/chat` }
]; ];
const formattedDate = new Date(match.date).toLocaleString('en-US', { // Shorter date format: "Sep 5, 4:30 PM" (no year - saves space in card)
dateStyle: 'medium', const matchDate = new Date(match.date);
timeStyle: 'short' const formattedDate = matchDate.toLocaleString('en-US', {
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit'
}); });
const duration = match.duration const duration = match.duration
@@ -45,6 +49,10 @@
const mapName = formatMapName(match.map); const mapName = formatMapName(match.map);
const mapBg = getMapBackground(match.map); const mapBg = getMapBackground(match.map);
// Check if match is older than 4 weeks (Valve deletes demos after ~4 weeks)
const fourWeeksMs = 4 * 7 * 24 * 60 * 60 * 1000;
const isMatchOlderThanFourWeeks = Date.now() - matchDate.getTime() > fourWeeksMs;
function handleImageError(event: Event) { function handleImageError(event: Event) {
const img = event.target as HTMLImageElement; const img = event.target as HTMLImageElement;
img.src = '/images/map_screenshots/default.webp'; img.src = '/images/map_screenshots/default.webp';
@@ -65,8 +73,9 @@
window.location.href = downloadUrl; window.location.href = downloadUrl;
} }
// Check if demo download is available // Demo download: always available if replay_url exists, otherwise only for recent matches
const canDownloadDemo = match.replay_url || (match.demo_parsed && match.share_code); const canDownloadDemo =
match.replay_url || (match.demo_parsed && match.share_code && !isMatchOlderThanFourWeeks);
</script> </script>
<!-- Match Header with Background --> <!-- Match Header with Background -->
@@ -158,12 +167,12 @@
</div> </div>
</div> </div>
<!-- Match Meta Grid --> <!-- Match Meta Cards - Flex layout handles varying item counts gracefully -->
<div class="mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6"> <div class="mt-4 flex flex-wrap justify-center gap-2">
<!-- Date --> <!-- Date -->
<div class="flex items-center gap-2 rounded-lg border border-white/5 bg-white/5 px-3 py-2"> <div class="flex items-center gap-2 rounded-lg border border-white/5 bg-white/5 px-3 py-2">
<Calendar class="h-4 w-4 shrink-0 text-neon-blue" /> <Calendar class="h-4 w-4 shrink-0 text-neon-blue" />
<span class="truncate text-xs text-white/70">{formattedDate}</span> <span class="text-xs text-white/70">{formattedDate}</span>
</div> </div>
<!-- Duration --> <!-- Duration -->
@@ -188,13 +197,19 @@
</div> </div>
{/if} {/if}
<!-- Avg Rating --> <!-- Avg Rating - Only show for valid CS Ratings (Premier mode, >1000) -->
{#if match.avg_rank && match.avg_rank > 0} {#if match.avg_rank && match.avg_rank > 1000}
<div <div
class="flex items-center gap-2 rounded-lg border border-white/5 bg-white/5 px-3 py-2" class="flex items-center gap-2 rounded-lg border border-white/5 bg-white/5 px-3 py-2"
> >
<Users class="h-4 w-4 shrink-0 text-neon-blue" /> <Users class="h-4 w-4 shrink-0 text-neon-blue" />
<PremierRatingBadge rating={match.avg_rank} size="sm" showTier={false} /> <PremierRatingBadge
rating={match.avg_rank}
{match}
size="sm"
showTier={false}
showIcon={false}
/>
</div> </div>
{/if} {/if}
@@ -218,7 +233,7 @@
</div> </div>
<!-- Tab Content --> <!-- Tab Content -->
<div class="min-h-screen bg-void"> <div class="bg-void">
<div class="container mx-auto px-4 py-8"> <div class="container mx-auto px-4 py-8">
{@render children()} {@render children()}
</div> </div>

View File

@@ -478,7 +478,7 @@
</div> </div>
{/if} {/if}
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative background elements --> <!-- Decorative background elements -->
<div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true"> <div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true">
<div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div> <div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div>

View File

@@ -6,7 +6,7 @@
<title>Players - teamflash.rip</title> <title>Players - teamflash.rip</title>
</svelte:head> </svelte:head>
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative Background --> <!-- Decorative Background -->
<div class="pointer-events-none absolute inset-0 overflow-hidden"> <div class="pointer-events-none absolute inset-0 overflow-hidden">
<!-- Blur orbs --> <!-- Blur orbs -->

View File

@@ -16,7 +16,7 @@
/> />
</svelte:head> </svelte:head>
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative Background --> <!-- Decorative Background -->
<div class="pointer-events-none absolute inset-0 overflow-hidden"> <div class="pointer-events-none absolute inset-0 overflow-hidden">
<div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div> <div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div>

View File

@@ -16,7 +16,7 @@
/> />
</svelte:head> </svelte:head>
<div class="relative min-h-screen bg-void"> <div class="relative bg-void">
<!-- Decorative Background --> <!-- Decorative Background -->
<div class="pointer-events-none absolute inset-0 overflow-hidden"> <div class="pointer-events-none absolute inset-0 overflow-hidden">
<div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div> <div class="absolute -left-40 top-20 h-80 w-80 rounded-full bg-neon-blue/10 blur-[100px]"></div>