mirialanNames.js (3438B)
1 var nm1 = ["i", "a", "o", "e", "u", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 2 var nm2 = ["b", "c", "ch", "d", "f", "fl", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "sh", "t", "v", "v", "w", "y", "z", "z"]; 3 var nm3 = ["i", "a", "o", "e", "u"]; 4 var nm4 = ["b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "v", "w", "y", "z", "z"]; 5 var nm5 = ["b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "v", "w", "y", "z", "z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 6 var nm6 = ["i", "a", "o", "e", "u", "", "", "", "", "", "", "", "", "", ""]; 7 var nm7 = ["b", "c", "ch", "d", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "s", "sh", "t", "v", "v", "w", "y", "z", "z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 8 var nm8 = ["b", "c", "ch", "d", "f", "fl", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "sh", "t", "v", "w", "y", "z"]; 9 var nm9 = ["b", "c", "ch", "d", "f", "g", "h", "i", "k", "l", "m", "n", "p", "q", "r", "s", "sh", "t", "v", "v", "w", "y", "z", "z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 10 var nm10 = ["i", "a", "o", "e", "u", "", ""]; 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 if (tp === 1) { 20 nameFem(); 21 while (nMs === "") { 22 nameFem(); 23 } 24 } else { 25 nameMas(); 26 while (nMs === "") { 27 nameMas(); 28 } 29 } 30 br = document.createElement('br'); 31 element.appendChild(document.createTextNode(nMs)); 32 element.appendChild(br); 33 } 34 if (document.getElementById("result")) { 35 document.getElementById("placeholder").removeChild(document.getElementById("result")); 36 } 37 document.getElementById("placeholder").appendChild(element); 38 } 39 40 function nameMas() { 41 rnd = Math.floor(Math.random() * nm1.length); 42 rnd3 = Math.floor(Math.random() * nm3.length); 43 rnd4 = Math.floor(Math.random() * nm4.length); 44 rnd5 = Math.floor(Math.random() * nm5.length); 45 rnd6 = Math.floor(Math.random() * nm6.length); 46 rnd2 = Math.floor(Math.random() * nm2.length); 47 rnd9 = Math.floor(Math.random() * nm6.length); 48 rnd7 = Math.floor(Math.random() * nm7.length); 49 nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + nm7[rnd7] + nm6[rnd9]; 50 } 51 52 function nameFem() { 53 rnd = Math.floor(Math.random() * nm1.length); 54 rnd3 = Math.floor(Math.random() * nm3.length); 55 rnd4 = Math.floor(Math.random() * nm4.length); 56 rnd5 = Math.floor(Math.random() * nm5.length); 57 rnd6 = Math.floor(Math.random() * nm6.length); 58 rnd2 = Math.floor(Math.random() * nm8.length); 59 rnd9 = Math.floor(Math.random() * nm10.length); 60 rnd7 = Math.floor(Math.random() * nm9.length); 61 nMs = nm1[rnd] + nm8[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + nm9[rnd7] + nm10[rnd9]; 62 }