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

zeldaBlins.js (1551B)


      1 var nm1 = ["b", "d", "g", "h", "l", "m", "n", "r", "v", "z"];
      2 var nm2 = ["a", "o", "u", "a", "o", "u"];
      3 var nm3 = ["b", "d", "g", "l", "m", "n", "r"];
      4 var nm4 = ["d", "h", "l", "m", "n", "r", "v", "z"];
      5 var nm5 = ["d", "l", "n", "r", "v", "y", "z"];
      6 var br = "";
      7 
      8 function nameGen(type) {
      9     var tp = type;
     10     $('#placeholder').css('textTransform', 'capitalize');
     11     var element = document.createElement("div");
     12     element.setAttribute("id", "result");
     13     for (i = 0; i < 10; i++) {
     14         nameMas();
     15         while (nMs === "") {
     16             nameMas();
     17         }
     18         if (i < 5) {
     19             nMs = nMs + "blin";
     20         }
     21         br = document.createElement('br');
     22         element.appendChild(document.createTextNode(nMs));
     23         element.appendChild(br);
     24     }
     25     if (document.getElementById("result")) {
     26         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     27     }
     28     document.getElementById("placeholder").appendChild(element);
     29 }
     30 
     31 function nameMas() {
     32     nTp = Math.random() * 6 | 0;
     33     rnd = Math.random() * nm1.length | 0;
     34     rnd2 = Math.random() * nm2.length | 0;
     35     if (i < 5) {
     36         rnd3 = Math.random() * nm3.length | 0;
     37         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3];
     38     } else {
     39         rnd3 = Math.random() * nm2.length | 0;
     40         rnd4 = Math.random() * nm4.length | 0;
     41         rnd5 = Math.random() * nm2.length | 0;
     42         rnd6 = Math.random() * nm5.length | 0;
     43         nMs = nm1[rnd] + nm2[rnd3] + nm4[rnd4] + nm2[rnd5] + nm5[rnd6] + nm2[rnd2];
     44     }
     45     testSwear(nMs);
     46 }