Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #390 from FearlessTobi/android-downloads
Browse files Browse the repository at this point in the history
site: Move download button to the page center, add Android builds
  • Loading branch information
liushuyu authored Feb 12, 2024
2 parents 6579d3e + 92b88c2 commit 2d99b77
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 24 deletions.
11 changes: 10 additions & 1 deletion site/assets/js/downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ function releaseCallback(v, count, e) {
var release = releases[i];

var windowsFound = false;
var androidFound = false;
release.assets.forEach(function (asset) {
/* We only want to provide the msvc builds on the downloads page for Windows. */
if (asset.name.includes('-mingw-')) return;

if (asset.name.includes('windows')) {
windowsFound = true;
}

if (asset.name.includes('.apk')) {
androidFound = true;
}
});

if (!windowsFound) {
if (!windowsFound && !androidFound) {
continue;
}

Expand All @@ -36,6 +41,8 @@ function releaseCallback(v, count, e) {
var release_title = '';
if (v == 'mainline') {
release_title = 'Mainline Build';
} else if (v == 'android') {
release_title = 'Android Build';
}

if (release_commit) {
Expand All @@ -51,6 +58,7 @@ function releaseCallback(v, count, e) {
if (asset.name.includes('.tar.xz')) return;
if (asset.name.includes('-debugsymbols.zip')) return;
if (asset.name.includes('.zsync')) return;
if (asset.name.includes('.aab')) return;

/* We only want to provide the msvc builds on the downloads page for Windows. */
if (asset.name.includes('-mingw-')) return;
Expand All @@ -63,6 +71,7 @@ function releaseCallback(v, count, e) {
else if (asset.name.includes('exe')) env_icon = 'windows';
else if (asset.name.includes('osx')) env_icon = 'apple';
else if (asset.name.includes('AppImage')) env_icon = 'linux';
else if (asset.name.includes('.apk')) env_icon = 'android';

var download_url = `https://github.com/yuzu-emu/yuzu-${v}/releases/download/${release.tag_name}/${asset.name}`;

Expand Down
13 changes: 9 additions & 4 deletions site/assets/scss/yuzu/yuzu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,14 @@ pre > code {
text-align: center;
}

#download-buttons {
display: flex;
justify-content: center;
}

#download-buttons > a {
margin-top: 0.75rem;
margin-bottom: 0.75rem;
margin-top: 2rem;
margin-bottom: 0;
}

@media screen and (min-width: 780px) {
Expand All @@ -158,8 +163,8 @@ pre > code {
}

#download-buttons > a {
margin-top: 0;
margin-bottom: 0;
padding-left: 2rem;
padding-right: 2rem;
}
}

Expand Down
86 changes: 67 additions & 19 deletions site/layouts/page/downloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@
<div class="container">
<div class="mb-3" id="download-header">
<h1 class="title is-flex-grow-1 mb-0">{{ .Title }}</h1>
<div id="download-buttons">
<a href="https://github.com/yuzu-emu/liftinstall/releases/download/1.9/yuzu_install.exe" class="button dl-button is-medium is-success" id="dl-button-windows">
<span class="icon mr-1"><i class="fab fa-windows"></i></span> Download for Windows x64
</a>
<a href="https://github.com/yuzu-emu/liftinstall/releases/download/1.9/liftinstall-31b3e7e.tar.xz" class="button dl-button is-medium is-success" id="dl-button-linux">
<span class="icon mr-1"><i class="fab fa-linux"></i></span> Download for Linux x64
</a>
<a href="https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu" class="button dl-button is-medium is-success" id="dl-button-android">
<span class="icon mr-1"><i class="fab fa-android"></i></span> Download for Android
</a>
</div>
</div>

<div id="unsupported-platform-view">
Expand Down Expand Up @@ -59,6 +48,20 @@ <h2>Instructions</h2>
<div class="content" id="platform-instructions">
{{ .Content }}
</div>

<div class="content">
<div id="download-buttons">
<a href="https://github.com/yuzu-emu/liftinstall/releases/download/1.9/yuzu_install.exe" class="button dl-button is-medium is-success" id="dl-button-windows">
<span class="icon mr-1"><i class="fab fa-windows"></i></span> Download for Windows x64
</a>
<a href="https://github.com/yuzu-emu/liftinstall/releases/download/1.9/liftinstall-31b3e7e.tar.xz" class="button dl-button is-medium is-success" id="dl-button-linux">
<span class="icon mr-1"><i class="fab fa-linux"></i></span> Download for Linux x64
</a>
<a href="https://play.google.com/store/apps/details?id=org.yuzu.yuzu_emu" class="button dl-button is-medium is-success" id="dl-button-android">
<span class="icon mr-1"><i class="fab fa-android"></i></span> Download for Android
</a>
</div>
</div>
</div>
</section>

Expand All @@ -78,7 +81,7 @@ <h2>Builds</h2>
</article>
</div>

<div class="show-with-js" id="package-view">
<div class="show-with-js" id="package-view-mainline">
<!-- Mainline -->
<div class="content">
<h2>Builds
Expand All @@ -99,6 +102,28 @@ <h2>Builds
</div>
</div>
</div>

<div class="show-with-js" id="package-view-android">
<!-- Android -->
<div class="content">
<h2>Builds
<span class="tag is-info">
Last release was &nbsp;
<span id='last-updated-android'></span>
</span>
</h2>

<div id="downloads-android">
</div>

<div id="unavailable-android" class="is-hidden">There was a problem checking GitHub. Click the link below to view them directly.</div>
<br />

<div class="has-text-centered">
<a href="https://github.com/yuzu-emu/yuzu-android/releases">Click here to view previous versions...</a>
</div>
</div>
</div>
</div>
</section>

Expand Down Expand Up @@ -139,6 +164,33 @@ <h2>Builds

const fragment = targetId.split('-')[1];
window.location.hash = `#${fragment}`;

switch (targetId) {
case "tab-windows":
document.getElementById("package-view-mainline").style.display = "block";
document.getElementById("dl-button-windows").style.display = "";
document.getElementById("package-view-android").style.display = "none";
document.getElementById("dl-button-linux").style.display = "none";
document.getElementById("dl-button-android").style.display = "none";
break;
case "tab-linux":
document.getElementById("package-view-mainline").style.display = "block";
document.getElementById("dl-button-linux").style.display = "";
document.getElementById("package-view-android").style.display = "none";
document.getElementById("dl-button-windows").style.display = "none";
document.getElementById("dl-button-android").style.display = "none";
break;
case "tab-android":
document.getElementById("package-view-android").style.display = "block";
document.getElementById("dl-button-android").style.display = "";
document.getElementById("package-view-mainline").style.display = "none";
document.getElementById("dl-button-windows").style.display = "none";
document.getElementById("dl-button-linux").style.display = "none";
break;
default:
document.getElementById("unsupported-platform-view").style.display = "block";
break
}
}

const getOSGuess = () => {
Expand Down Expand Up @@ -175,6 +227,7 @@ <h2>Builds
}

getRelease('mainline');
getRelease('android');

// Show JS relevant elements
document.querySelectorAll(".hide-with-js")
Expand All @@ -189,23 +242,18 @@ <h2>Builds
// Attempt autodetection of their operating system
switch (getFragment() || getOSGuess()) {
case "Windows":
document.getElementById("dl-button-linux").style.display = "none";
document.getElementById("dl-button-android").style.display = "none";
setTabActive('tab-windows');
break;
case "Linux":
document.getElementById("dl-button-windows").style.display = "none";
document.getElementById("dl-button-android").style.display = "none";
setTabActive('tab-linux');
break;
case "Android":
document.getElementById("dl-button-windows").style.display = "none";
document.getElementById("dl-button-linux").style.display = "none";
setTabActive('tab-android');
break;
default:
document.getElementById("unsupported-platform-view").style.display = "block";
setTabActive('tab-windows');
document.getElementById("dl-button-windows").style.display = "none";
document.getElementById("unsupported-platform-view").style.display = "block";
break
}

Expand Down

0 comments on commit 2d99b77

Please sign in to comment.