-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflash-page.js
More file actions
164 lines (136 loc) · 9.04 KB
/
Copy pathflash-page.js
File metadata and controls
164 lines (136 loc) · 9.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
const EDITIONS = [
{id:'cinnamon', label:'Cinnamon Edition', desc:'The main AcreetionOS flagship desktop. Stable and feature-rich.', official:true,
iso_url:'https://iso.acreetionos.org/acreetion/AcreetionOS-1.0-x86_64.iso',
mirrors:[{url:'https://archive.org/download/AcreetionOS-1.0-x86_64/AcreetionOS-1.0-x86_64.iso',name:'Internet Archive'},
{url:'https://sourceforge.net/projects/acreetionos-iso-image/files/AcreetionOS-1.0-x86_64.iso/download',name:'SourceForge'},
{url:'https://ftp2.osuosl.org/pub/acreetionos/AcreetionOS-1.0-x86_64.iso',name:'OSUOSL'},
{url:'https://ftp.halifax.rwth-aachen.de/acreetionos/AcreetionOS-1.0-x86_64.iso',name:'RWTH Aachen'}]},
{id:'xl', label:'XL (XLibre) Edition', desc:'Featuring the XLibre display server, the successor to Xorg.', official:true,
iso_url:'https://iso.acreetionos.org/acreetion/AcreetionOS_XL-1.0-x86_64.iso',
mirrors:[{url:'https://archive.org/download/AcreetionOS_XL-1.0-x86_64/AcreetionOS_XL-1.0-x86_64.iso',name:'Internet Archive'},
{url:'https://sourceforge.net/projects/acreetionos-iso-image/files/AcreetionOS_XL-1.0-x86_64.iso/download',name:'SourceForge'},
{url:'https://ftp2.osuosl.org/pub/acreetionos/AcreetionOS_XL-1.0-x86_64.iso',name:'OSUOSL'},
{url:'https://ftp.halifax.rwth-aachen.de/acreetionos/AcreetionOS_XL-1.0-x86_64.iso',name:'RWTH Aachen'}]},
{id:'mate', label:'Mate Edition', desc:'AcreetionOS Configured with the MATE Desktop Environment.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Mate-latest.iso'},
{id:'lxqt', label:'LXQT Edition', desc:'AcreetionOS Configured with the LXQT Desktop Environment.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-LXQT-latest.iso'},
{id:'lxde', label:'LXDE Edition', desc:'AcreetionOS Configured with the LXDE Desktop Environment.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-LXDE-latest.iso'},
{id:'budgie', label:'Budgie Edition', desc:'AcreetionOS Configured with the Budgie Desktop Environment.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Budgie-latest.iso'},
{id:'cosmic', label:'Cosmic Edition', desc:'AcreetionOS Configured with the Cosmic Desktop Environment.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Cosmic-latest.iso'},
{id:'plasma', label:'Plasma Edition', desc:'Modern, powerful KDE Plasma desktop experience.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Plasma-latest.iso'},
{id:'gnome', label:'GNOME Edition', desc:'Sleek and modern GNOME desktop environment.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-GNOME-latest.iso'},
{id:'hyprland', label:'Hyprland Edition', desc:'Wayland tiling compositor with pre-configured Jakoolit configs.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Hyprland-latest.iso'},
{id:'xfce', label:'XFCE Edition', desc:'Lightweight and lightning fast for older hardware.', official:false,
iso_url:'https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-XFCE-latest.iso'}
];
function loadEditions() {
const container = document.getElementById('editions-container');
const official = EDITIONS.filter(e => e.official);
const unofficial = EDITIONS.filter(e => !e.official);
let html = `<h3 class="section-title-official">Official Editions</h3>`;
html += `<div class="edition-grid">`;
official.forEach(e => { html += renderEditionCard(e); });
html += `</div>`;
html += `<h3 class="section-title-community">Community Editions — Preview</h3>`;
html += `<div class="info-box" style="margin-bottom:1.5rem; background:rgba(97,175,239,0.05); border-color:var(--storm-color)">`;
html += `<p style="margin:0 0 0.75rem 0"><strong><i class="bi bi-info-circle"></i> These editions are on the way.</strong> When they drop, you can flash them with the Terminal <code>dd</code> command above — just paste the ISO URL, enter your USB device, and hit <em>Generate Command</em>. Or use the <strong>Desktop App Flasher</strong> for a point-and-click experience.</p>`;
html += `<p style="margin:0; font-size:0.85rem; color:var(--acreetion-text)">New to <code>dd</code>? It’s simple: <code>sudo dd if=/path/to/iso of=/dev/sdX bs=4M status=progress && sync</code>. <strong>Double-check your device</strong> — <code>dd</code> will overwrite whatever you point it at.</p>`;
html += `</div>`;
html += `<div class="edition-grid">`;
unofficial.forEach(e => { html += renderEditionCard(e, true); });
html += `</div>`;
html += `<div style="margin-top:2rem; background: linear-gradient(135deg, rgba(88,101,242,0.1) 0%, rgba(88,101,242,0.05) 100%); border: 1px solid #5865F2; border-radius: 12px; padding: 1.5rem; text-align: center">
<i class="bi bi-discord" style="font-size:1.5rem;color:#5865F2;display:block;margin-bottom:0.5rem"></i>
<p style="margin:0 0 1rem 0;font-size:0.95rem;color:var(--acreetion-text)">Want more Window Managers, Compositors, or Desktop Environments?</p>
<a href="https://discord.acreetionos.org" class="btn btn-storm" style="background:#5865F2;color:#fff;font-size:0.9rem" target="_blank" rel="noopener"><i class="bi bi-discord"></i> Join our Discord</a>
</div>`;
container.innerHTML = html;
const ddSelect = document.getElementById('dd-edition');
if (ddSelect) {
ddSelect.innerHTML = '';
official.forEach(e => {
const opt = document.createElement('option');
opt.value = e.iso_url;
opt.textContent = e.label;
ddSelect.appendChild(opt);
});
}
}
function renderEditionCard(e, isCommunity = false) {
let mirrorHTML = '';
if (e.mirrors && e.mirrors.length > 0) {
e.mirrors.forEach(m => {
mirrorHTML += `<a href="${m.url}" class="btn btn-mirror" target="_blank" rel="noopener">${m.name}</a>`;
});
}
const maintainerBtn = isCommunity
? `<a href="https://tally.so/r/rjvgKL" class="btn btn-maintainer" target="_blank" rel="noopener"><i class="bi bi-person-plus"></i> Apply for Maintainership</a>`
: '';
return `
<div class="edition-card">
<div>
<h4 class="card-title">${e.label}</h4>
<p class="card-desc">${e.desc}</p>
</div>
<div class="card-actions">
<a href="${e.iso_url}" class="btn btn-cinnamon">${isCommunity ? 'Coming Soon' : 'Download ISO'}</a>
${maintainerBtn}
${mirrorHTML}
</div>
</div>`;
}
function generateDD() {
const url = document.getElementById('dd-edition').value;
const dev = document.getElementById('dd-device').value || '/dev/sdX';
const cmd = `# Download ISO\ncurl -L -o /tmp/acreetionos.iso "${url}"\n\n# Flash to USB\nsudo dd if=/tmp/acreetionos.iso of=${dev} bs=4M status=progress && sync\necho "Done!"`;
document.getElementById('dd-code').textContent = cmd;
document.getElementById('dd-output').style.display = 'block';
}
function closeBuildModal() {
document.getElementById('build-modal').classList.remove('visible');
}
document.addEventListener('DOMContentLoaded', function() {
loadEditions();
document.getElementById('build-modal-close').addEventListener('click', closeBuildModal);
});
const FLASHER_URLS = {
windows: 'https://github.com/spivanatalie64/AcreetionMediaWriter/releases/download/5.3.1/AcreetionOSMediaWriter-win64-5.3.1.exe',
macos_intel: 'https://github.com/spivanatalie64/AcreetionMediaWriter/releases/download/5.3.1/AcreetionOSMediaWriter-macos-5.3.1.dmg',
macos_arm: 'https://github.com/spivanatalie64/AcreetionMediaWriter/releases/download/5.3.1/AcreetionOSMediaWriter-macos-arm64-5.3.1.dmg',
linux: 'https://github.com/spivanatalie64/AcreetionMediaWriter/releases/download/5.3.1/AcreetionOSMediaWriter-linux-x86_64-5.3.1.AppImage',
fallback: 'https://github.com/spivanatalie64/AcreetionMediaWriter/releases'
};
function detectOS() {
const ua = navigator.userAgent;
if (ua.includes('Windows')) return 'windows';
if (ua.includes('Linux') && !ua.includes('Android')) return 'linux';
if (ua.includes('Mac')) return 'macos';
return null;
}
document.addEventListener('DOMContentLoaded', async () => {
const btn = document.getElementById('flasher-download-btn');
if (!btn) return;
const os = detectOS();
if (!os) return;
if (os === 'macos') {
let isArm = false;
try {
if (navigator.userAgentData?.getHighEntropyValues) {
const ua = await navigator.userAgentData.getHighEntropyValues(['architecture']);
isArm = ua.architecture === 'arm';
}
} catch (e) {}
btn.href = isArm ? FLASHER_URLS.macos_arm : FLASHER_URLS.macos_intel;
} else if (os === 'windows') {
btn.href = FLASHER_URLS.windows;
} else if (os === 'linux') {
btn.href = FLASHER_URLS.linux;
}
});