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.

49 lines
1.9 KiB
JavaScript

var nm1 = ["c", "d", "g", "h", "k", "m", "n", "r", "s", "t", "z"];
var nm2 = ["a", "o", "a", "o", "e", "u", "a", "o", "a", "o", "e", "u", "i"];
var nm3 = ["d", "g", "l", "m", "n", "s", "z", "d", "g", "l", "m", "n", "s", "z", "dn", "gn", "ll", "lm", "ln", "ld", "lt", "mn", "ml", "nd", "nl", "nm", "rl", "rd", "sn", "sg", "sd", "zd"];
var nm4 = ["a", "e", "a", "e", "a", "e", "o"];
var nm5 = ["d", "k", "l", "n", "r", "t"];
var nm6 = ["d", "l", "m", "n", "r", "t", "v", "z"];
var nm7 = ["e", "u", "e", "u", "a", "i", "o", "e", "u"];
function nameGen(type) {
$('#placeholder').css('textTransform', 'capitalize');
var tp = type;
var br = "";
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
genMas();
while (nMs === "") {
genMas();
}
rnd = Math.random() * nm6.length | 0;
rnd2 = Math.random() * nm7.length | 0;
nMs += "-" + nm6[rnd] + nm7[rnd2];
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 genMas() {
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm3.length | 0;
rnd4 = Math.random() * nm4.length | 0;
if (rnd3 < 14) {
rnd5 = Math.random() * nm5.length | 0;
while (nm1[rnd] === nm3[rnd3] || nm3[rnd3] === nm5[rnd5]) {
rnd3 = Math.random() * nm3.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
} else {
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4];
}
testSwear(nMs);
}