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

lotrDruedainNames.js (1350B)


      1 var nm1 = ["bh", "dh", "gh", "kh", "qh", "rh", "th", "vh", "wh", "xh", "zh"];
      2 var nm2 = ["â", "ô", "û"];
      3 var nm3 = ["b", "d", "g", "h", "m", "n", "r", "v", "z"];
      4 var nm4 = ["a", "e", "o", "u"];
      5 var nm5 = ["d", "m", "n", "r", "v", "z"];
      6 var nm6 = ["a", "i", "o", "u"];
      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.random() * nm1.length | 0;
     15         rnd2 = Math.random() * nm2.length | 0;
     16         rnd3 = Math.random() * nm3.length | 0;
     17         rnd4 = Math.random() * nm4.length | 0;
     18         rnd5 = Math.random() * nm5.length | 0;
     19         rnd6 = Math.random() * nm6.length | 0;
     20         while (nm3[rnd3] === nm5[rnd5]) {
     21             rnd3 = Math.random() * nm3.length | 0;
     22         }
     23         nMs = nm1[rnd] + nm2[rnd2] + "n-" + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + "-" + nm1[rnd] + nm2[rnd2] + "n";
     24         br = document.createElement('br');
     25         element.appendChild(document.createTextNode(nMs));
     26         element.appendChild(br);
     27     }
     28     if (document.getElementById("result")) {
     29         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     30     }
     31     document.getElementById("placeholder").appendChild(element);
     32 }