move to vite

This commit is contained in:
2023-07-12 23:05:30 +02:00
parent bcfd32ea8f
commit 3a2339002d
6 changed files with 57 additions and 1751 deletions

View File

@@ -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

View File

@@ -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';

View File

@@ -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(', ')