From 0d27982a1d7a52f88b64fec36d477c9b5a4025fe Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 25 Jan 2026 22:53:43 -0700 Subject: [PATCH] Improve downloads page --- src/app/account/reset-password/styles.css | 2 +- src/app/download/page.tsx | 167 ++++++++++++++-------- src/app/globals.css | 9 +- 3 files changed, 118 insertions(+), 60 deletions(-) diff --git a/src/app/account/reset-password/styles.css b/src/app/account/reset-password/styles.css index d7dbe21..381eb3f 100644 --- a/src/app/account/reset-password/styles.css +++ b/src/app/account/reset-password/styles.css @@ -1,5 +1,5 @@ @import "tailwindcss"; input { - @apply bg-[rgb(72,72,96)] focus:bg-[rgb(96,96,120)] border border-[rgb(96,96,120)] focus:border-[rgb(120,120,144)] rounded-lg px-4 py-2 inline-block transition-all duration-200 cursor-pointer focus:cursor-text outline-0; + @apply bg-[rgb(72,72,96)] focus:bg-[rgb(96,96,120)] border border-[rgb(96,96,120)] focus:border-[rgb(120,120,144)] rounded-lg px-4 py-2 inline-block transition-all duration-200 cursor-pointer focus:cursor-text; } diff --git a/src/app/download/page.tsx b/src/app/download/page.tsx index a65d03a..b211144 100644 --- a/src/app/download/page.tsx +++ b/src/app/download/page.tsx @@ -1,13 +1,27 @@ +'use client' + import Link from 'next/link' -import { Metadata } from 'next' import { HomeButton } from '../components/HomeButton' import { DiscordButton } from '../components/DiscordButton' - -export const metadata: Metadata = { - title: 'Lncvrt Games - Download' -} +import { useEffect, useState } from 'react' +import axios from 'axios' export default function DownloadPage () { + const [platform, setPlatform] = useState('') + const [version, setVersion] = useState(null) + + useEffect(() => { + document.title = 'Lncvrt Games - Download' + ;(async () => { + try { + const result = await axios.get('/api/launcher/loader/latest') + setVersion(result.data) + } catch { + setVersion(-1) + } + })() + }, []) + return (
@@ -16,60 +30,99 @@ export default function DownloadPage () {

The official downloads for Lncvrt Games Launcher

-
- +
-

- Looking for mobile downloads? Select your game{' '} - here -

+ {(platform == 'windows' || platform == 'macos' || platform == 'linux') && + (version === null || version === -1 ? ( +

+ {version === null ? 'Loading' : 'Failed to get latest version'} +

+ ) : ( +
+ {platform == 'windows' && ( + <> + + Windows 64-bit (x64) + + + Windows ARM 64-bit + + + )} + {platform == 'macos' && ( + <> + + macOS Apple Silicon (M1, M2, etc.) + + + macOS Intel (x64) + + + )} + {platform == 'linux' && ( + <> + + Linux Debian/Ubuntu (.deb) + + + Linux Fedora/REHL (.rpm) + + + Linux AppImage (Universal) + + + Arch Linux (AUR) + + + )} +
+ ))} + {!( + platform == 'windows' || + platform == 'macos' || + platform == 'linux' + ) && ( +

+ Mobile releases can be found at the bottom of a games page here{' '} + here. +

+ )}
) } diff --git a/src/app/globals.css b/src/app/globals.css index bcae68a..41eed6e 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,5 +1,9 @@ @import "tailwindcss"; +* { + @apply outline-0; +} + body { @apply bg-[rgb(24,24,48)] text-[rgb(200,200,250)] select-none flex items-center justify-center min-h-screen; } @@ -44,7 +48,8 @@ body { } .downloads a, -button { +button, +select { @apply bg-[rgb(72,72,96)] hover:bg-[rgb(96,96,120)] border border-[rgb(96,96,120)] hover:border-[rgb(120,120,144)] hover:-translate-y-0.5 rounded-lg px-4 py-2 inline-block transition-all duration-200 cursor-pointer; } @@ -57,5 +62,5 @@ button { } p a { - @apply text-cyan-300 underline; + @apply text-white underline; }