From 7a46d7bab17fff1a744a952c9524828f2b373f27 Mon Sep 17 00:00:00 2001 From: Atlaskor Date: Thu, 13 Nov 2025 15:36:00 +0000 Subject: [PATCH] Add server/static/ui_crafting.js --- server/static/ui_crafting.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 server/static/ui_crafting.js diff --git a/server/static/ui_crafting.js b/server/static/ui_crafting.js new file mode 100644 index 0000000..5e31d7c --- /dev/null +++ b/server/static/ui_crafting.js @@ -0,0 +1,25 @@ +export function setupCrafting(root) { + root.innerHTML = ` + + `; + const panel = root.firstElementChild; + panel.querySelector('#craft-close').onclick = () => toggle(false); + + function toggle(force) { + if (typeof force === 'boolean') { + panel.classList.toggle('hidden', !force); + } else { + panel.classList.toggle('hidden'); + } + } + + window.CraftingUI = { toggle }; +}