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

destinyCabalNames.js (1750B)


      1 var nm1 = ["d", "dh", "g", "gh", "k", "kh", "m", "n", "sh", "t", "th", "tl", "v", "z", "zh"];
      2 var nm2 = ["a'au", "au'ua", "o'ou", "u'u", "u'ua", "u'uo", "ua'au"];
      3 var nm2b = ["a", "o", "u"];
      4 var nm3 = ["d", "g", "l", "m", "n", "r", "v", "z"];
      5 var nm4 = ["c", "ch", "g", "l", "m", "n", "r", "v", "z"];
      6 var nm5 = ["c", "d", "k", "l", "lk", "ll", "m", "n", "rc", "rd", "rg", "rk", "rn"];
      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         rnd = Math.floor(Math.random() * nm1.length);
     15         if (i < 5) {
     16             rnd2 = Math.floor(Math.random() * nm2.length);
     17             rnd3 = Math.floor(Math.random() * nm5.length);
     18             names = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
     19         } else if (i < 7) {
     20             rnd2 = Math.floor(Math.random() * nm2b.length);
     21             rnd3 = Math.floor(Math.random() * nm4.length);
     22             names = nm1[rnd] + nm2b[rnd2] + nm4[rnd3];
     23         } else {
     24             rnd2 = Math.floor(Math.random() * nm2b.length);
     25             rnd3 = Math.floor(Math.random() * nm4.length);
     26             rnd4 = Math.floor(Math.random() * nm2b.length);
     27             rnd5 = Math.floor(Math.random() * nm3.length);
     28             names = nm1[rnd] + nm2b[rnd2] + nm3[rnd5] + nm2b[rnd2] + nm4[rnd3];
     29         }
     30         br = document.createElement('br');
     31         element.appendChild(document.createTextNode(names));
     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 }