offline-fantasy-name-generators

Offline version of www.fantasynamegenerators.com
git clone https://git.neptards.moe/neptards/offline-fantasy-name-generators.git
Log | Files | Refs | README

eraUrgal.js (1809B)


      1 var nm1 = ["", "", "b", "d", "g", "kh", "k", "r", "sk", "skg", "t", "y", "v", "z"];
      2 var nm2 = ["a", "e", "o", "u"];
      3 var nm3 = ["b", "br", "bv", "bgr", "bdr", "d", "dv", "dz", "dzgr", "dgr", "gr", "gn", "gz", "hgr", "hr", "lk", "lv", "r", "rg", "rd", "rb", "rv", "rtv", "rzhv", "tv", "tr", "thb", "tz", "zg", "zb", "zr", "ztr", "zhgr"];
      4 var nm4 = ["c", "g", "k", "sz", "shz", "zh", "z"];
      5 var br = "";
      6 
      7 function nameGen(type) {
      8     $('#placeholder').css('textTransform', 'capitalize');
      9     var tp = type;
     10     var element = document.createElement("div");
     11     element.setAttribute("id", "result");
     12     for (i = 0; i < 10; i++) {
     13         rnd = Math.floor(Math.random() * nm1.length);
     14         rnd2 = Math.floor(Math.random() * nm2.length);
     15         rnd4 = Math.floor(Math.random() * nm4.length);
     16         if (i < 3) {
     17             names = nm1[rnd] + nm2[rnd2] + nm4[rnd4];
     18         } else if (i < 7) {
     19             rnd3 = Math.floor(Math.random() * nm3.length);
     20             rnd5 = Math.floor(Math.random() * nm2.length);
     21             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd5] + nm4[rnd4];
     22         } else {
     23             rnd3 = Math.floor(Math.random() * nm3.length);
     24             rnd5 = Math.floor(Math.random() * nm2.length);
     25             rnd6 = Math.floor(Math.random() * nm3.length);
     26             rnd7 = Math.floor(Math.random() * nm2.length);
     27             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd5] + nm3[rnd6] + nm2[rnd7] + nm4[rnd4];
     28         }
     29         br = document.createElement('br');
     30         element.appendChild(document.createTextNode(names));
     31         element.appendChild(br);
     32     }
     33     if (document.getElementById("result")) {
     34         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     35     }
     36     document.getElementById("placeholder").appendChild(element);
     37 }