canihazusername/website/main.ts

18 lines
541 B
TypeScript
Raw Normal View History

2020-02-05 22:48:14 +01:00
import 'bulma/css/bulma'
import { showAvailableLists, generate } from '../'
2020-02-05 21:21:51 +01:00
2020-02-05 22:48:14 +01:00
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')
const gen = () => {
output.value = generate(input.value)
}
button.addEventListener('click', gen)
button.addEventListener('touchstart', gen)
gen()
list.innerHTML = showAvailableLists().join(', ')