Skip to content

Commit

Permalink
remove install buttons until Geode works with 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Dec 20, 2023
1 parent ee27b87 commit c13d30c
Showing 1 changed file with 81 additions and 42 deletions.
123 changes: 81 additions & 42 deletions src/install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,27 @@

<main class="flex flex-col items-center sm:p-20 max-sm:p-6 pt-0 m-0">

<section class="w-full max-w-3xl flex flex-col items-center gap-4">
<div class="flex justify-center items-center gap-6">
<div class="max-md:hidden">
<img alt="The Geode logo" class="w-auto h-28" src="../geode-circle.png">
</div>
<div class="h-full flex flex-col justify-center items-start max-md:items-center">
<h1 class="text-yellow font-head text-6xl mb-3 max-md:text-center">Install Geode</h1>
<h3 class="text-green font-head text-2xl max-md:text-center" id="current-version">Latest version not found</h3>
<div class="sidey-hidey">
<div class="flex flex-col items-start">
<h1 class="text-yellow font-head text-6xl mb-3">Install Geode</h1>
<!-- <h3 class="text-green font-head text-2xl mb-8" id="current-version">Latest version not found</h3> -->
<!-- <p id="pick-platform-info">Pick the platform you want to install Geode for:</p> -->
<!-- <div -->
<!-- class="flex flex-col items-start mt-6 mb-6 gap-4" -->
<!-- id="install-options" -->
<!-- ></div> -->
<!-- <p id="unsupported-platforms"></p> -->
<div class="flex flex-col p-6 rounded-lg bg-red bg-opacity-25">
<h3 class="text-yellow font-bold font-head text-2xl mb-3">Geode is being updated</h3>
<p class="mb-2">
Due to the release of <em>Update 2.2</em>, Geode is currently unavailable
while it is being updated to work with the new version.
</p>
<p>
We're trying to get a compatible version of Geode out as soon as possible.
</p>
</div>
</div>
<div class="flex flex-col items-center">
<p id="pick-platform-info">Pick the platform you want to install Geode for:</p>
<div
class="flex flex-col items-center mt-6 mb-6 gap-4 w-full"
id="install-options"
></div>
<p id="unsupported-platforms"></p>
</div>
</section>

<div class="flex flex-col gap-4 items-center max-w-[90vw]">
Expand Down Expand Up @@ -158,30 +161,31 @@ <h1 class="font-head text-2xl self-center">Need help?</h1>
feather.replace();
hljs.highlightAll();

fetch('https://api.github.com/repos/geode-sdk/geode/releases/latest')
.then(r => r.json())
.then(json => {
document.querySelector('#current-version').innerHTML = `Latest version: <wbr><em class="tag">${
json.tag_name ?? 'Unknown'
}</em>`;
const unsupported = new Set(['Windows', 'Mac', 'iOS', 'Android']);
const opts = document.querySelector('#install-options');
opts.innerHTML = '';
for (const asset of json.assets) {
if (!asset.name.toLowerCase().includes('installer')) {
continue;
}
let platformName;
if (asset.name.toLowerCase().includes('mac')) {
platformName = 'Mac';
unsupported.delete('Mac');
}
else if (asset.name.toLowerCase().includes('win')) {
platformName = 'Windows';
unsupported.delete('Windows');
}
else continue;
// fetch('https://api.github.com/repos/geode-sdk/geode/releases/latest')
// .then(r => r.json())
// .then(json => {
// document.querySelector('#current-version').innerHTML = `Latest version: <wbr><em class="tag">${
// json.tag_name ?? 'Unknown'
// }</em>`;
// const unsupported = new Set(['Windows', 'Mac', 'iOS', 'Android']);
// const opts = document.querySelector('#install-options');
// opts.innerHTML = '';
// for (const asset of json.assets) {
// if (!asset.name.toLowerCase().includes('installer')) {
// continue;
// }
// let platformName;
// if (asset.name.toLowerCase().includes('mac')) {
// platformName = 'Mac';
// unsupported.delete('Mac');
// }
// else if (asset.name.toLowerCase().includes('win')) {
// platformName = 'Windows';
// unsupported.delete('Windows');
// }
// else continue;

<<<<<<< HEAD
let elem = document.createElement('a');
elem.classList.add(
'button', 'wide', 'border-solid',
Expand Down Expand Up @@ -215,11 +219,46 @@ <h1 class="font-head text-2xl self-center">Need help?</h1>
'<p>Unable to get installation options! The site probably hit ' +
'the Github rate limit - <em>please try again later</em>.</p>';
});
=======
// let elem = document.createElement('a');
// elem.classList.add(
// 'button', 'has-icon', 'border-solid',
// 'border-2', 'border-gray-light'
// );
// elem.style.textAlign = 'left';
// elem.href = asset.browser_download_url;
// elem.innerHTML = `${feather.icons.box.toSvg()}Download for ${platformName}`;
// opts.appendChild(elem);
// }
// if (unsupported.size === 4) {
// let elem = document.createElement('p');
// elem.innerHTML = "No platforms found";
// elem.style.fontStyle = 'italic';
// opts.appendChild(elem);
// }
// if (unsupported.size) {
// let list = Array.from(unsupported);
// const last = list.length > 1 ? ` and ${list.pop()}` : '';
// document.querySelector('#unsupported-platforms').innerHTML =
// `${list.join(', ')}${last} are not yet supported.`;
// }
// else {
// document.querySelector('#unsupported-platforms').innerHTML = '';
// }
// })
// .catch(_ => {
// document.querySelector('#current-version').remove();
// document.querySelector('#pick-platform-info').remove();
// document.querySelector('#install-options').innerHTML =
// '<p>Unable to get installation options! The site probably hit ' +
// 'the Github rate limit - <em>please try again later</em>.</p>';
// });
>>>>>>> 2d02e14 (remove install buttons until Geode works with 2.2)

// no install button on mobile because android geode doesn't exist yet
if (navigator.userAgent.match(/android|iphone|kindle|ipad/i)) {
document.getElementById('install').remove();
}
// if (navigator.userAgent.match(/android|iphone|kindle|ipad/i)) {
// document.getElementById('install').remove();
// }
</script>

</body>
Expand Down

0 comments on commit c13d30c

Please sign in to comment.