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

pfAndroid.js (2350B)


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