twilekNames.js (2962B)
1 var nm1 = ["i", "a", "o", "e", "u", "y", "aa", "ai", "ao", "ae", "au", "ia", "io", "ie", "iu", "oi", "oa", "oo", "oe", "ou", "ui", "ua", "uu", "uo", "ue", "i", "a", "o", "e", "u", "i", "a", "o", "e", "u", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 2 var nm2 = ["b", "c", "cr", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "sr", "t", "v", "w", "z"]; 3 var nm3 = ["i", "a", "o", "e", "u"]; 4 var nm4 = ["b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "w", "z"]; 5 var nm5 = ["'", "", ""]; 6 var nm6 = ["b", "c", "cr", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "z"]; 7 var nm7 = ["c", "d", "f", "g", "k", "l", "m", "n", "q", "r", "s", "t", "w", "y", "z", "", "", "", "", "", "", "", "", "", "", ""]; 8 var nm8 = ["i", "a", "o", "e", "u", "aa", "ai", "ao", "ae", "au", "ia", "io", "ie", "iu", "oi", "oa", "oo", "oe", "ou", "ui", "ua", "uu", "uo", "ue", "i", "a", "o", "e", "u", "i", "a", "o", "e", "u", "", "", "", "", "", "", ""]; 9 var nm9 = ["b", "c", "ch", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "sh", "t", "v", "w", "y", "y", "y", "z"]; 10 var nm10 = ["c", "f", "g", "h", "l", "m", "n", "p", "r", "s", "t", "w", "y", "z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 11 var br = ""; 12 13 function nameGen(type) { 14 $('#placeholder').css('textTransform', 'capitalize'); 15 var tp = type; 16 var element = document.createElement("div"); 17 element.setAttribute("id", "result"); 18 for (i = 0; i < 10; i++) { 19 rnd3 = Math.floor(Math.random() * nm3.length); 20 rnd4 = Math.floor(Math.random() * nm4.length); 21 rnd5 = Math.floor(Math.random() * nm5.length); 22 rnd6 = Math.floor(Math.random() * nm6.length); 23 rnd7 = Math.floor(Math.random() * nm3.length); 24 rnd8 = Math.floor(Math.random() * nm6.length); 25 rnd9 = Math.floor(Math.random() * nm3.length); 26 if (tp === 1) { 27 rnd = Math.floor(Math.random() * nm8.length); 28 rnd2 = Math.floor(Math.random() * nm9.length); 29 rnd10 = Math.floor(Math.random() * nm10.length); 30 names = nm8[rnd] + nm9[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + nm3[rnd7] + nm6[rnd8] + nm3[rnd9] + nm10[rnd10]; 31 } else { 32 rnd = Math.floor(Math.random() * nm1.length); 33 rnd2 = Math.floor(Math.random() * nm2.length); 34 rnd10 = Math.floor(Math.random() * nm7.length); 35 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + nm3[rnd7] + nm6[rnd8] + nm3[rnd9] + nm7[rnd10]; 36 } 37 br = document.createElement('br'); 38 element.appendChild(document.createTextNode(names)); 39 element.appendChild(br); 40 } 41 if (document.getElementById("result")) { 42 document.getElementById("placeholder").removeChild(document.getElementById("result")); 43 } 44 document.getElementById("placeholder").appendChild(element); 45 }