Resolve latest Windows release dynamically
This commit is contained in:
1 parent
37dae3d103
commit
e3cda9c6a6
2 files changed
+97
-3
No files matched your search
+22
-3
@@ -195,9 +195,9 @@
|
||||
<h1>Void <span>Bastion</span></h1>
|
||||
<p class="lead">Die letzte Verteidigungslinie liegt zwischen dem Reaktor und der Leere. Baue, verbessere und halte deine Stellung gegen immer stärkere Angriffswellen.</p>
|
||||
<div class="actions">
|
||||
<a class="button" href="https://git.dominicspringer.de/Emporex/Void-Bastion-Releases/releases/download/v0.1.0-alpha.2/Void-Bastion-Setup-x64.exe">Windows Alpha herunterladen</a>
|
||||
<a class="button" id="windows-download-hero" href="https://git.dominicspringer.de/Emporex/Void-Bastion-Releases/releases/latest" rel="noopener noreferrer">Windows Alpha herunterladen</a>
|
||||
<a class="button button-secondary" href="#spiel">Spiel entdecken</a>
|
||||
<span class="status">Alpha 0.1.0 · 64 Bit</span>
|
||||
<span class="status" id="latest-version" aria-live="polite">Aktuelle Windows-Version · 64 Bit</span>
|
||||
</div>
|
||||
<div class="platforms" aria-label="Geplante Plattformen"><span>Windows</span><span>Android</span><span>iOS</span></div>
|
||||
</div>
|
||||
@@ -254,7 +254,7 @@
|
||||
<img class="dev-icon" src="assets/reactor.webp" alt="Leuchtender Reaktor von Void Bastion">
|
||||
<div><span class="badge">Aktuell in Entwicklung</span><h2>Die Bastion wächst.</h2><p>Void Bastion entsteht bei <strong>GerGames</strong>. Karten, KI-Koop, Endlosmodus, Ranglisten und die technische Grundlage für Online-Multiplayer sind bereits in Arbeit. Veröffentlichungstermine und Store-Links folgen, sobald die spielbare Version bereit ist.</p>
|
||||
<div class="store-grid" aria-label="Geplante Veröffentlichungsplattformen">
|
||||
<a class="store-badge" href="https://git.dominicspringer.de/Emporex/Void-Bastion-Releases/releases/download/v0.1.0-alpha.2/Void-Bastion-Setup-x64.exe"><span class="store-symbol">PC</span><span><b>Windows Alpha</b><small>Setup herunterladen · 111 MiB</small></span></a>
|
||||
<a class="store-badge" id="windows-download-card" href="https://git.dominicspringer.de/Emporex/Void-Bastion-Releases/releases/latest" rel="noopener noreferrer"><span class="store-symbol">PC</span><span><b>Windows Alpha</b><small id="latest-download-size">Aktuelles Setup herunterladen</small></span></a>
|
||||
<span class="store-badge"><span class="store-symbol">A</span><span><b>Android</b><small>Google Play folgt</small></span></span>
|
||||
<span class="store-badge"><span class="store-symbol">i</span><span><b>iPhone & iPad</b><small>App Store folgt</small></span></span>
|
||||
</div>
|
||||
@@ -269,6 +269,25 @@
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
fetch('latest-release.php', { headers: { Accept: 'application/json' }, cache: 'no-cache' })
|
||||
.then((response) => {
|
||||
if (!response.ok) throw new Error('Release-Information nicht verfügbar');
|
||||
return response.json();
|
||||
})
|
||||
.then((release) => {
|
||||
if (!release.version || !release.windows_url || !release.release_url) return;
|
||||
const heroLink = document.getElementById('windows-download-hero');
|
||||
const cardLink = document.getElementById('windows-download-card');
|
||||
heroLink.href = release.windows_url;
|
||||
cardLink.href = release.windows_url;
|
||||
document.getElementById('latest-version').textContent = `Alpha ${release.version} · 64 Bit`;
|
||||
document.getElementById('latest-download-size').textContent = `Setup herunterladen · ${release.windows_size_mib} MiB`;
|
||||
})
|
||||
.catch(() => {
|
||||
document.getElementById('latest-version').textContent = 'Windows-Testversionen ansehen · 64 Bit';
|
||||
document.getElementById('windows-download-hero').textContent = 'Windows Alpha herunterladen';
|
||||
});
|
||||
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => entry.isIntersecting && entry.target.classList.add('visible'));
|
||||
}, { threshold: 0.14 });
|
||||
|
||||
Reference in new issue
Block a user