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

satyrNames.js (2965B)


      1 var nm1 = ["", "", "", "br", "c", "ch", "cr", "cl", "d", "dr", "dh", "f", "g", "gr", "gh", "gl", "gn", "h", "j", "k", "kr", "kn", "m", "n", "pr", "p", "q", "r", "rh", "s", "sh", "st", "str", "sn", "sm", "t", "tr", "v", "vr", "wr", "x", "xh", "z", "zr", "zh", "c", "d", "f", "g", "j", "j", "k", "m", "n", "p", "q", "r", "s", "t", "v", "x", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "y", "y", "ai", "ae", "au", "aa", "ea", "eo", "ee", "ia", "ie", "io"];
      3 var nm3 = ["b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "x", "z"];
      4 var nm4 = ["", "", "", "", "", "", "", "", "", "b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "r", "s", "t", "w", "x", "z"];
      5 var nm5 = ["c", "ck", "g", "h", "k", "l", "m", "n", "q", "r", "s", "sh", "t", "th", "x", "z"];
      6 var nm6 = ["e", "i", "u", "a", "o", "y", "ia", "ea", "ae"];
      7 var br = "";
      8 
      9 function nameGen(type) {
     10     $('#placeholder').css('textTransform', 'capitalize');
     11     var tp = type;
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         rnd = Math.random() * nm1.length | 0;
     16         rnd2 = Math.random() * nm2.length | 0;
     17         rnd3 = Math.random() * nm3.length | 0;
     18         if (tp === 1) {
     19             nameFem();
     20             while (nMs === "") {
     21                 nameFem();
     22             }
     23         } else {
     24             nameMas();
     25             while (nMs === "") {
     26                 nameMas();
     27             }
     28         }
     29         br = document.createElement('br');
     30         element.appendChild(document.createTextNode(nMs));
     31         element.appendChild(br);
     32     }
     33     if (document.getElementById("result")) {
     34         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     35     }
     36     document.getElementById("placeholder").appendChild(element);
     37 }
     38 
     39 function nameMas() {
     40     if (i < 5) {
     41         while (rnd < 3) {
     42             rnd = Math.random() * nm1.length | 0;
     43         }
     44         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3];
     45     } else {
     46         rnd4 = Math.random() * nm4.length | 0;
     47         rnd5 = Math.random() * nm2.length | 0;
     48         rnd6 = Math.random() * nm5.length | 0;
     49         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm2[rnd5] + nm5[rnd6];
     50     }
     51     testSwear(nMs);
     52 }
     53 
     54 function nameFem() {
     55     if (i < 5) {
     56         rnd4 = Math.random() * nm6.length | 0;
     57         while (rnd < 3) {
     58             rnd = Math.random() * nm1.length | 0;
     59         }
     60         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4];
     61     } else {
     62         rnd4 = Math.random() * nm4.length | 0;
     63         rnd5 = Math.random() * nm2.length | 0;
     64         rnd6 = Math.random() * nm5.length | 0;
     65         rnd7 = Math.random() * nm6.length | 0;
     66         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm2[rnd5] + nm5[rnd6] + nm6[rnd7];
     67     }
     68     testSwear(nMs);
     69 }