Table of Contents
Minecraft Skin preview
Preview a Minecraft Skin
Code
Component.svelte
<script>
import { SkinViewer } from 'skinview3d';
import { onMount } from 'svelte';
let skinContainer;
onMount(() => {
let skinViewer = new SkinViewer({
canvas: skinContainer,
width: 300,
height: 400,
skin: 'https://crafatar.com/skins/23dcc84821654815822be2d6eedfe5af'
});
});
</script>
<canvas bind:this={skinContainer}></canvas>
<style>
canvas {
border: 1px solid;
}
</style>
Related snippets
Add Darkmode to sveltekit
How to add darkmode to a sveltekit project
Get License from package.json
How to get and show the projects license from package.json
Kiwi schema
How to use Kiwi schema
QuickJS sandbox
A basic example on how to run user provided code in a sandbox in the browser with svelte