mirror of
https://github.com/cupcakearmy/canihazusername.git
synced 2024-11-16 18:11:39 +01:00
16 lines
513 B
TypeScript
16 lines
513 B
TypeScript
import { generate, showAvailableLists } from '../src/index'
|
|
|
|
const input = window.document.getElementById('format') as HTMLInputElement
|
|
const output = window.document.getElementById('username') as HTMLInputElement
|
|
const list = window.document.getElementById('lists')
|
|
const button = window.document.getElementById('button')
|
|
|
|
function calculate() {
|
|
output.value = generate(input.value)
|
|
}
|
|
|
|
// Init
|
|
button?.addEventListener('click', calculate)
|
|
calculate()
|
|
if (list) list.innerHTML = showAvailableLists().join(', ')
|