avatarFoggySwampTribe.js (969B)
1 var nm1 = ["ch", "d", "h", "j", "q", "r", "sh", "th", "y", "x", "z", "zh"]; 2 var nm2 = ["ae", "ei", "ee", "uu", "ue", "ai", "uo", "o", "a", "i", "o", "u"]; 3 4 function nameGen() { 5 $('#placeholder').css('textTransform', 'capitalize'); 6 var br = ""; 7 var element = document.createElement("div"); 8 element.setAttribute("id", "result"); 9 for (i = 0; i < 10; i++) { 10 nameMas() 11 while (nMs === "") { 12 nameMas(); 13 } 14 br = document.createElement('br'); 15 element.appendChild(document.createTextNode(nMs)); 16 element.appendChild(br); 17 } 18 if (document.getElementById("result")) { 19 document.getElementById("placeholder").removeChild(document.getElementById("result")); 20 } 21 document.getElementById("placeholder").appendChild(element); 22 } 23 24 function nameMas() { 25 rnd = Math.random() * nm1.length | 0; 26 rnd2 = Math.random() * nm2.length | 0; 27 nMs = nm1[rnd] + nm2[rnd2]; 28 testSwear(nMs); 29 }