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.

54 lines
1.7 KiB
JavaScript

var nm1 = ["", "", "b", "d", "h", "j", "k", "m", "n", "r", "t", "x", "v", "z"];
var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "y"];
var nm3 = ["c", "d", "dd", "j", "k", "l", "ll", "n", "q", "r", "t", "tt"];
var br = "";
function nameGen() {
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
nTp = Math.random() * 6 | 0;
nameMas();
while (nMs === "") {
nameMas();
}
nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
if (i < 5) {
names = "TokHaar-" + nMs;
} else {
names = "TzHaar-" + nMs;
}
if (nTp < 3) {
nameMas();
while (nMs === "") {
nameMas();
}
nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
names = names + "-" + nMs;
}
if (nTp === 0) {
nameMas();
while (nMs === "" || rnd < 2) {
nameMas();
}
nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
names = names + nMs;
}
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;
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3];
testSwear(nMs);
}