Add download

This commit is contained in:
2026-01-01 17:09:43 +01:00
parent 887e2a6d03
commit fa3c30fdac
8 changed files with 225 additions and 3 deletions

View File

@@ -385,6 +385,67 @@ body {
border-color: rgba(124, 58, 237, 0.18);
}
.download-section {
margin-top: 26px;
padding: 20px;
background: rgba(11, 18, 32, 0.92);
border-radius: 14px;
border: 1px solid #1f2937;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
display: flex;
flex-direction: column;
gap: 14px;
}
.download-header h2, .download-header h3 {
margin: 6px 0 8px;
}
.version-inline {
font-weight: 700;
color: #e2e8f0;
}
.download-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 12px;
}
.download-card {
border: 1px solid #1f2937;
border-radius: 12px;
padding: 14px;
background: rgba(15, 23, 42, 0.82);
display: flex;
flex-direction: column;
gap: 10px;
transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.download-card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.download-card--active {
border-color: rgba(124, 58, 237, 0.55);
box-shadow: 0 16px 40px rgba(124, 58, 237, 0.22);
transform: translateY(-2px);
}
.download-card .button {
margin-top: 4px;
}
.download-card-block {
display: flex;
flex-direction: column;
gap: 12px;
}
.eyebrow {
text-transform: uppercase;
letter-spacing: 1px;

View File

@@ -0,0 +1,40 @@
function detectPlatform() {
const navigatorPlatform = (navigator.userAgentData?.platform || navigator.platform || '').toLowerCase();
const userAgent = (navigator.userAgent || '').toLowerCase();
const platformString = `${navigatorPlatform} ${userAgent}`;
if (platformString.includes('mac') || platformString.includes('darwin')) {
return 'mac';
}
if (platformString.includes('win')) {
return 'windows';
}
if (platformString.includes('linux')) {
return 'linux';
}
return null;
}
function markRecommendedDownload(section) {
const cards = Array.from(section.querySelectorAll('.download-card'));
if (!cards.length) {
return;
}
const platform = detectPlatform();
const preferredCard = cards.find((card) => card.dataset.platform === platform) || cards[0];
cards.forEach((card) => {
const isPreferred = card === preferredCard;
card.classList.toggle('download-card--active', isPreferred);
const badge = card.querySelector('.recommended-badge');
if (badge) {
badge.classList.toggle('hidden', !isPreferred);
}
});
}
document.addEventListener('DOMContentLoaded', () => {
const downloadSections = document.querySelectorAll('.download-section, .download-card-block');
downloadSections.forEach(markRecommendedDownload);
});