diff --git a/site/layouts/page/downloads.html b/site/layouts/page/downloads.html index 4f6aa4e0..3499bb85 100644 --- a/site/layouts/page/downloads.html +++ b/site/layouts/page/downloads.html @@ -29,7 +29,46 @@
-
+
+ Hi! We see that you have JavaScript disabled. We can't show you an + updated listing of the available packages for yuzu, nor alternative + installation methods, but here are a few links to get you started:
+ Windows x64 Installer
+ Nightly releases on GitHub
+ Canary releases on GitHub +
+
+
+
+ yuzu doesn't support your platform. If you are running Windows x64, Mac x64 or Linux x64 however, + choose one of the options below. +
+
+ +
+
+ The yuzu installer automates the management of a yuzu installation, and is + recommended on supported platforms. It provides automated updating as well as shortcuts + in your start menu. +
+
+ + + + +
+

Nightly Build @@ -80,5 +119,44 @@ } fetchReleases(); + + // Attempt autodetection of their operating system + var userAgent = navigator.userAgent.toLowerCase(); + + var allPlatforms = ["windows", "mac", "linux"]; + + var os = "Other"; + if (userAgent.indexOf("windows") !== -1) { + os = "Windows"; + } else if (userAgent.indexOf("mac") !== -1 && userAgent.indexOf("mobile") === -1 && userAgent.indexOf("phone") === -1) { + os = "Mac"; + } else if (userAgent.indexOf("linux") !== -1 && userAgent.indexOf("android") === -1) { + os = "Linux"; + } + + // Configure the views for this platform + document.getElementById("no-js-view").style.display = "none"; + + var platformButton = document.getElementById("dl-button-" + os.toLowerCase()); + if (platformButton !== null) { + platformButton.style.display = "block"; + } else { + document.getElementById("platform-unsupported").style.display = "block"; + } + + // Installer is not available on all platforms + if (os === "Mac" || os === "Linux") { + document.getElementById("install-view").style.display = "none"; + document.getElementById("manual-package-view").style.display = "flex"; + } else { + document.getElementById("install-view").style.display = "block"; + document.getElementById("manual-package-view").style.display = "none"; + } + + document.getElementById("view-package-listing-button").addEventListener("click", function() { + this.style.display = "none"; + document.getElementById("manual-package-view").style.display = "flex"; + }); + {{ end }} diff --git a/src/scss/yuzu/yuzu.scss b/src/scss/yuzu/yuzu.scss index 9b9bdc25..d292941e 100644 --- a/src/scss/yuzu/yuzu.scss +++ b/src/scss/yuzu/yuzu.scss @@ -96,3 +96,12 @@ a:hover { .content :not(pre) > code { background: $dark; } + +// Workaround for browsers without JavaScript for the downloads page +#install-view, #manual-package-view { + display: none; +} + +.dl-button, #platform-unsupported { + display: none; +}