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

swToydarianNames.js (4285B)


      1 var nm1 = ["", "", "", "", "", "b", "br", "d", "dr", "f", "g", "gl", "k", "l", "m", "n", "p", "q", "r", "t", "v", "w", "z", "zl"];
      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", "oo", "ua", "uu", "ue", "ey", "oy"];
      3 var nm3 = ["b", "bb", "d", "dd", "f", "g", "gg", "ll", "m", "mg", "mr", "mt", "n", "ng", "nd", "nk", "nm", "pp", "r", "rg", "rd", "rf", "rp", "rr", "rt", "ssc", "ss", "sg", "sc", "st", "t", "tt", "tw"];
      4 var nm4 = ["", "", "", "", "", "", "", "", "b", "bb", "d", "g", "l", "lg", "m", "n"];
      5 var nm5 = ["b", "d", "f", "g", "k", "l", "m", "n", "q", "r", "s", "t", "v", "w", "z"];
      6 var nm6 = ["a", "e", "i", "o", "u"];
      7 var nm7 = ["b", "bb", "bl", "d", "dl", "f", "ff", "fl", "fn", "fm", "ffl", "g", "gg", "gl", "gm", "gn", "l", "ll", "lb", "ld", "lt", "m", "mt", "md", "n", "nt", "nl", "p", "pp", "r", "rr", "rg", "rl", "rt", "rz", "rb", "s", "ss", "sg", "st", "sl", "sb", "tt", "t", "tl", "tr", "v", "z"];
      8 var nm9 = ["b", "d", "f", "g", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "z"];
      9 var nm10 = ["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", "aa", "uu", "oo"];
     10 var nm11 = ["b", "bb", "d", "g", "l", "lg", "m", "n"];
     11 var br = "";
     12 
     13 function nameGen(type) {
     14     var tp = type;
     15     $('#placeholder').css('textTransform', 'capitalize');
     16     var element = document.createElement("div");
     17     element.setAttribute("id", "result");
     18     for (i = 0; i < 10; i++) {
     19         rnd7 = Math.floor(Math.random() * nm9.length);
     20         rnd8 = Math.floor(Math.random() * nm10.length);
     21         if (i % 2 != 0) {
     22             rnd9 = Math.floor(Math.random() * nm10.length);
     23             rnd10 = Math.floor(Math.random() * nm7.length);
     24             namelast = nm9[rnd7] + nm10[rnd8] + nm7[rnd10] + nm10[rnd9];
     25         } else {
     26             rnd9 = Math.floor(Math.random() * nm11.length);
     27             namelast = nm9[rnd7] + nm10[rnd8] + nm11[rnd9];
     28         }
     29         if (tp === 1) {
     30             rnd = Math.floor(Math.random() * nm5.length);
     31             rnd2 = Math.floor(Math.random() * nm6.length);
     32             rnd3 = Math.floor(Math.random() * nm7.length);
     33             rnd4 = Math.floor(Math.random() * nm6.length);
     34             if (i < 5) {
     35                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + "  " + namelast;
     36             } else {
     37                 rnd5 = Math.floor(Math.random() * nm6.length);
     38                 rnd6 = Math.floor(Math.random() * nm7.length);
     39                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd5] + "  " + namelast;
     40             }
     41         } else {
     42             rnd = Math.floor(Math.random() * nm1.length);
     43             rnd2 = Math.floor(Math.random() * nm2.length);
     44             rnd5 = Math.floor(Math.random() * nm4.length);
     45             if (i < 4) {
     46                 while (rnd < 5) {
     47                     rnd = Math.floor(Math.random() * nm1.length);
     48                 }
     49                 while (rnd5 < 8) {
     50                     rnd5 = Math.floor(Math.random() * nm4.length);
     51                 }
     52                 names = nm1[rnd] + nm2[rnd2] + nm4[rnd5] + "  " + namelast;
     53             } else if (i < 8) {
     54                 rnd3 = Math.floor(Math.random() * nm3.length);
     55                 rnd4 = Math.floor(Math.random() * nm2.length);
     56                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + "  " + namelast;
     57             } else {
     58                 rnd3 = Math.floor(Math.random() * nm3.length);
     59                 rnd4 = Math.floor(Math.random() * nm2.length);
     60                 rnd6 = Math.floor(Math.random() * nm3.length);
     61                 rnd7 = Math.floor(Math.random() * nm2.length);
     62                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5] + "  " + namelast;
     63             }
     64         }
     65         br = document.createElement('br');
     66         element.appendChild(document.createTextNode(names));
     67         element.appendChild(br);
     68     }
     69     if (document.getElementById("result")) {
     70         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     71     }
     72     document.getElementById("placeholder").appendChild(element);
     73 }