diff --git a/src/components/generators/WheelSpinner.astro b/src/components/generators/WheelSpinner.astro index 3f1885d..736ee57 100644 --- a/src/components/generators/WheelSpinner.astro +++ b/src/components/generators/WheelSpinner.astro @@ -205,9 +205,17 @@ Frank function showError(msg: string) { errorEl.textContent = msg; errorEl.classList.remove('hidden'); } function clearError() { errorEl.textContent = ''; errorEl.classList.add('hidden'); } - updateBtn.addEventListener('click', () => { + function applyItems() { const parsed = parseItems(); if (parsed) { items = parsed; draw(currentRotation); } + } + + updateBtn.addEventListener('click', applyItems); + + let debounceTimer: ReturnType | null = null; + textarea.addEventListener('input', () => { + if (debounceTimer) clearTimeout(debounceTimer); + debounceTimer = setTimeout(applyItems, 300); }); // ── Spin ─────────────────────────────────────────────────────────