refactor: fix buttons

This commit is contained in:
taroj1205 2025-01-24 16:33:14 +13:00
parent 5125bf91f2
commit 942a73d53c
2 changed files with 222 additions and 220 deletions

View file

@ -12,11 +12,7 @@ import MoonIcon from '../icons/MoonIcon.astro'
<button
id="theme-toggle"
type="button"
class:list={[
'rounded-lg p-2.5 outline-none',
'bg-muted/50 shadow-sm',
className,
]}
class:list={['rounded-lg p-2.5 outline-none', className]}
aria-label={label}
{...rest}
>

View file

@ -261,6 +261,7 @@ const appleIcon = icon({ prefix: 'fab', iconName: 'apple' })
</main>
</Layout>
<script>
document.addEventListener('astro:page-load', () => {
const releases = {
macos: {
intel: 'zen.macos-x86_64.dmg',
@ -353,7 +354,9 @@ const appleIcon = icon({ prefix: 'fab', iconName: 'apple' })
"input[type='radio']:checked",
) as HTMLInputElement
selectedArch = selectedRadio.value
document.getElementById('linux-target-download')?.classList.add('hidden')
document
.getElementById('linux-target-download')
?.classList.add('hidden')
const linuxDownload = document.getElementById(
'form-linux-download',
@ -388,7 +391,9 @@ const appleIcon = icon({ prefix: 'fab', iconName: 'apple' })
if (selectedArch) {
// Go back to architecture selection
if (selectedOS === 'linux') {
document.getElementById('form-linux-download')?.classList.add('hidden')
document
.getElementById('form-linux-download')
?.classList.add('hidden')
document
.getElementById('linux-target-download')
?.classList.remove('hidden')
@ -404,7 +409,9 @@ const appleIcon = icon({ prefix: 'fab', iconName: 'apple' })
} else if (selectedOS) {
// Go back to OS selection
if (selectedOS === 'macos') {
document.getElementById('form-macos-download')?.classList.add('hidden')
document
.getElementById('form-macos-download')
?.classList.add('hidden')
} else if (selectedOS === 'linux') {
document
.getElementById('linux-target-download')
@ -511,7 +518,6 @@ const appleIcon = icon({ prefix: 'fab', iconName: 'apple' })
//downloadRelease("windows", selectedArch as string, "zip");
})
document.addEventListener('astro:page-load', () => {
filloutDefaultOS()
})
</script>