From 060e8154cf529f724e1337b5ab79388375b8b448 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Thu, 8 Feb 2024 23:26:50 +0600 Subject: [PATCH] feat: initial download page --- website/src/app.html | 2 +- website/src/lib/index.ts | 39 ++++++++++++++++++++++- website/src/routes/+page.svelte | 23 ++----------- website/src/routes/downloads/+page.svelte | 31 ++++++++++++++++++ website/tailwind.config.ts | 2 +- 5 files changed, 73 insertions(+), 24 deletions(-) diff --git a/website/src/app.html b/website/src/app.html index 21d96798..772aa3ca 100644 --- a/website/src/app.html +++ b/website/src/app.html @@ -1,5 +1,5 @@ - + diff --git a/website/src/lib/index.ts b/website/src/lib/index.ts index 856f2b6c..5f55577d 100644 --- a/website/src/lib/index.ts +++ b/website/src/lib/index.ts @@ -1 +1,38 @@ -// place files you want to import through the `$lib` alias in this folder. +import { + faAndroid, + faApple, + faDebian, + faFedora, + faOpensuse, + faUbuntu, + faWindows, + faRedhat +} from '@fortawesome/free-brands-svg-icons'; +import { type IconDefinition } from '@fortawesome/free-brands-svg-icons/index'; + +const releasesUrl = 'https://github.com/KRTirtho/Spotube/releases/latest/download'; + +export const downloadLinks: Record = { + 'Android Apk': [`${releasesUrl}/Spotube-android-all-arch.apk`, [faAndroid]], + 'Windows Executable': [`${releasesUrl}/Spotube-windows-x86_64-setup.exe`, [faWindows]], + 'macOS Dmg': [`${releasesUrl}/Spotube-macos-universal.dmg`, [faApple]], + 'Ubuntu, Debian': [`${releasesUrl}/Spotube-linux-x86_64.deb`, [faUbuntu, faDebian]], + 'Fedora, Redhat, Opensuse': [ + `${releasesUrl}/Spotube-linux-x86_64.rpm`, + [faFedora, faRedhat, faOpensuse] + ], + 'iPhone Ipa': [`${releasesUrl}/Spotube-iOS.ipa`, [faApple]] +}; + +export const extendedDownloadLinks: Record = { + Android: [`${releasesUrl}/Spotube-android-all-arch.apk`, [faAndroid], 'apk'], + Windows: [`${releasesUrl}/Spotube-windows-x86_64-setup.exe`, [faWindows], 'exe'], + macOS: [`${releasesUrl}/Spotube-macos-universal.dmg`, [faApple], 'dmg'], + 'Ubuntu, Debian': [`${releasesUrl}/Spotube-linux-x86_64.deb`, [faUbuntu, faDebian], 'deb'], + 'Fedora, Redhat, Opensuse': [ + `${releasesUrl}/Spotube-linux-x86_64.rpm`, + [faFedora, faRedhat, faOpensuse], + 'rpm' + ], + iPhone: [`${releasesUrl}/Spotube-iOS.ipa`, [faApple], 'ipa'] +}; diff --git a/website/src/routes/+page.svelte b/website/src/routes/+page.svelte index 69860da6..a3ba119c 100644 --- a/website/src/routes/+page.svelte +++ b/website/src/routes/+page.svelte @@ -4,17 +4,12 @@ faAndroid, faWindows, faApple, - faUbuntu, - faFedora, - faRedhat, - faOpensuse, - faLinux, - faDebian, - type IconDefinition + faLinux } from '@fortawesome/free-brands-svg-icons/index'; import Fa from 'svelte-fa'; import { ChevronDown } from 'lucide-svelte'; import { popup, type PopupSettings } from '@skeletonlabs/skeleton'; + import { downloadLinks } from '$lib'; const popupFeatured: PopupSettings = { // Represents the type of event that opens/closed the popup @@ -24,20 +19,6 @@ // Defines which side of your trigger the popup will appear placement: 'bottom' }; - - const releasesUrl = 'https://github.com/KRTirtho/Spotube/releases/latest/download'; - - const downloadLinks: Record = { - 'Android Apk': [`${releasesUrl}/Spotube-android-all-arch.apk`, [faAndroid]], - 'Windows Executable': [`${releasesUrl}/Spotube-windows-x86_64-setup.exe`, [faWindows]], - 'Apple Dmg': [`${releasesUrl}/Spotube-macos-universal.dmg`, [faApple]], - 'Linux Ubuntu/Debian': [`${releasesUrl}/Spotube-linux-x86_64.deb`, [faUbuntu, faDebian]], - 'Linux Fedora/Redhat/Opensuse': [ - `${releasesUrl}/Spotube-linux-x86_64.rpm`, - [faFedora, faRedhat, faOpensuse] - ], - 'iPhone Ipa': [`${releasesUrl}/Spotube-iOS.ipa`, [faApple]] - };
diff --git a/website/src/routes/downloads/+page.svelte b/website/src/routes/downloads/+page.svelte index e69de29b..5eb0c3fb 100644 --- a/website/src/routes/downloads/+page.svelte +++ b/website/src/routes/downloads/+page.svelte @@ -0,0 +1,31 @@ + + +
+

+ Download + +

+

+
Spotube is available for every platform
+
+ +
+ {#each Object.entries(extendedDownloadLinks) as links} + +
+ {#each links[1][1] as icon} + + {/each} +

+ {links[1][2]} +

+
+

{links[0]}

+
+ {/each} +
+
diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts index 77611a2e..f2508a54 100644 --- a/website/tailwind.config.ts +++ b/website/tailwind.config.ts @@ -4,7 +4,7 @@ import typography from '@tailwindcss/typography'; import { skeleton } from '@skeletonlabs/tw-plugin'; export default { - darkMode: 'class', + darkMode: 'media', content: [ './src/**/*.{html,js,svelte,ts}', join(require.resolve('@skeletonlabs/skeleton'), '../**/*.{html,js,svelte,ts}')