Rewrite website as a Hyprland desktop

This commit is contained in:
SirBlob committed 2026-10-26 14:33:05 -04:00
1 parent 7c52779cf6
commit 3065ad6092
197 files changed
+5609 -17779

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
<script lang="ts">
import { onMount } from 'svelte';
import Icon from '@iconify/svelte';
import { batteryAt, batteryIcon, type BatteryState } from '#lib/desktop/battery';
let battery = $state<BatteryState | null>(null);
const isLow = $derived(!!battery && battery.level < 20 && !battery.charging);
onMount(() => {
battery = batteryAt(new Date());
const timer = setInterval(() => (battery = batteryAt(new Date())), 10000);
return () => clearInterval(timer);
});
</script>
{#if battery}
<span
class="battery"
class:low={isLow}
class:charging={battery.charging}
title="Battery {battery.level}% {battery.charging ? '(charging)' : ''}"
>
<Icon icon={batteryIcon(battery)} width="18" />
<span class="level">{battery.level}%</span>
</span>
{/if}
<style>
.battery {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0 0.4rem;
}
.charging {
color: var(--green);
}
.low {
color: var(--red);
}
@media (max-width: 640px) {
.level {
display: none;
}
}
</style>