Initial port to svelte

This commit is contained in:
OleSTEEP 2025-09-14 18:26:46 +03:00
parent 410cba70e5
commit 0dee6d64ed
21 changed files with 333 additions and 424 deletions

View file

@ -0,0 +1,37 @@
<!-- class ImgButton {
html = undefined;
id = undefined;
constructor(name, img) {
this.html = document.createElement('div');
this.html.classList.add("imgbutton");
this.id = makeid(8);
this.html.id = this.id;
let btn_img = document.createElement('img');
btn_img.src = img;
btn_img.innerHTML = name;
this.html.appendChild(btn_img);
}
addHadler(func) {
this.html.addEventListener("click", func);
return this;
}
setCssClass(name) {
this.html.classList.add(name);
}
} -->
<script>
import { makeid } from "$lib/functions.js"
let id = makeid(8);
let { style, image, name } = $props();
</script>
<div class="imgbutton {style}">
<img src={image} alt={name}>
</div>