Files
tolaria/download/index.html

208 lines
7.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tolaria Stable Download</title>
<script>
const DOWNLOAD_TARGETS = {"linux-x86_64":{"buttonLabel":"Download Tolaria for Linux","label":"Linux","url":"https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_amd64.AppImage"},"darwin-x86_64":{"buttonLabel":"Download Tolaria for Intel Mac","label":"macOS Intel","url":"https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_macOS_Intel.dmg"},"darwin-aarch64":{"buttonLabel":"Download Tolaria for macOS Apple Silicon","label":"macOS Apple Silicon","url":"https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_macOS_Silicon.dmg"},"windows-x86_64":{"buttonLabel":"Download Tolaria for Windows","label":"Windows","url":"https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_x64-setup.exe"}};
const PLATFORM_ORDER = ["darwin-aarch64","darwin-x86_64","windows-x86_64","linux-x86_64"];
const hasMultipleMacDownloads = Boolean(
DOWNLOAD_TARGETS['darwin-aarch64'] && DOWNLOAD_TARGETS['darwin-x86_64']
);
function detectPlatform(userAgent) {
if (/Windows/i.test(userAgent)) return 'windows-x86_64';
if (/Mac OS X|Macintosh/i.test(userAgent)) return 'darwin-aarch64';
if (/Linux/i.test(userAgent) && !/Android/i.test(userAgent)) return 'linux-x86_64';
return null;
}
function firstAvailableTarget() {
return DOWNLOAD_TARGETS[PLATFORM_ORDER.find((platform) => DOWNLOAD_TARGETS[platform])] || null;
}
function startDownload(target) {
const frame = document.querySelector('iframe[name="tolaria-download-frame"]');
if (!frame || !target) return;
frame.src = target.url;
}
function resolvedDownloadTarget() {
const detectedPlatform = detectPlatform(navigator.userAgent);
if (detectedPlatform && DOWNLOAD_TARGETS[detectedPlatform]) {
return DOWNLOAD_TARGETS[detectedPlatform];
}
return firstAvailableTarget();
}
function requiresMacDownloadChoice() {
return hasMultipleMacDownloads && /Mac OS X|Macintosh/i.test(navigator.userAgent);
}
function updatePrimaryDownloadLink(target) {
const link = document.getElementById('download-link');
if (!link) return;
link.href = target.url;
link.textContent = target.buttonLabel;
}
function downloadMessage(target, requiresMacChoice) {
if (requiresMacChoice) {
return 'Choose the Apple Silicon or Intel Mac download below.';
}
return 'Starting the latest stable Tolaria download for ' + target.label + '.';
}
function updateDownloadMessage(target, requiresMacChoice) {
const message = document.getElementById('download-message');
if (!message) return;
message.textContent = downloadMessage(target, requiresMacChoice);
}
function scheduleAutomaticDownload(target, requiresMacChoice) {
if (requiresMacChoice) return;
window.setTimeout(function () {
startDownload(target);
}, 250);
}
function setupDownloadPage() {
const target = resolvedDownloadTarget();
if (!target) return;
const requiresMacChoice = requiresMacDownloadChoice();
updatePrimaryDownloadLink(target);
updateDownloadMessage(target, requiresMacChoice);
scheduleAutomaticDownload(target, requiresMacChoice);
}
window.addEventListener('DOMContentLoaded', setupDownloadPage);
</script>
<style>
:root {
color-scheme: light dark;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--download-surface-page: #f7f6f3;
--download-surface-card: #ffffff;
--download-text-primary: #37352f;
--download-border-default: #e9e9e7;
--download-accent: #155dff;
--download-accent-hover: #1248cc;
--download-secondary-bg: #eef2ff;
--download-secondary-hover-bg: #dbe4ff;
--download-secondary-text: #1d4ed8;
--download-text-on-accent: #ffffff;
--download-shadow-card: rgba(15, 23, 42, 0.08);
}
@media (prefers-color-scheme: dark) {
:root {
--download-surface-page: #1f1e1b;
--download-surface-card: #23221f;
--download-text-primary: #e6e1d8;
--download-border-default: #34322d;
--download-accent: #78a4ff;
--download-accent-hover: #9bbeff;
--download-secondary-bg: #34322d;
--download-secondary-hover-bg: #46433b;
--download-secondary-text: #e6e1d8;
--download-text-on-accent: #151411;
--download-shadow-card: rgba(0, 0, 0, 0.35);
}
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
padding: 24px;
background: var(--download-surface-page);
color: var(--download-text-primary);
}
main {
width: min(100%, 520px);
background: var(--download-surface-card);
border: 1px solid var(--download-border-default);
border-radius: 8px;
padding: 24px;
box-shadow: 0 16px 40px var(--download-shadow-card);
}
h1 {
margin: 0 0 12px;
font-size: 1.5rem;
line-height: 1.2;
}
p {
margin: 0 0 12px;
line-height: 1.5;
}
.button-list {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 16px;
}
a {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 44px;
padding: 0 16px;
border-radius: 8px;
background: var(--download-accent);
color: var(--download-text-on-accent);
text-decoration: none;
font-weight: 600;
}
a[data-secondary="true"] {
background: var(--download-secondary-bg);
color: var(--download-secondary-text);
}
a:hover,
a:focus-visible {
background: var(--download-accent-hover);
}
a[data-secondary="true"]:hover,
a[data-secondary="true"]:focus-visible {
background: var(--download-secondary-hover-bg);
}
</style>
</head>
<body>
<main>
<h1>Tolaria Stable Download</h1>
<p id="download-message" aria-live="polite">Preparing the latest stable Tolaria download for your platform.</p>
<p>Your download should start automatically. If it does not, use one of the platform links below.</p>
<div class="button-list">
<a id="download-link" href="https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_macOS_Silicon.dmg" target="tolaria-download-frame" rel="noreferrer">Download Tolaria for macOS Apple Silicon</a>
</div>
<div class="button-list"><a href="https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_macOS_Silicon.dmg" target="tolaria-download-frame" rel="noreferrer" data-secondary="true">macOS Apple Silicon</a><a href="https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_macOS_Intel.dmg" target="tolaria-download-frame" rel="noreferrer" data-secondary="true">macOS Intel</a><a href="https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_x64-setup.exe" target="tolaria-download-frame" rel="noreferrer" data-secondary="true">Windows</a><a href="https://github.com/refactoringhq/tolaria/releases/download/v2026-05-04/Tolaria_2026.5.4_amd64.AppImage" target="tolaria-download-frame" rel="noreferrer" data-secondary="true">Linux</a></div>
<div class="button-list">
<a href="https://refactoringhq.github.io/tolaria/" data-secondary="true">View release history</a>
</div>
</main>
<iframe title="Tolaria installer download" name="tolaria-download-frame" sandbox="allow-downloads" hidden></iframe>
</body>
</html>