Add desktop games, robot pet and TCG app
This commit is contained in:
1 parent
812503251b
commit
c664f573b8
55 files changed
+5090
-15
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<script lang="ts">
|
||||
import { pixelRuns } from '#lib/pet/pixelArt';
|
||||
|
||||
let { rows, pixelSize = 2 }: { rows: string[]; pixelSize?: number } = $props();
|
||||
|
||||
const width = $derived(rows[0]?.length ?? 0);
|
||||
const height = $derived(rows.length);
|
||||
const runs = $derived(pixelRuns(rows));
|
||||
</script>
|
||||
|
||||
<svg
|
||||
class="pixel-icon"
|
||||
viewBox="0 0 {width} {height}"
|
||||
width={width * pixelSize}
|
||||
height={height * pixelSize}
|
||||
shape-rendering="crispEdges"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{#each runs as run (`${run.x}-${run.y}`)}
|
||||
<rect x={run.x} y={run.y} width={run.width} height="1" />
|
||||
{/each}
|
||||
</svg>
|
||||
|
||||
<style>
|
||||
.pixel-icon {
|
||||
display: block;
|
||||
fill: currentColor;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user