From fcabd988bd9b98eb5afda600345e14a302fbd4ee Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Tue, 15 Feb 2022 03:05:09 +0000
Subject: add stuff

---
 src/lib/heads/Head2d.svelte | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 src/lib/heads/Head2d.svelte

(limited to 'src/lib/heads/Head2d.svelte')

diff --git a/src/lib/heads/Head2d.svelte b/src/lib/heads/Head2d.svelte
new file mode 100644
index 0000000..d4e9ca8
--- /dev/null
+++ b/src/lib/heads/Head2d.svelte
@@ -0,0 +1,30 @@
+<script lang="ts">
+	export let player
+	export let isPartOfUsername = false
+</script>
+
+<img
+	loading="lazy"
+	class="head head2d"
+	class:userHead={isPartOfUsername}
+	src="https://crafatar.com/avatars/{player.uuid}?size=8&overlay"
+	alt="{player.username}'s face"
+/>
+
+<style>
+	.head {
+		user-select: none;
+	}
+
+	.head2d {
+		/* pixelated rendering on 2d heads */
+		image-rendering: crisp-edges;
+		image-rendering: pixelated;
+		/* make the head centered correctly */
+		position: relative;
+		top: 0.1em;
+		/* same size as font */
+		height: 1em;
+		width: 1em;
+	}
+</style>
-- 
cgit 

