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

darkCrystalPodlings.js (3121B)


      1 var nm1 = ["h", "k", "l", "m", "n", "r", "t", "v", "y", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "o", "u"];
      3 var nm3 = ["ch", "d", "l", "n", "r", "t", "th", "v", "y", "z"];
      4 var nm4 = ["a", "i", "o", "a", "e", "o", "i", "u"];
      5 var nm5 = ["b", "d", "l", "m", "n", "p"];
      6 var nm6 = ["", "", "c", "f", "h", "l", "m", "n", "r", "s", "t"];
      7 var nm7 = ["a", "e", "i", "a", "e", "i", "o", "y"];
      8 var nm8 = ["d", "dr", "dl", "g", "gr", "gn", "gm", "k", "km", "kr", "lm", "ln", "ld", "lr", "lv", "l", "ll", "m", "mn", "ml", "n", "nd", "ng", "nk", "nl", "nm", "nv", "p", "pr", "ph", "r", "rl", "rm", "rn", "rr", "rv", "s", "sh", "st", "sm", "sl", "t", "th", "tr", "tl"];
      9 var nm9 = ["a", "e", "i", "a", "e", "i", "a", "e", "i", "ie", "ee", "ea", "ae"];
     10 var nm10 = ["h", "l", "n", "r", "s", "v", "y", "z"];
     11 var nm11 = ["a", "a", "e", "i", "o"];
     12 var br = "";
     13 
     14 function nameGen(type) {
     15     var tp = type;
     16     $('#placeholder').css('textTransform', 'capitalize');
     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     nTp = Math.random() * 2 | 0;
     43     rnd = Math.random() * nm1.length | 0;
     44     rnd2 = Math.random() * nm2.length | 0;
     45     rnd3 = Math.random() * nm5.length | 0;
     46     if (nTp === 0) {
     47         while (nm1[rnd] === nm5[rnd3]) {
     48             rnd = Math.random() * nm1.length | 0;
     49         }
     50         nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
     51     } else {
     52         rnd4 = Math.random() * nm3.length | 0;
     53         rnd5 = Math.random() * nm4.length | 0;
     54         while (nm3[rnd4] === nm5[rnd3] || nm3[rnd4] === nm1[rnd]) {
     55             rnd4 = Math.random() * nm3.length | 0;
     56         }
     57         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd3];
     58     }
     59     testSwear(nMs);
     60 }
     61 
     62 function nameFem() {
     63     nTp = Math.random() * 2 | 0;
     64     rnd = Math.random() * nm6.length | 0;
     65     rnd2 = Math.random() * nm7.length | 0;
     66     rnd3 = Math.random() * nm8.length | 0;
     67     rnd4 = Math.random() * nm11.length | 0;
     68     if (nTp === 0) {
     69         while (nm6[rnd] === nm8[rnd3]) {
     70             rnd = Math.random() * nm6.length | 0;
     71         }
     72         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm11[rnd4];
     73     } else {
     74         rnd5 = Math.random() * nm10.length | 0;
     75         rnd6 = Math.random() * nm9.length | 0;
     76         while (nm10[rnd5] === nm8[rnd3] || nm8[rnd3] === nm6[rnd]) {
     77             rnd8 = Math.random() * nm3.length | 0;
     78         }
     79         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd6] + nm10[rnd5] + nm11[rnd4];
     80     }
     81     testSwear(nMs);
     82 }