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.

123 lines
4.9 KiB
JavaScript

var nm1 = ["", "", "b", "bh", "c", "ch", "d", "dh", "g", "j", "k", "l", "m", "r", "sn", "sm", "t", "v", "vh"];
var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ee", "au"];
var nm3 = ["d", "dk", "dr", "l", "ld", "lr", "ll", "md", "mr", "m", "mn", "n", "nj", "nm", "ns", "nd", "nsh", "r", "rr", "rl", "rd", "rj", "rm", "st", "sj", "sh", "t", "tj"];
var nm4 = ["a", "e", "i", "o", "a", "e", "i", "u"];
var nm5 = ["", "", "d", "g", "hr", "hn", "hl", "l", "n", "nt", "r", "t", "v"];
var nm6 = ["", "", "", "b", "br", "c", "d", "dr", "f", "h", "j", "k", "l", "m", "n", "s", "t", "th", "v"];
var nm7 = ["a", "e", "i", "o", "u", "a", "e", "i", "a", "e", "i", "y", "au", "ay", "ai", "ea", "ee"];
var nm8 = ["d", "dr", "ds", "f", "ff", "fl", "fn", "l", "ld", "lb", "ll", "lf", "ls", "n", "nh", "nf", "r", "rr", "rg", "s", "sh", "th", "thr", "vr"];
var nm9 = ["c", "d", "l", "n", "r", "v"];
var nm10 = ["a", "e", "i", "o", "a", "e", "i", "o", "ee"];
var nm11 = ["c", "d", "h", "l", "n", "m", "y"];
var nm12 = ["a", "e", "i"];
var nm13 = ["", "", "", "", "", "", "", "", "d", "l", "ll", "n", "r", "rn", "s", "sh", "t", "th"];
var nm14 = ["b", "br", "d", "dr", "g", "gr", "l", "m", "n", "r", "s", "sh", "str", "spr", "v", "vr", "z"];
var nm15 = ["a", "e", "i", "o", "a", "e", "i", "o", "u", "ou", "au", "ea", "ei"];
var nm16 = ["ch", "d", "dr", "f", "ff", "fr", "gch", "ld", "lg", "lgr", "lch", "n", "nl", "nch", "pr", "s", "t", "tt"];
var nm17 = ["a", "e", "a", "e", "i", "o"];
var nm18 = ["", "", "", "d", "h", "l", "n", "r", "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++) {
if (tp === 1) {
nameFem();
while (nMs === "") {
nameFem();
}
} else if (tp === 2) {
nameClan();
while (nMs === "") {
nameClan();
}
} 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() {
nTp = Math.random() * 2 | 0;
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm5.length | 0;
if (nTp === 0) {
while (nm5[rnd3] === "") {
rnd3 = Math.random() * nm5.length | 0;
}
while (nm1[rnd] === "" || nm5[rnd3] === nm1[rnd]) {
rnd = Math.random() * nm1.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
} else {
rnd4 = Math.random() * nm3.length | 0;
rnd5 = Math.random() * nm4.length | 0;
while (nm3[rnd4] === nm5[rnd3] || nm3[rnd4] === nm1[rnd]) {
rnd4 = Math.random() * nm3.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd3];
}
testSwear(nMs);
}
function nameFem() {
nTp = Math.random() * 4 | 0;
rnd = Math.random() * nm6.length | 0;
rnd2 = Math.random() * nm7.length | 0;
rnd3 = Math.random() * nm13.length | 0;
if (nTp === 0) {
while (nm13[rnd3] === "") {
rnd3 = Math.random() * nm13.length | 0;
}
while (nm6[rnd] === "" || nm13[rnd3] === nm6[rnd]) {
rnd = Math.random() * nm6.length | 0;
}
nMs = nm6[rnd] + nm7[rnd2] + nm13[rnd3];
} else {
rnd4 = Math.random() * nm10.length | 0;
if (nTp < 2) {
rnd5 = Math.random() * nm9.length | 0;
rnd6 = Math.random() * nm11.length | 0;
rnd7 = Math.random() * nm12.length | 0;
while (nm9[rnd5] === nm11[rnd6] || nm9[rnd5] === nm6[rnd]) {
rnd5 = Math.random() * nm9.length | 0;
}
nMs = nm6[rnd] + nm7[rnd2] + nm9[rnd5] + nm10[rnd4] + nm11[rnd6] + nm12[rnd7];
} else {
rnd5 = Math.random() * nm8.length | 0;
while (nm8[rnd5] === nm6[rnd] || nm8[rnd5] === nm13[rnd3]) {
rnd5 = Math.random() * nm8.length | 0;
}
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd5] + nm10[rnd4] + nm13[rnd3];
}
}
testSwear(nMs);
}
function nameClan() {
rnd = Math.random() * nm14.length | 0;
rnd2 = Math.random() * nm15.length | 0;
rnd3 = Math.random() * nm16.length | 0;
rnd4 = Math.random() * nm17.length | 0;
rnd5 = Math.random() * nm18.length | 0;
while (nm16[rnd3] === nm14[rnd] || nm16[rnd3] === nm18[rnd5]) {
rnd3 = Math.random() * nm16.length | 0;
}
nMs = nm14[rnd] + nm15[rnd2] + nm16[rnd3] + nm17[rnd4] + nm18[rnd5];
testSwear(nMs);
}