mirror of
https://github.com/cupcakearmy/canihazusername.git
synced 2025-09-05 14:50:41 +00:00
cleanup & updates
This commit is contained in:
39
demo/index.html
Normal file
39
demo/index.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>canihazusername</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="./main.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main class="w-100 h-100">
|
||||
<div>
|
||||
<h1 class="title is-2"><span>CAN</span>I<span>HAZ</span>USERNAME</h1>
|
||||
|
||||
<div class="content mt-6">
|
||||
<h2>Demo</h2>
|
||||
<input id="format" class="input is-rounded" type="text" placeholder="format" value="{character}_{english}" />
|
||||
<button id="button" class="button is-link is-rounded my-2">👇 Generate 👇</button>
|
||||
<input id="username" class="input is-rounded" type="text" placeholder="" readonly />
|
||||
</div>
|
||||
<div class="content mt-6">
|
||||
<h2>Quickstart</h2>
|
||||
<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>
|
||||
import { generate } from 'canihazusername'
|
||||
generate('{character}_{english}')</pre
|
||||
>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h5 class="title is-5">Available lists</h5>
|
||||
<p id="lists"></p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script src="./main.ts"></script>
|
||||
</body>
|
||||
</html>
|
25
demo/main.css
Normal file
25
demo/main.css
Normal file
@@ -0,0 +1,25 @@
|
||||
* {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
}
|
||||
|
||||
main{
|
||||
padding: 4rem 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main > div {
|
||||
width: 100%;
|
||||
max-width: 35em;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
pre {
|
||||
text-align: left;
|
||||
padding: 1em .5em;
|
||||
border-radius: 1.5em;
|
||||
}
|
||||
|
||||
h2 span{
|
||||
color: #3273dc;
|
||||
margin: 0 0.5rem;
|
||||
}
|
16
demo/main.ts
Normal file
16
demo/main.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'bulma/css/bulma'
|
||||
import { showAvailableLists, generate } from '../'
|
||||
|
||||
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 = () => {
|
||||
output.value = generate(input.value)
|
||||
}
|
||||
|
||||
// Init
|
||||
button.addEventListener('click', calculate)
|
||||
calculate()
|
||||
list.innerHTML = showAvailableLists().join(', ')
|
Reference in New Issue
Block a user