You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
var nm1 = ["", "b", "d", "h", "k", "l", "m", "n", "r", "s", "t", "x", "z"];
|
|
var nm2 = ["ao", "ai", "ua", "iu", "ia", "a", "a", "e", "i", "o", "o", "u", "u"];
|
|
var nm3 = ["d", "f", "g", "h", "k", "x", "y", "z"];
|
|
var nm4 = ["an", "un", "en", "in", "ing", "ong", "ui", "ua", "ai", "ei", "ao", "iu", "a", "i", "ui", "ua", "ai", "ei", "ao", "iu", "a", "i", "a", "i", "a", "i"];
|
|
|
|
function nameGen() {
|
|
$('#placeholder').css('textTransform', 'capitalize');
|
|
var br = "";
|
|
var element = document.createElement("div");
|
|
element.setAttribute("id", "result");
|
|
for (i = 0; i < 10; i++) {
|
|
nameMas();
|
|
while (nMs === "") {
|
|
nameMas();
|
|
}
|
|
br = document.createElement('br');
|
|
element.appendChild(document.createTextNode(nMs));
|
|
element.appendChild(br);
|
|
}
|
|
if (document.getElementById("result")) {
|
|
document.getElementById("placeholder").removeChild(document.getElementById("result"));
|
|
}
|
|
document.getElementById("placeholder").appendChild(element);
|
|
}
|
|
|
|
function nameMas() {
|
|
rnd = Math.random() * nm1.length | 0;
|
|
rnd2 = Math.random() * nm2.length | 0;
|
|
rnd3 = Math.random() * nm3.length | 0;
|
|
rnd4 = Math.random() * nm4.length | 0;
|
|
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4];
|
|
testSwear(nMs);
|
|
}
|