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.
63 lines
2.2 KiB
JavaScript
63 lines
2.2 KiB
JavaScript
var nm1 = ["", "", "", "d", "g", "h", "m", "n", "r", "v", "z"];
|
|
var nm2 = ["aa", "ai", "a", "u", "a", "u", "o", "e", "i"];
|
|
var nm3 = ["g", "j", "m", "n", "r", "rr", "t", "tt", "th", "v", "z"];
|
|
var nm4 = ["i", "i", "u", "a", "i", "i", "u", "a", "o", "e"];
|
|
var nm5 = ["d", "g", "k", "n", "t", "x"];
|
|
var nm6 = ["", "", "", "", "c", "ch", "d", "fr", "h", "k", "l", "n", "r", "rh", "sh", "th", "v", "y"];
|
|
var nm7 = ["ai", "aa", "a", "a", "a", "o", "e", "a", "a", "a", "o", "e"];
|
|
var nm8 = ["d", "g", "j", "k", "n", "r", "v", "z"];
|
|
var nm9 = ["a", "e", "i", "i", "i"];
|
|
var nm10 = ["g", "h", "l", "n", "r", "z"];
|
|
var br = "";
|
|
|
|
function nameGen(type) {
|
|
$('#placeholder').css('textTransform', 'capitalize');
|
|
var tp = type;
|
|
var element = document.createElement("div");
|
|
element.setAttribute("id", "result");
|
|
for (i = 0; i < 10; i++) {
|
|
if (tp === 1) {
|
|
nameFem();
|
|
while (nMs === "") {
|
|
nameFem();
|
|
}
|
|
} else {
|
|
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;
|
|
rnd5 = Math.random() * nm5.length | 0;
|
|
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
|
|
testSwear(nMs);
|
|
}
|
|
|
|
function nameFem() {
|
|
nTp = Math.random() * 4 | 0;
|
|
rnd = Math.random() * nm6.length | 0;
|
|
rnd2 = Math.random() * nm7.length | 0;
|
|
rnd3 = Math.random() * nm8.length | 0;
|
|
if (nTp === 0) {
|
|
rnd4 = Math.random() * nm9.length | 0;
|
|
rnd5 = Math.random() * nm10.length | 0;
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5] + "i";
|
|
} else {
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + "i";
|
|
}
|
|
}
|