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

wowNaaru.js (1775B)


      1 var nm1 = ["", "", "d", "g", "k", "l", "m", "n", "s", "t", "v", "x"];
      2 var nm2 = ["aa", "uu", "oo", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u"];
      3 var nm3 = ["d", "m", "n", "r", "v", "z"];
      4 var nm4 = ["a", "a", "e", "e", "i", "u"];
      5 var nm5 = ["", "", "", "", "", "", "h", "l", "n", "s"];
      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(names));
     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() * nm3.length | 0;
     32     rnd4 = Math.random() * nm4.length | 0;
     33     rnd5 = Math.random() * nm5.length | 0;
     34     while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm5[rnd5]) {
     35         rnd3 = Math.random() * nm3.length | 0;
     36     }
     37     if (nm1[rnd] === "" || nTp === 0) {
     38         while (rnd2 < 3) {
     39             rnd2 = Math.random() * nm2.length | 0;
     40         }
     41         names = nm1[rnd] + nm2[rnd2] + "'" + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     42     } else {
     43         names = nm1[rnd] + "'" + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     44     }
     45     nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     46     testSwear(nMs);
     47 }