diff --git a/html/index.html b/html/index.html index 026a742..7bf8720 100644 --- a/html/index.html +++ b/html/index.html @@ -21,6 +21,8 @@ .btn-primary:hover { background: #1d4ed8; } .btn-secondary { background: #6b7280; color: #fff; } .btn-secondary:hover { background: #4b5563; } + .btn-danger { background: #dc2626; color: #fff; } + .btn-danger:hover { background: #b91c1c; } #output { width: 100%; height: 300px; font-family: monospace; font-size: .9rem; padding: .5rem; border: 1px solid #ccc; border-radius: 4px; resize: vertical; background: #fafafa; } .info { font-size: .8rem; color: #666; margin-top: .5rem; } @@ -37,7 +39,7 @@
Format: Ord1 + Ord2 + suffix
- + @@ -45,6 +47,7 @@ + @@ -89,7 +92,7 @@ function randomSuffix(len, charset) { function generate() { const words = document.getElementById('words').value.split('\n').map(w => w.trim()).filter(w => w); let suffixLen = parseInt(document.getElementById('suffixLen').value, 10); - if (isNaN(suffixLen) || suffixLen < 1) suffixLen = 5; + if (isNaN(suffixLen) || suffixLen < 1) suffixLen = 3; const countEl = document.getElementById('count'); let count = parseInt(countEl.value, 10); if (isNaN(count) || count < 1) count = 3; @@ -101,7 +104,6 @@ function generate() { if (!words.length) { output.value = 'Tilføj mindst ét ord i ordbogen.'; status.textContent = ''; return; } if (words.length < 2) { output.value = 'Brug mindst 2 ord i ordbogen.'; status.textContent = ''; return; } if (!charset.length) { output.value = 'Vælg mindst én suffix-type (specialtegn eller tal).'; status.textContent = ''; return; } - if (suffixLen === 1 && charset.length > 1) { output.value = 'Ved suffix længde 1 skal du vælge enten specialtegn eller tal (ikke begge).'; status.textContent = ''; return; } const codes = []; for (let i = 0; i < count; i++) { @@ -130,6 +132,17 @@ function clearOutput() { document.getElementById('output').value = ''; document.getElementById('status').textContent = ''; } + +function resetAll() { + document.getElementById('separator').value = ''; + document.getElementById('suffixLen').value = 3; + document.getElementById('useSymbols').checked = true; + document.getElementById('useDigits').checked = true; + document.getElementById('count').value = 3; + document.getElementById('output').value = ''; + document.getElementById('status').textContent = 'Nulstillet'; + loadWords(); +}