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

narniaMice.js (957B)


      1 var nm1 = ["b", "ch", "d", "h", "k", "l", "m", "n", "r", "p", "t", "s", "z"];
      2 var nm2 = ["c", "ch", "d", "j", "k", "m", "n", "t"];
      3 var nm3 = ["k", "p", "t"];
      4 var br = "";
      5 
      6 function nameGen(type) {
      7     $('#placeholder').css('textTransform', 'capitalize');
      8     var tp = type;
      9     var element = document.createElement("div");
     10     element.setAttribute("id", "result");
     11     for (i = 0; i < 10; i++) {
     12         rnd = Math.random() * nm1.length | 0;
     13         rnd2 = Math.random() * nm2.length | 0
     14         rnd3 = Math.random() * nm3.length | 0;
     15         names = nm1[rnd] + "eepi" + nm2[rnd2] + "ee" + nm3[rnd3];
     16         br = document.createElement('br');
     17         element.appendChild(document.createTextNode(names));
     18         element.appendChild(br);
     19     }
     20     if (document.getElementById("result")) {
     21         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     22     }
     23     document.getElementById("placeholder").appendChild(element);
     24 }