This commit is contained in:
cupcakearmy 2020-02-05 22:48:14 +01:00
parent 93c3a9ad58
commit 12f7c4594f
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
4 changed files with 86 additions and 7 deletions

View File

@ -1,14 +1,13 @@
{
"name": "canihazusername",
"version": "1.0.3",
"version": "2.0.0",
"description": "username generator. typed, simple and customizable",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"generate": "git -C ./generate/wordlist pull && node ./generate/wordlist.js",
"dev": "webpack -d -w",
"build": "webpack -p",
"test": "mocha",
"docs": "rm -r ./docs && parcel build --no-source-maps -d ./docs ./website/index.html",
"build": "tsc",
"prepublishOnly": "npm run build && npm run test"
},
"repository": {
@ -27,7 +26,10 @@
"url": "https://github.com/CupCakeArmy/canihazusername/issues"
},
"homepage": "https://github.com/CupCakeArmy/canihazusername#readme",
"dependencies": {},
"dependencies": {
"bulma": "^0.8.0",
"tachyons": "^4.11.1"
},
"devDependencies": {
"parcel-bundler": "^1.12.4",
"ts-node-dev": "^1.0.0-pre.44",

View File

@ -1,7 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./main.css" />
</head>
<body>
<div id="main" class="w-100 h-100">
<div>
<h2 class="title is-2"><span>can</span>i<span>haz</span>username</h2>
<input id="format" class="input is-rounded" type="text" placeholder="format" value="{character}_{english}">
<br /><br />
<button id="button" class="button is-link is-rounded">👇 Generate 👇</button>
<br /><br />
<input id="username" class="input is-rounded" type="text" placeholder="" readonly>
<br /><br />
<div class="content">
<a target="blank" href="https://github.com/cupcakearmy/canihazusername">
<button id="button" class="button is-link is-rounded">🔗 Github & Docs 🔗</button>
</a>
<br /><br />
<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>
</div>
<script src="./main.ts"></script>
</body>

34
website/main.css Normal file
View File

@ -0,0 +1,34 @@
* {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
body {
width: 100vw;
height: 100vh;
}
#main {
text-align: center;
padding: 1em;
display: flex;
/* justify-content: center;
align-items: center; */
height: 100%;
width: 100%;
overflow: auto;
}
#main > div {
max-width: 35em;
margin: auto;
}
pre {
text-align: left;
padding: 1em .5em;
border-radius: 1.5em;
}
h2 span{
color: #3273dc
}

View File

@ -1,3 +1,17 @@
import cihu from '../'
import 'bulma/css/bulma'
import { showAvailableLists, generate } from '../'
console.log(cihu())
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(', ')