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

horizonUtaru.js (2976B)


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