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

lolIxtalNames.js (2585B)


      1 var nm1 = ["", "", "b", "d", "g", "m", "n", "r", "v", "z"];
      2 var nm2 = ["a", "a", "e", "i", "o", "u"];
      3 var nm3 = ["d", "l", "m", "n", "r", "y", "z"];
      4 var nm4 = ["a", "e", "i", "o", "u"];
      5 var nm5 = ["d", "l", "n", "r", "s"];
      6 var nm6 = ["d", "h", "l", "m", "n", "q", "r", "y", "z"];
      7 var nm7 = ["a", "a", "i", "i", "e"];
      8 var nm8 = ["d", "f", "l", "ll", "m", "n", "r", "v", "y"];
      9 var nm9 = ["a", "e", "a", "e", "i"];
     10 var nm10 = ["l", "ll", "n", "nn", "r", "rr", "s", "ss", "y"];
     11 var nm11 = ["ee", "ie", "ei", "a", "a", "e", "i", "a", "a", "e", "i", "a", "a", "e", "i", "a", "a", "e", "i"];
     12 
     13 function nameGen(type) {
     14     $('#placeholder').css('textTransform', 'capitalize');
     15     var tp = type;
     16     var br = "";
     17     var element = document.createElement("div");
     18     element.setAttribute("id", "result");
     19     for (i = 0; i < 10; i++) {
     20         if (tp === 1) {
     21             nameFem();
     22             while (nMs === "") {
     23                 nameFem();
     24             }
     25         } else {
     26             nameMas();
     27             while (nMs === "") {
     28                 nameMas();
     29             }
     30         }
     31         br = document.createElement('br');
     32         element.appendChild(document.createTextNode(nMs));
     33         element.appendChild(br);
     34     }
     35     if (document.getElementById("result")) {
     36         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     37     }
     38     document.getElementById("placeholder").appendChild(element);
     39 }
     40 
     41 function nameMas() {
     42     rnd = Math.random() * nm1.length | 0;
     43     rnd2 = Math.random() * nm2.length | 0;
     44     rnd3 = Math.random() * nm5.length | 0;
     45     rnd5 = Math.random() * nm3.length | 0;
     46     rnd4 = Math.random() * nm4.length | 0;
     47     while (nm3[rnd5] === nm1[rnd] && nm3[rnd5] === nm5[rnd3]) {
     48         rnd5 = Math.random() * nm3.length | 0;
     49     }
     50     nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd5] + nm4[rnd4] + nm5[rnd3];
     51     testSwear(nMs);
     52 }
     53 
     54 function nameFem() {
     55     nTp = Math.random() * 5 | 0;
     56     rnd = Math.random() * nm6.length | 0;
     57     rnd2 = Math.random() * nm7.length | 0;
     58     rnd3 = Math.random() * nm8.length | 0;
     59     rnd4 = Math.random() * nm11.length | 0;
     60     if (nTp < 2) {
     61         while (nm6[rnd] === nm8[rnd3]) {
     62             rnd3 = Math.random() * nm8.length | 0;
     63         }
     64         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm11[rnd4];
     65     } else {
     66         rnd6 = Math.random() * nm9.length | 0;
     67         rnd7 = Math.random() * nm10.length | 0;
     68         while (nm10[rnd7] === nm8[rnd3]) {
     69             rnd7 = Math.random() * nm10.length | 0;
     70         }
     71         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd6] + nm10[rnd7] + nm11[rnd4];
     72     }
     73 }