landNames.js (3322B)
1 var nm1 = ["b", "c", "d", "f", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z", "", "", "", "", ""]; 2 var nm2 = ["a", "e", "o", "u"]; 3 var nm3 = ["br", "cr", "dr", "fr", "gr", "pr", "str", "tr", "bl", "cl", "fl", "gl", "pl", "sh", "sc", "sk", "sm", "sn", "sp", "st", "sw", "ch", "sh", "th", "wh"]; 4 var nm4 = ["ae", "ai", "ao", "au", "a", "ay", "ea", "ei", "eo", "eu", "e", "ey", "ua", "ue", "ui", "uo", "u", "uy", "ia", "ie", "iu", "io", "iy", "oa", "oe", "ou", "oi", "o", "oy"]; 5 var nm5 = ["stan", "dor", "vania", "nia", "lor", "cor", "dal", "bar", "sal", "ra", "la", "lia", "jan", "rus", "ze", "tan", "wana", "sil", "so", "na", "le", "bia", "ca", "ji", "ce", "ton", "ssau", "sau", "sia", "ca", "ya", "ye", "yae", "tho", "stein", "ria", "nia", "burg", "nia", "gro", "que", "gua", "qua", "rhiel", "cia", "les", "dan", "nga", "land"]; 6 var nm6 = ["ia", "a", "en", "ar", "istan", "aria", "ington", "ua", "ijan", "ain", "ium", "us", "esh", "os", "ana", "il", "ad", "or", "ea", "eau", "ax", "on", "ana", "ary", "ya", "ye", "yae", "ait", "ein", "urg", "al", "ines", "ela"]; 7 var br = ""; 8 9 function nameGen() { 10 $('#placeholder').css('textTransform', 'capitalize'); 11 var element = document.createElement("div"); 12 element.setAttribute("id", "result"); 13 for (i = 0; i < 10; i++) { 14 if (i < 2) { 15 rnd = Math.floor(Math.random() * nm1.length); 16 rnd2 = Math.floor(Math.random() * nm2.length); 17 rnd3 = Math.floor(Math.random() * nm3.length); 18 rnd4 = Math.floor(Math.random() * nm4.length); 19 rnd5 = Math.floor(Math.random() * nm5.length); 20 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5]; 21 } else if (i < 4) { 22 rnd = Math.floor(Math.random() * nm1.length); 23 rnd2 = Math.floor(Math.random() * nm2.length); 24 rnd3 = Math.floor(Math.random() * nm3.length); 25 rnd4 = Math.floor(Math.random() * nm6.length); 26 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4]; 27 } else if (i < 6) { 28 rnd = Math.floor(Math.random() * nm3.length); 29 rnd2 = Math.floor(Math.random() * nm4.length); 30 rnd3 = Math.floor(Math.random() * nm5.length); 31 names = nm3[rnd] + nm4[rnd2] + nm5[rnd3]; 32 } else if (i < 8) { 33 rnd = Math.floor(Math.random() * nm2.length); 34 rnd2 = Math.floor(Math.random() * nm3.length); 35 rnd3 = Math.floor(Math.random() * nm6.length); 36 names = nm2[rnd] + nm3[rnd2] + nm6[rnd3]; 37 } else { 38 rnd = Math.floor(Math.random() * nm3.length); 39 rnd2 = Math.floor(Math.random() * nm4.length); 40 rnd3 = Math.floor(Math.random() * nm1.length); 41 rnd4 = Math.floor(Math.random() * nm3.length); 42 rnd5 = Math.floor(Math.random() * nm6.length); 43 names = nm3[rnd] + nm4[rnd2] + nm1[rnd3] + " " + nm3[rnd4] + nm6[rnd5]; 44 } 45 br = document.createElement('br'); 46 element.appendChild(document.createTextNode(names)); 47 element.appendChild(br); 48 } 49 if (document.getElementById("result")) { 50 document.getElementById("placeholder").removeChild(document.getElementById("result")); 51 } 52 document.getElementById("placeholder").appendChild(element); 53 }