aboutsummaryrefslogtreecommitdiff
path: root/src/lib/minecraft/heads/Head3d.svelte
blob: 3dd32345679a7fb98fc2c1680cc9c1af0baa22b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<script lang="ts">
	export let player
	export let isPartOfUsername = false
</script>

<img
	loading="lazy"
	class="head head3d"
	class:player-head={isPartOfUsername}
	src="https://www.mc-heads.net/head/{player.uuid}/128"
	alt="{player.username}'s head"
/>

<style>
	.head {
		user-select: none;
	}

	.head3d {
		display: inline-block;
		/* make the head centered correctly */
		position: relative;
		top: 0.2em;
		/* same size as font */
		height: 1em;
		width: 1em;
	}

	.player-head {
		margin-right: 0.2em;
	}
</style>