chadtmiller.com/knotless

Git hosted in your atproto account, on any stock PDS, fast enough for agents.

git clone knotless://chadtmiller.com/knotless

needs the knotless git helper. set it up

main
10 lines · 547 B Raw History
<script lang="ts">
	/** Five squares, filled in proportion to what a file gained and lost. */
	let { added, removed }: { added: number; removed: number } = $props();
	const total = $derived(added + removed);
	const share = (n: number) => (total ? Math.floor((n * 5 + Math.floor(total / 2)) / total) : 0);
	const a = $derived(share(added));
	const d = $derived(Math.min(share(removed), 5 - a));
</script>

<span class="bars" aria-hidden="true">{#each [0, 1, 2, 3, 4] as i (i)}<i class={i < a ? 'a' : i < a + d ? 'd' : undefined}></i>{/each}</span>