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

narniaHorses.js (1579B)


      1 var nm1 = ["b", "br", "h", "n", "p", "pr", "r", "w", "wh"];
      2 var nm2 = ["enny", "eehy", "eeny", "eny", "inny", "iny", "iehy", "ieny", "oohy", "oony"];
      3 var nm3 = ["a", "e", "aa", "ee", "i", "ie", "ia"];
      4 var br = "";
      5 
      6 function nameGen() {
      7     $('#placeholder').css('textTransform', 'capitalize');
      8     var element = document.createElement("div");
      9     element.setAttribute("id", "result");
     10     for (i = 0; i < 10; i++) {
     11         rnd = Math.random() * nm1.length | 0;
     12         rnd2 = Math.random() * nm2.length | 0;
     13         rnd3 = Math.random() * nm1.length | 0;
     14         rnd4 = Math.random() * nm2.length | 0;
     15         rnd5 = Math.random() * nm1.length | 0;
     16         rnd6 = Math.random() * nm2.length | 0;
     17         rnd7 = Math.random() * nm1.length | 0;
     18         rnd8 = Math.random() * nm2.length | 0;
     19         rnd9 = Math.random() * nm3.length | 0;
     20         while (nm1[rnd3] === nm1[rnd5] || nm1[rnd3] === nm1[rnd]) {
     21             rnd3 = Math.random() * nm1.length | 0;
     22         }
     23         while (nm1[rnd7] === nm1[rnd5]) {
     24             rnd7 = Math.random() * nm1.length | 0;
     25         }
     26         names = nm1[rnd] + nm2[rnd2] + "-" + nm1[rnd3] + nm2[rnd4] + "-" + nm1[rnd5] + nm2[rnd6] + "-" + nm1[rnd7] + nm2[rnd8] + "-h" + nm3[rnd9] + "h";
     27         br = document.createElement('br');
     28         element.appendChild(document.createTextNode(names));
     29         element.appendChild(br);
     30     }
     31     if (document.getElementById("result")) {
     32         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     33     }
     34     document.getElementById("placeholder").appendChild(element);
     35 }