mirror of
https://github.com/cupcakearmy/canihazusername.git
synced 2025-09-05 23:00:40 +00:00
move to vite
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<title>canihazusername</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="./main.css" />
|
||||
</head>
|
||||
|
||||
@@ -22,7 +23,7 @@
|
||||
<a target="blank" href="https://github.com/cupcakearmy/canihazusername">
|
||||
<button id="button" class="button is-link is-rounded is-fullwidth mb-3">🔗 Github & Docs 🔗</button>
|
||||
</a>
|
||||
<pre>yarn add canihazusername</pre>
|
||||
<pre>pnpm i canihazusername</pre>
|
||||
<pre>
|
||||
import { generate } from 'canihazusername'
|
||||
generate('{character}_{english}')</pre
|
||||
|
@@ -1,3 +1,5 @@
|
||||
@import 'bulma/css/bulma.css';
|
||||
|
||||
* {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol';
|
||||
|
@@ -1,16 +1,15 @@
|
||||
import 'bulma/css/bulma.css'
|
||||
import { generate, showAvailableLists } from '../'
|
||||
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')
|
||||
|
||||
const calculate = () => {
|
||||
function calculate() {
|
||||
output.value = generate(input.value)
|
||||
}
|
||||
|
||||
// Init
|
||||
button.addEventListener('click', calculate)
|
||||
button?.addEventListener('click', calculate)
|
||||
calculate()
|
||||
list.innerHTML = showAvailableLists().join(', ')
|
||||
if (list) list.innerHTML = showAvailableLists().join(', ')
|
||||
|
Reference in New Issue
Block a user