This commit is contained in:
million1156 2024-03-20 18:46:50 -05:00
parent b1d3f27521
commit d2c3646fd9
2 changed files with 19 additions and 27 deletions

View file

@ -22,5 +22,5 @@ async function fetchLatestReleaseTag() {
}
export const load = (async () => {
let latestReleaseTag = await fetchLatestReleaseTag();
return latestReleaseTag ? { body: latestReleaseTag } : { status: 404 };
return latestReleaseTag //? { body: latestReleaseTag } : { status: 404 };
})

View file

@ -1,27 +1,20 @@
<script>
import { load } from "../api/redirect/+server";
function downloadSuyu(ua) {
let UA = navigator.userAgent;
let latestRelease = ""
console.log(UA)
console.log(load)
import { load } from "../api/fetchtag/+server";
function downloadSuyu() {
let UA = navigator.userAgent;
let latestRelease = load();
console.log(latestRelease)
if (UA.includes("Windows")) {
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/Suyu-Windows_x64.7z`;
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/Suyu-Windows_x64.7z`;
} else if (UA.includes("Linux")) {
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/suyu-mainline--.AppImage`;
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/suyu-mainline--.AppImage`;
} else if (UA.includes("Macintosh")) {
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/suyu-macOS-arm64.dmg`;
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/suyu-macOS-arm64.dmg`;
} else {
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/`;
window.location.href = `https://gitlab.com/suyu-emu/suyu-releases/-/blob/master/${latestRelease}/`;
}
}
downloadSuyu()
downloadSuyu();
</script>
<svelte:head>
@ -51,14 +44,13 @@
</svg>
<h1 class="text-[24px] leading-[1.41] md:text-[60px] md:leading-[1.1]">Download Suyu</h1>
<p class="max-w-[36rem] text-lg leading-relaxed text-[#A6A5A7]">
Your download should start automatically. If it doesn't, click the link below.
</p>
<!-- Call downloadSuyu after 5 seconds -->
<script>
setTimeout(() => {
console.log("hi")
}, 5000);
</script>
Your download should start automatically. If it doesn't, click the link below.
</p>
<!-- Call downloadSuyu after 5 seconds -->
<script>
setTimeout(() => {
console.log("hi");
}, 5000);
</script>
</div>