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

swCodruJiNames.js (3296B)


      1 var nm1 = ["", "", "", "b", "br", "d", "dr", "g", "gr", "j", "k", "r", "v", "vr", "z"];
      2 var nm2 = ["a", "i", "o", "a", "i", "o", "u"];
      3 var nm3 = ["c", "cc", "g", "gg", "k", "kk", "q", "qq", "r", "rr", "s", "ss", "t", "tt", "y", "z", "zz"];
      4 var nm4 = ["", "", "", "", "c", "d", "k", "l", "ln", "lm", "n", "m", "r", "rl", "rd"];
      5 var nm5 = ["c", "f", "h", "l", "m", "n", "r", "s", "t", "y"];
      6 var nm6 = ["a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "eo", "ei", "io", "yo"];
      7 var nm7 = ["d", "dd", "g", "h", "l", "ll", "n", "nn", "m", "mm", "r", "s", "ss", "y"];
      8 var nm8 = ["h", "l", "n", "s", "t", "th", "y"];
      9 var br = "";
     10 
     11 function nameGen(type) {
     12     var tp = type;
     13     $('#placeholder').css('textTransform', 'capitalize');
     14     var element = document.createElement("div");
     15     element.setAttribute("id", "result");
     16     for (i = 0; i < 10; i++) {
     17         if (tp === 1) {
     18             nameFem();
     19             while (nMs === "") {
     20                 nameFem();
     21             }
     22         } else {
     23             nameMas();
     24             while (nMs === "") {
     25                 nameMas();
     26             }
     27             rnd = Math.random() * 3 | 0;
     28             if (rnd !== 0) {
     29                 rnd = Math.random() * nm1.length | 0;
     30                 rnd2 = Math.random() * nm2.length | 0;
     31                 if (rnd === 1) {
     32                     nm1[rnd] + nm2[rnd2] + "-" + nMs;
     33                 } else {
     34                     nMs + "-" + nm1[rnd] + nm2[rnd2];
     35                 }
     36             }
     37         }
     38         br = document.createElement('br');
     39         element.appendChild(document.createTextNode(nMs));
     40         element.appendChild(br);
     41     }
     42     if (document.getElementById("result")) {
     43         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     44     }
     45     document.getElementById("placeholder").appendChild(element);
     46 }
     47 
     48 function nameMas() {
     49     rnd = Math.random() * nm1.length | 0;
     50     rnd2 = Math.random() * nm2.length | 0;
     51     rnd3 = Math.random() * nm4.length | 0;
     52     if (i < 3) {
     53         while (nm1[rnd] === "") {
     54             rnd = Math.random() * nm1.length | 0;
     55         }
     56         while (nm4[rnd3] === nm1[rnd] || nm4[rnd3] === "") {
     57             rnd3 = Math.random() * nm4.length | 0;
     58         }
     59         nMs = nm1[rnd] + nm2[rnd2] + nm4[rnd3];
     60     } else {
     61         rnd4 = Math.random() * nm3.length | 0;
     62         rnd5 = Math.random() * nm2.length | 0;
     63         while (nm1[rnd] === nm3[rnd4] || nm3[rnd4] === nm4[rnd3]) {
     64             rnd4 = Math.random() * nm3.length | 0;
     65         }
     66         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm2[rnd5] + nm4[rnd3];
     67     }
     68     testSwear(nMs);
     69 }
     70 
     71 function nameFem() {
     72     sTp = Math.random() * 2 | 0;
     73     rnd = Math.random() * nm5.length | 0;
     74     rnd2 = Math.random() * nm6.length | 0;
     75     if (sTp === 0) {
     76         rnd3 = Math.random() * nm8.length | 0;
     77         while (nm8[rnd3] === nm5[rnd]) {
     78             rnd3 = Math.random() * nm8.length | 0;
     79         }
     80         nMs = nm5[rnd] + nm6[rnd2] + nm8[rnd3];
     81     } else {
     82         rnd3 = Math.random() * nm7.length | 0;
     83         rnd4 = Math.random() * nm6.length | 0;
     84         while (nm5[rnd] === nm7[rnd3]) {
     85             rnd3 = Math.random() * nm7.length | 0;
     86         }
     87         nMs = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4];
     88     }
     89     testSwear(nMs);
     90 }