canihazusername/demo/main.ts

17 lines
525 B
TypeScript
Raw Normal View History

2021-11-02 18:02:21 +01:00
import 'bulma/css/bulma.css'
2022-05-31 15:48:14 +02:00
import { generate, showAvailableLists } 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')
2020-02-06 17:09:21 +01:00
const calculate = () => {
2021-03-15 18:14:19 +01:00
output.value = generate(input.value)
2020-02-05 22:48:14 +01:00
}
2020-02-06 17:09:21 +01:00
// Init
button.addEventListener('click', calculate)
calculate()
2020-02-05 22:48:14 +01:00
list.innerHTML = showAvailableLists().join(', ')