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

pfNagaji.js (2103B)


      1 var nm1 = ["", "", "d", "g", "h", "k", "l", "n", "p", "r", "sh", "t", "v", "y"];
      2 var nm2 = ["a", "e", "o", "u"];
      3 var nm3 = ["d", "dh", "g", "k", "l", "lb", "ld", "lk", "n", "nd", "r", "s", "sk", "v", "w", "y"];
      4 var nm4 = ["a", "a", "e", "e", "i", "i", "o", "u"];
      5 var nm5 = ["d", "j", "n", "r", "sh", "t", "v"];
      6 var nm6 = ["a", "a", "e", "i", "i", "o", "u", "u"];
      7 var nm7 = ["", "", "", "", "", "", "", "", "", "k", "n", "s", "t"];
      8 var br = "";
      9 
     10 function nameGen() {
     11     $('#placeholder').css('textTransform', 'capitalize');
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         nameMas();
     16         while (nMs === "") {
     17             nameMas();
     18         }
     19         br = document.createElement('br');
     20         element.appendChild(document.createTextNode(nMs));
     21         element.appendChild(br);
     22     }
     23     if (document.getElementById("result")) {
     24         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     25     }
     26     document.getElementById("placeholder").appendChild(element);
     27 }
     28 
     29 function nameMas() {
     30     nTp = Math.random() * 7 | 0;
     31     rnd = Math.random() * nm1.length | 0;
     32     rnd2 = Math.random() * nm2.length | 0;
     33     rnd3 = Math.random() * nm3.length | 0;
     34     rnd4 = Math.random() * nm4.length | 0;
     35     rnd7 = Math.random() * nm7.length | 0;
     36     if (nTp < 3) {
     37         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm7[rnd7];
     38     } else if (nTp < 6) {
     39         rnd5 = Math.random() * nm5.length | 0;
     40         rnd6 = Math.random() * nm6.length | 0;
     41         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + nm7[rnd7];
     42     } else {
     43         rnd7 = Math.random() * nm5.length | 0;
     44         rnd8 = Math.random() * nm6.length | 0;
     45         while (nm3[rnd3].length > 1) {
     46             rnd3 = Math.random() * nm3.length | 0;
     47         }
     48         while (nm5[rnd5] === nm5[rnd7]) {
     49             rnd7 = Math.random() * nm5.length | 0;
     50         }
     51         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6] + nm5[rnd7] + nm6[rnd8];
     52     }
     53     testSwear(nMs);
     54 }