From b1090d2dc9e264b9f03caa111e1a8afe945be146 Mon Sep 17 00:00:00 2001 From: Holden <122419606+midozen@users.noreply.github.com> Date: Sat, 27 Jun 2026 00:38:53 -0500 Subject: [PATCH] Load download links from live API --- public/css/styles.css | 2 + src/components/DownloadButton.astro | 81 +++++++++++++++++ src/layouts/Layout.astro | 2 +- src/lib/api.ts | 76 +++++++++------- src/lib/downloads.ts | 66 ++++++++++++++ src/pages/downloads.astro | 131 ++++++++++++---------------- src/pages/index.astro | 13 +-- 7 files changed, 253 insertions(+), 118 deletions(-) create mode 100644 src/components/DownloadButton.astro create mode 100644 src/lib/downloads.ts diff --git a/public/css/styles.css b/public/css/styles.css index 0c97a3a..1cf3b12 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -159,11 +159,13 @@ only screen and (-o-min-device-pixel-ratio: 2/1) { .masthead-download .subtext span { margin-right: 4px; + color: rgba(255, 255, 255, .5); } .masthead-platforms { display: inline; + color: #fff !important; } /* Home page diff --git a/src/components/DownloadButton.astro b/src/components/DownloadButton.astro new file mode 100644 index 0000000..d30ae4b --- /dev/null +++ b/src/components/DownloadButton.astro @@ -0,0 +1,81 @@ +--- +import { getLatestDownloads } from "../lib/downloads"; + +const latestDownloads = await getLatestDownloads(); +const downloads = latestDownloads.success ? latestDownloads.data : []; + +const defaultDownload = downloads[0]; +--- + +
+ { + defaultDownload ? ( + + Download for {defaultDownload.label} + + ) : ( + + View Downloads + + ) + } +
+ or + Other Platforms +
+
+ + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 0fb2c65..1fc73bb 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -17,9 +17,9 @@ import Footer from "../components/Footer.astro"; +