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

swDugNames.js (2317B)


      1 var nm1 = ["b", "d", "g", "gr", "j", "k", "n", "p", "pr", "r", "s", "t", "tr", "v"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ei", "ou", "aa", "ai"];
      3 var nm3 = ["b", "br", "bh", "d", "dd", "dw", "g", "gn", "gr", "gw", "gg", "k", "kw", "kh", "ln", "lw", "lg", "lb", "lt", "nr", "nb", "nd", "ng", "ns", "rd", "r", "rg", "rn", "s", "sw", "ss", "w"];
      4 var nm4 = ["", "", "", "d", "hx", "n", "s", "x"];
      5 var nm5 = ["", "", "", "b", "d", "g", "gr", "j", "k", "n", "p", "pr", "r", "s", "t", "tr", "v"];
      6 var nm6 = ["", "", "a", "e", "i", "o", "u"];
      7 var nm7 = ["d", "n", "r", "s"];
      8 var br = "";
      9 
     10 function nameGen() {
     11     $('#placeholder').css('textTransform', 'capitalize');
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         rnd = Math.floor(Math.random() * nm1.length);
     16         rnd2 = Math.floor(Math.random() * nm2.length);
     17         rnd3 = Math.floor(Math.random() * nm3.length);
     18         rnd2b = Math.floor(Math.random() * nm2.length);
     19         rnd5 = Math.floor(Math.random() * nm3.length);
     20         rnd2d = Math.floor(Math.random() * nm2.length);
     21         rnd3c = Math.floor(Math.random() * nm3.length);
     22         rnd2e = Math.floor(Math.random() * nm2.length);
     23         rnd7 = Math.floor(Math.random() * nm7.length);
     24         rnd6 = Math.floor(Math.random() * nm6.length);
     25         namelast = nm3[rnd5] + nm2[rnd2d] + nm3[rnd3c] + nm2[rnd2e] + nm7[rnd7] + nm6[rnd6];
     26         if (i < 5) {
     27             rnd4 = Math.floor(Math.random() * nm4.length);
     28             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd2b] + nm4[rnd4] + " " + namelast;
     29         } else {
     30             rnd3b = Math.floor(Math.random() * nm3.length);
     31             rnd2c = Math.floor(Math.random() * nm2.length);
     32             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd2b] + nm3[rnd3b] + nm2[rnd2c] + " " + namelast;
     33         }
     34         br = document.createElement('br');
     35         element.appendChild(document.createTextNode(names));
     36         element.appendChild(br);
     37     }
     38     if (document.getElementById("result")) {
     39         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     40     }
     41     document.getElementById("placeholder").appendChild(element);
     42 }