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

miralukaNames.js (2318B)


      1 var nm1 = ["A", "B", "Ch", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "", "", ""];
      2 var nm2 = ["i", "a", "o", "e", "u"];
      3 var nm3 = ["b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "y", "z"];
      4 var nm4 = ["b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "y", "z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""];
      5 var nm5 = ["i", "a", "o", "e", "u", "", "", "", "", "", "", "", "", "", ""];
      6 var nm6 = ["c", "d", "f", "h", "hr", "hk", "hl", "k", "l", "m", "n", "p", "r", "rr", "rth", "s", "t", "th", "y"];
      7 var nm7 = ["A", "B", "Ch", "D", "E", "F", "Fl", "G", "Gl", "H", "I", "J", "K", "L", "M", "N", "O", "P", "R", "S", "Sh", "Sl", "T", "U", "V", "W", "X", "Y", "Z"];
      8 var nm8 = ["i", "a", "o", "e", "u", "", "", ""];
      9 var br = "";
     10 
     11 function nameGen(type) {
     12     $('#placeholder').css('textTransform', 'capitalize');
     13     var tp = type;
     14     var element = document.createElement("div");
     15     element.setAttribute("id", "result");
     16     for (i = 0; i < 10; i++) {
     17         rnd2 = Math.floor(Math.random() * nm2.length);
     18         rnd2b = Math.floor(Math.random() * nm2.length);
     19         rnd3 = Math.floor(Math.random() * nm3.length);
     20         rnd4 = Math.floor(Math.random() * nm4.length);
     21         rnd6 = Math.floor(Math.random() * nm6.length);
     22         if (tp === 1) {
     23             rnd1 = Math.floor(Math.random() * nm7.length);
     24             rnd5 = Math.floor(Math.random() * nm8.length);
     25             names = nm7[rnd1] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm2[rnd2b] + nm8[rnd5] + nm6[rnd6];
     26         } else {
     27             rnd1 = Math.floor(Math.random() * nm1.length);
     28             rnd5 = Math.floor(Math.random() * nm5.length);
     29             names = nm1[rnd1] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm2[rnd2b] + nm5[rnd5] + nm6[rnd6];
     30         }
     31         br = document.createElement('br');
     32         element.appendChild(document.createTextNode(names));
     33         element.appendChild(br);
     34     }
     35     if (document.getElementById("result")) {
     36         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     37     }
     38     document.getElementById("placeholder").appendChild(element);
     39 }