giantNames.js (1877B)
1 var nm1 = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "r", "s", "t", "v", "w", "x", "z", "a", "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "r", "s", "t", "v", "w", "x", "z", "ar", "br", "cr", "dr", "fr", "gr", "kr", "sr", "tr", "vr", "wr", "al", "bl", "cl", "dl", "fl", "gl", "kl", "sl", "vl", "zl", "", "", "", "", ""]; 2 var nm2 = ["e", "i", "u", "o", "a"]; 3 var nm3 = ["b", "c", "d", "f", "g", "k", "l", "m", "n", "r", "s", "t", "w", "x", "z", "", "", "", "", "", "", "", "", ""]; 4 var nm4 = ["ag", "am", "as", "bar", "barg", "bog", "bor", "bos", "brog", "der", "dhor", "dius", "dor", "dus", "fius", "fum", "fur", "gan", "gant", "gar", "gi", "gir", "grog", "kaos", "karos", "kos", "krus", "las", "lith", "log", "lor", "los", "malog", "mir", "mohr", "nar", "nas", "nir", "nus", "og", "om", "os", "rion", "roch", "rog", "rus", "rym", "sag", "sal", "sar", "sius", "sog", "sor", "tag", "tius", "theus", "thor", "thos", "to", "tor", "vag", "ver", "var", "vir", "vog", "war", "wor", "zar", "ziar", "zus"]; 5 6 function nameGen() { 7 $('#placeholder').css('textTransform', 'capitalize'); 8 var br = ""; 9 var element = document.createElement("div"); 10 element.setAttribute("id", "result"); 11 for (i = 0; i < 10; i++) { 12 rnd = Math.floor(Math.random() * nm1.length); 13 rnd2 = Math.floor(Math.random() * nm2.length); 14 rnd3 = Math.floor(Math.random() * nm3.length); 15 rnd4 = Math.floor(Math.random() * nm4.length); 16 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4]; 17 br = document.createElement('br'); 18 element.appendChild(document.createTextNode(names)); 19 element.appendChild(br); 20 } 21 if (document.getElementById("result")) { 22 document.getElementById("placeholder").removeChild(document.getElementById("result")); 23 } 24 document.getElementById("placeholder").appendChild(element); 25 }