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.

103 lines
3.6 KiB
JavaScript

var nm1 = ["b", "d", "j", "h", "l", "n", "t", "v", "y", "z"];
var nm2 = ["a", "o", "u", "a", "o", "u", "e"];
var nm3 = ["h", "l", "n", "r", "t", "v", "z"];
var nm4 = ["a", "e", "i"];
var nm5 = ["l", "ln", "lne", "n", "nd", "ne", "nce", "nt", "s", "sh", "she", "th", "the"];
var nm6 = ["", "", "", "h", "j", "l", "m", "n", "t", "v", "y", "z"];
var nm7 = ["a", "e", "i", "u", "u", "u"];
var nm8 = ["c", "f", "h", "l", "n", "r", "v"];
var nm9 = ["i", "i", "e"];
var nm10 = ["h", "n", "ph", "s", "sh", "t", "th"];
var nm11 = ["b", "d", "l", "n", "v", "y", "z"];
var nm12 = ["a", "a", "i", "o"];
var nm13 = ["c", "d", "g", "k", "l", "n", "t"];
var nm14 = ["a", "a", "e", "o"];
var nm15 = ["l", "n", "r", "y", "z"];
var nm16 = ["a", "a", "i"];
var nm17 = ["b", "d", "j", "h", "l", "n", "t", "v", "y", "z"];
var nm18 = ["a", "e", "i", "o", "u"];
var nm19 = ["dr", "h", "l", "lb", "ld", "lg", "n", "r", "rb", "rg", "t", "tk", "v", "z", "zl", "zr"];
var nm20 = ["e", "e", "a", "i", "o"];
var nm21 = ["k", "l", "n", "s", "t", "th"];
var br = "";
function nameGen(type) {
var tp = type;
$('#placeholder').css('textTransform', 'capitalize');
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
nameSur();
while (nMs === "") {
nameSur();
}
names = nMs;
if (tp === 1) {
nameFem();
while (nMs === "") {
nameFem();
}
} else {
nameMas();
while (nMs === "") {
nameMas();
}
}
names = nMs + " " + names;
br = document.createElement('br');
element.appendChild(document.createTextNode(names));
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;
rnd5 = Math.random() * nm5.length | 0;
while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm5[rnd5]) {
rnd3 = Math.random() * nm3.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
testSwear(nMs);
}
function nameFem() {
nTp = Math.random() * 2 | 0;
if (nTp === 0) {
rnd = Math.random() * nm6.length | 0;
rnd2 = Math.random() * nm7.length | 0;
rnd3 = Math.random() * nm8.length | 0;
rnd4 = Math.random() * nm9.length | 0;
rnd5 = Math.random() * nm10.length | 0;
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5];
} else {
rnd = Math.random() * nm11.length | 0;
rnd2 = Math.random() * nm12.length | 0;
rnd3 = Math.random() * nm13.length | 0;
rnd4 = Math.random() * nm14.length | 0;
rnd5 = Math.random() * nm15.length | 0;
rnd6 = Math.random() * nm16.length | 0;
nMs = nm11[rnd] + nm12[rnd2] + nm13[rnd3] + nm14[rnd4] + nm15[rnd5] + nm16[rnd6];
}
testSwear(nMs);
}
function nameSur() {
rnd = Math.random() * nm17.length | 0;
rnd2 = Math.random() * nm18.length | 0;
rnd3 = Math.random() * nm19.length | 0;
rnd4 = Math.random() * nm20.length | 0;
rnd5 = Math.random() * nm21.length | 0;
while (nm19[rnd3] === nm17[rnd] || nm19[rnd3] === nm21[rnd5]) {
rnd3 = Math.random() * nm19.length | 0;
}
nMs = nm17[rnd] + nm18[rnd2] + nm19[rnd3] + nm20[rnd4] + nm21[rnd5];
testSwear(nMs);
}