-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflash-page.js
More file actions
21 lines (20 loc) · 8.87 KB
/
Copy pathflash-page.js
File metadata and controls
21 lines (20 loc) · 8.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const EDITIONS=[{id:"cinnamon",label:"Cinnamon Edition",desc:"The main AcreetionOS flagship desktop. Stable and feature-rich.",official:!0,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:!0,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:!1,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:!1,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:!1,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:!1,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:!1,iso_url:"https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Cosmic-latest.iso"},{id:"plasma",label:"Plasma Edition",desc:"Modern, powerful KDE Plasma desktop experience.",official:!1,iso_url:"https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-Plasma-latest.iso"},{id:"gnome",label:"GNOME Edition",desc:"Sleek and modern GNOME desktop environment.",official:!1,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:!1,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:!1,iso_url:"https://pub-173a1f638a3b4c95b5f58b09c0b968aa.r2.dev/AcreetionOS-XFCE-latest.iso"}];function loadEditions(){const i=document.getElementById("editions-container"),t=EDITIONS.filter(n=>n.official),o=EDITIONS.filter(n=>!n.official);let e='<h3 class="section-title-official">Official Editions</h3>';e+='<div class="edition-grid">',t.forEach(n=>{e+=renderEditionCard(n)}),e+="</div>",e+='<h3 class="section-title-community">Community Editions — Preview</h3>',e+='<div class="info-box" style="margin-bottom:1.5rem; background:rgba(97,175,239,0.05); border-color:var(--storm-color)">',e+='<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 \u2014 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>',e+='<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> \u2014 <code>dd</code> will overwrite whatever you point it at.</p>',e+="</div>",e+='<div class="edition-grid">',o.forEach(n=>{e+=renderEditionCard(n,!0)}),e+="</div>",e+=`<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>`,i.innerHTML=e;const r=document.getElementById("dd-edition");r&&(r.innerHTML="",t.forEach(n=>{const a=document.createElement("option");a.value=n.iso_url,a.textContent=n.label,r.appendChild(a)}))}function renderEditionCard(i,t=!1){let o="";i.mirrors&&i.mirrors.length>0&&i.mirrors.forEach(r=>{o+=`<a href="${r.url}" class="btn btn-mirror" target="_blank" rel="noopener">${r.name}</a>`});const e=t?'<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">${i.label}</h4>
<p class="card-desc">${i.desc}</p>
</div>
<div class="card-actions">
<a href="${i.iso_url}" class="btn btn-cinnamon">${t?"Coming Soon":"Download ISO"}</a>
${e}
${o}
</div>
</div>`}function generateDD(){const i=document.getElementById("dd-edition").value,t=document.getElementById("dd-device").value||"/dev/sdX",o=`# Download ISO
curl -L -o /tmp/acreetionos.iso "${i}"
# Flash to USB
sudo dd if=/tmp/acreetionos.iso of=${t} bs=4M status=progress && sync
echo "Done!"`;document.getElementById("dd-code").textContent=o,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_REPO="spivanatalie64/AcreetionMediaWriter",FLASHER_FALLBACK_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 pickFlasherUrls(i){const t={};for(const o of i.assets||[]){const e=o.name;e.endsWith(".exe")&&!t.windows?t.windows=o.browser_download_url:e.endsWith(".zip")&&!t.windows_portable?t.windows_portable=o.browser_download_url:e.endsWith(".dmg")&&e.includes("arm64")&&!t.macos_arm?t.macos_arm=o.browser_download_url:e.endsWith(".dmg")&&!t.macos_intel?t.macos_intel=o.browser_download_url:e.endsWith(".AppImage")&&!t.linux&&(t.linux=o.browser_download_url)}return t}async function fetchLatestFlasherUrls(){try{const i=await fetch(`https://api.github.com/repos/${FLASHER_REPO}/releases/latest`,{headers:{Accept:"application/vnd.github+json"}});if(!i.ok)return null;const t=await i.json(),o=pickFlasherUrls(t);return Object.keys(o).length?(o.fallback=t.html_url||FLASHER_FALLBACK_URLS.fallback,o.version=t.tag_name,o):null}catch{return null}}function detectOS(){const i=navigator.userAgent;return i.includes("Windows")?"windows":i.includes("Linux")&&!i.includes("Android")?"linux":i.includes("Mac")?"macos":null}document.addEventListener("DOMContentLoaded",async()=>{const i=document.getElementById("flasher-download-btn");if(!i)return;const t=detectOS();if(!t)return;const o=await fetchLatestFlasherUrls(),e=o||FLASHER_FALLBACK_URLS;let r=null;if(t==="macos"){let n=!1;try{navigator.userAgentData?.getHighEntropyValues&&(n=(await navigator.userAgentData.getHighEntropyValues(["architecture"])).architecture==="arm")}catch{}r=n?e.macos_arm||e.macos_intel:e.macos_intel||e.macos_arm}else t==="windows"?r=e.windows||e.windows_portable:t==="linux"&&(r=e.linux);if(r&&(i.href=r,i.classList.remove("disabled")),o&&o.version){const n=document.getElementById("flasher-version-label");n&&(n.textContent=`Latest release: ${o.version} \u2014 `)}});