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

drWhoSilurianNames.js (2086B)


      1 var nm1 = ["", "d", "h", "k", "l", "m", "r", "t"];
      2 var nm2 = ["o", "e", "a", "i"];
      3 var nm3 = ["d", "dr", "cth", "ct", "cl", "cr", "hr", "hk", "hl", "kd", "kl", "kr", "l", "lr", "ln", "n", "lm", "ml", "nl", "nr", "nl", "ld", "r", "rk", "rl"];
      4 var nm4 = ["h", "k", "l", "n", "m", "r"];
      5 var nm5 = ["e", "a", "", "", "", ""];
      6 var nm6 = ["d", "h", "k", "l", "m", "n", "r", "s", "v"];
      7 var nm7 = ["o", "e", "a"];
      8 var nm8 = ["d", "dr", "hr", "hl", "hn", "lr", "ln", "n", "lm", "ln", "ml", "mn", "l", "r", "rl", "rk", "sk", "sl", "sn", "sm", "st", "str", "y"];
      9 var nm9 = ["", "", "", "", "", "", "", "h", "c", "l", "n", "m", "s"];
     10 
     11 function nameGen(type) {
     12     $('#placeholder').css('textTransform', 'capitalize');
     13     var tp = type;
     14     var br = "";
     15     var element = document.createElement("div");
     16     element.setAttribute("id", "result");
     17     for (i = 0; i < 10; i++) {
     18         if (tp === 1) {
     19             rnd = Math.floor(Math.random() * nm6.length);
     20             rnd2 = Math.floor(Math.random() * nm7.length);
     21             rnd3 = Math.floor(Math.random() * nm8.length);
     22             rnd4 = Math.floor(Math.random() * nm7.length);
     23             rnd5 = Math.floor(Math.random() * nm9.length);
     24             names = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd4] + nm9[rnd5];
     25         } else {
     26             rnd = Math.floor(Math.random() * nm1.length);
     27             rnd2 = Math.floor(Math.random() * nm2.length);
     28             rnd3 = Math.floor(Math.random() * nm3.length);
     29             rnd4 = Math.floor(Math.random() * nm2.length);
     30             rnd5 = Math.floor(Math.random() * nm4.length);
     31             rnd6 = Math.floor(Math.random() * nm5.length);
     32             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + nm5[rnd6];
     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 }