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

dndTortle.js (1783B)


      1 var nm1 = ["", "", "", "", "b", "d", "g", "j", "k", "kr", "l", "n", "pl", "q", "s", "t", "w", "x", "y"];
      2 var nm2 = ["ue", "uo", "ua", "ia", "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"];
      3 var nm3 = ["b", "d", "k", "l", "lb", "ld", "lk", "m", "n", "nn", "nl", "nq", "nqw", "qw", "p", "pp", "r", "rdl", "rt", "rtl", "z", "zl"];
      4 var nm4 = ["y", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u"];
      5 var nm5 = ["", "", "", "", "", "c", "d", "g", "k", "l", "ll", "m", "n", "r", "t", "tt"];
      6 var br = "";
      7 
      8 function nameGen() {
      9     $('#placeholder').css('textTransform', 'capitalize');
     10     var element = document.createElement("div");
     11     element.setAttribute("id", "result");
     12     for (i = 0; i < 10; i++) {
     13         nameMas();
     14         while (nMs === "") {
     15             nameMas();
     16         }
     17         br = document.createElement('br');
     18         element.appendChild(document.createTextNode(nMs));
     19         element.appendChild(br);
     20     }
     21     if (document.getElementById("result")) {
     22         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     23     }
     24     document.getElementById("placeholder").appendChild(element);
     25 }
     26 
     27 function nameMas() {
     28     nTp = Math.random() * 3 | 0;
     29     rnd = Math.random() * nm1.length | 0;
     30     rnd2 = Math.random() * nm2.length | 0;
     31     rnd3 = Math.random() * nm5.length | 0;
     32     if (nTp === 0) {
     33         while (nm1[rnd] === "" && nm5[rnd3] === "") {
     34             rnd = Math.random() * nm1.length | 0;
     35         }
     36         nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
     37     } else {
     38         rnd4 = Math.random() * nm4.length | 0;
     39         rnd5 = Math.random() * nm3.length | 0;
     40         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd5] + nm4[rnd4] + nm5[rnd3];
     41     }
     42     testSwear(nMs);
     43 }