From 848dc95e77d8246d03850ded7092ab1fe7258418 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Sun, 7 Dec 2025 20:27:20 +0100 Subject: [PATCH] fix: Improve match header UX and remove excessive page whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/routes/+error.svelte | 2 +- src/routes/about/+page.svelte | 2 +- src/routes/faq/+page.svelte | 2 +- src/routes/match/[id]/+layout.svelte | 39 +++++++++++++++++++--------- src/routes/matches/+page.svelte | 2 +- src/routes/players/+page.svelte | 2 +- src/routes/privacy/+page.svelte | 2 +- src/routes/terms/+page.svelte | 2 +- 8 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte index 88e4f91..7b84c2d 100644 --- a/src/routes/+error.svelte +++ b/src/routes/+error.svelte @@ -64,7 +64,7 @@ {status} - {getErrorTitle(status)} | teamflash.rip -
+
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 02c887f..088fd2e 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -6,7 +6,7 @@ About - teamflash.rip -
+
diff --git a/src/routes/faq/+page.svelte b/src/routes/faq/+page.svelte index 43702c5..d9eb8b9 100644 --- a/src/routes/faq/+page.svelte +++ b/src/routes/faq/+page.svelte @@ -108,7 +108,7 @@ /> -
+
diff --git a/src/routes/match/[id]/+layout.svelte b/src/routes/match/[id]/+layout.svelte index 1dfe61c..5382ed7 100644 --- a/src/routes/match/[id]/+layout.svelte +++ b/src/routes/match/[id]/+layout.svelte @@ -33,9 +33,13 @@ { label: 'Chat', href: `/match/${match.match_id}/chat` } ]; - const formattedDate = new Date(match.date).toLocaleString('en-US', { - dateStyle: 'medium', - timeStyle: 'short' + // Shorter date format: "Sep 5, 4:30 PM" (no year - saves space in card) + const matchDate = new Date(match.date); + const formattedDate = matchDate.toLocaleString('en-US', { + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit' }); const duration = match.duration @@ -45,6 +49,10 @@ const mapName = formatMapName(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) { const img = event.target as HTMLImageElement; img.src = '/images/map_screenshots/default.webp'; @@ -65,8 +73,9 @@ window.location.href = downloadUrl; } - // Check if demo download is available - const canDownloadDemo = match.replay_url || (match.demo_parsed && match.share_code); + // Demo download: always available if replay_url exists, otherwise only for recent matches + const canDownloadDemo = + match.replay_url || (match.demo_parsed && match.share_code && !isMatchOlderThanFourWeeks); @@ -158,12 +167,12 @@
- -
+ +
- {formattedDate} + {formattedDate}
@@ -188,13 +197,19 @@
{/if} - - {#if match.avg_rank && match.avg_rank > 0} + + {#if match.avg_rank && match.avg_rank > 1000}
- +
{/if} @@ -218,7 +233,7 @@
-
+
{@render children()}
diff --git a/src/routes/matches/+page.svelte b/src/routes/matches/+page.svelte index 8bacb1a..a6d21dc 100644 --- a/src/routes/matches/+page.svelte +++ b/src/routes/matches/+page.svelte @@ -478,7 +478,7 @@
{/if} -
+