Add server/static/ui_crafting.js

This commit is contained in:
2025-11-13 15:36:00 +00:00
parent 145929ea32
commit 7a46d7bab1

View File

@@ -0,0 +1,25 @@
export function setupCrafting(root) {
root.innerHTML = `
<div class="panel hidden">
<h3>Crafting</h3>
<p style="font-size:12px;color:var(--muted);">
(Placeholder) Add recipes and crafting logic here.
</p>
<div style="margin-top:6px;text-align:right;">
<button id="craft-close">Close</button>
</div>
</div>
`;
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 };
}