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

catharNames.js (3445B)


      1 var nm1 = ["", "", "a", "u", "y", "i"];
      2 var nm2 = ["c", "cr", "h", "kh", "m", "n", "r", "s", "t", "x"];
      3 var nm3 = ["a", "i", "o", "y", "u"];
      4 var nm4 = ["c", "d", "k", "m", "n", "nd", "r", "rb", "s"];
      5 var nm5 = ["", "", "", "", "", "c", "h", "hr", "k", "m", "n", "rr", "x"];
      6 var nm6 = ["c", "ch", "d", "j", "m", "n", "r", "s", "th", "x"];
      7 var nm7 = ["h", "l", "lv", "m", "n", "r", "s", "th", "v", "sh", "w"];
      8 var nm8 = ["r", "h", "s", "n", "hr", "x", "sh", "z"];
      9 var nm9 = ["", "", "", "a", "i", "y"];
     10 var nm10 = ["j", "k", "l", "m", "n", "p", "r", "s", "t"];
     11 var nm11 = ["i", "o", "a", "u"];
     12 var nm12 = ["d", "l", "m", "n", "s", "sh", "rg", "z"];
     13 var nm13 = ["", "", "", "g", "k", "l", "m", "n", "r", "s", "t"];
     14 var nm14 = ["", "", "", "h"];
     15 
     16 function nameGen(type) {
     17     $('#placeholder').css('textTransform', 'capitalize');
     18     var tp = type;
     19     var br = "";
     20     var element = document.createElement("div");
     21     element.setAttribute("id", "result");
     22     for (i = 0; i < 10; i++) {
     23         if (i < 5) {
     24             rn = Math.floor(Math.random() * nm10.length);
     25             rn2 = Math.floor(Math.random() * nm14.length);
     26             rn3 = Math.floor(Math.random() * nm11.length);
     27             rn4 = Math.floor(Math.random() * nm12.length);
     28             rn5 = Math.floor(Math.random() * nm11.length);
     29             rn6 = Math.floor(Math.random() * nm13.length);
     30             lName = nm10[rn] + nm14[rn2] + nm11[rn3] + nm12[rn4] + nm11[rn5] + nm13[rn6];
     31         } else {
     32             rn = Math.floor(Math.random() * nm10.length);
     33             rn2 = Math.floor(Math.random() * nm14.length);
     34             rn5 = Math.floor(Math.random() * nm11.length);
     35             rn6 = Math.floor(Math.random() * nm13.length);
     36             lName = nm10[rn] + nm14[rn2] + nm11[rn5] + nm13[rn6];
     37         }
     38         if (tp === 1) {
     39             rnd = Math.floor(Math.random() * nm6.length);
     40             rnd2 = Math.floor(Math.random() * nm3.length);
     41             rnd3 = Math.floor(Math.random() * nm7.length);
     42             rnd4 = Math.floor(Math.random() * nm3.length);
     43             rnd5 = Math.floor(Math.random() * nm8.length);
     44             rnd6 = Math.floor(Math.random() * nm9.length);
     45             names = nm6[rnd] + nm3[rnd2] + nm7[rnd3] + nm3[rnd4] + nm8[rnd5] + nm9[rnd6] + " " + lName;
     46         } else {
     47             if (i < 5) {
     48                 rnd = Math.floor(Math.random() * nm2.length);
     49                 rnd2 = Math.floor(Math.random() * nm3.length);
     50                 rnd3 = Math.floor(Math.random() * nm4.length);
     51                 rnd4 = Math.floor(Math.random() * nm3.length);
     52                 rnd5 = Math.floor(Math.random() * nm5.length);
     53                 names = nm2[rnd] + nm3[rnd2] + nm4[rnd3] + nm3[rnd4] + nm5[rnd5] + " " + lName;
     54             } else {
     55                 rnd = Math.floor(Math.random() * nm1.length);
     56                 rnd2 = Math.floor(Math.random() * nm2.length);
     57                 rnd3 = Math.floor(Math.random() * nm3.length);
     58                 rnd4 = Math.floor(Math.random() * nm5.length);
     59                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm5[rnd4] + " " + lName;
     60             }
     61         }
     62         br = document.createElement('br');
     63         element.appendChild(document.createTextNode(names));
     64         element.appendChild(br);
     65     }
     66     if (document.getElementById("result")) {
     67         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     68     }
     69     document.getElementById("placeholder").appendChild(element);
     70 }