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

pfVanara.js (1843B)


      1 var nm1 = ["", "", "ch", "h", "k", "m", "n", "r", "th", "v", "y"];
      2 var nm2 = ["aa", "ua", "a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u"];
      3 var nm3 = ["ch", "cr", "kr", "m", "mm", "n", "ng", "nn", "p", "pr", "s", "sh", "shp", "sp", "ss", "st", "sth", "th", "thr", "v", "vr"];
      4 var nm4 = ["a", "e", "i", "o", "u"];
      5 var nm5 = ["k", "l", "m", "n", "p", "r", "t"];
      6 var nm6 = ["a", "a", "e", "i", "o", "u", "u"];
      7 var nm7 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "h", "l", "m", "n"];
      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() * 5 | 0;
     31     rnd = Math.random() * nm1.length | 0;
     32     rnd2 = Math.random() * nm2.length | 0;
     33     rnd4 = Math.random() * nm3.length | 0;
     34     rnd5 = Math.random() * nm6.length | 0;
     35     rnd3 = Math.random() * nm7.length | 0;
     36     if (nTp < 3) {
     37         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm6[rnd5] + nm7[rnd3];
     38     } else {
     39         rnd6 = Math.random() * nm4.length | 0;
     40         rnd7 = Math.random() * nm5.length | 0;
     41         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd6] + nm5[rnd7] + nm6[rnd5] + nm7[rnd3];
     42     }
     43     testSwear(nMs);
     44 }