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

swHuttNames.js (3248B)


      1 var nm1 = ["", "", "", "", "", "b", "bl", "br", "bw", "c", "ch", "d", "dr", "f", "g", "gl", "gr", "h", "j", "k", "kh", "kl", "kr", "l", "m", "n", "p", "pl", "pr", "q", "r", "s", "sh", "sk", "sm", "sp", "sz", "t", "tr", "v", "w", "wh", "y", "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", "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", "ee", "io", "oo", "eu", "ua", "ai", "oa", "oe", "ae"];
      3 var nm3 = ["b", "bb", "bd", "bs", "ch", "chr", "d", "dd", "ddl", "ff", "ffr", "g", "gg", "gh", "gr", "j", "jj", "k", "kk", "l", "lb", "ld", "lg", "ll", "ln", "lr", "lt", "m", "mb", "mdr", "mr", "n", "nd", "ng", "ngr", "nj", "nn", "nt", "nv", "ny", "pp", "q", "r", "rb", "rbl", "rchr", "rd", "rdr", "rg", "rgr", "rk", "rl", "rp", "rph", "rr", "rrb", "rrg", "rs", "rt", "rv", "rz", "s", "sh", "sk", "skh", "ss", "st", "t", "th", "tj", "tt", "v", "w", "wn", "x", "yb"];
      4 var nm4 = ["", "", "", "", "", "", "", "", "", "b", "c", "d", "g", "gg", "h", "hl", "k", "l", "lb", "ll", "m", "n", "nn", "r", "rd", "rg", "rgg", "rm", "s", "sch", "sh", "sk", "ss", "th", "x", "z", "zz"];
      5 var br = "";
      6 
      7 function nameGen(type) {
      8     var tp = type;
      9     $('#placeholder').css('textTransform', 'capitalize');
     10     var element = document.createElement("div");
     11     element.setAttribute("id", "result");
     12     for (i = 0; i < 10; i++) {
     13         rnd8 = Math.floor(Math.random() * nm1.length);
     14         rnd9 = Math.floor(Math.random() * nm2.length);
     15         rnd12 = Math.floor(Math.random() * nm4.length);
     16         if (i % 2 === 0) {
     17             rnd10 = Math.floor(Math.random() * nm3.length);
     18             rnd11 = Math.floor(Math.random() * nm2.length);
     19             namelast = nm1[rnd8] + nm2[rnd9] + nm3[rnd10] + nm2[rnd11] + nm4[rnd12];
     20         } else {
     21             while (rnd8 < 5) {
     22                 rnd8 = Math.floor(Math.random() * nm1.length);
     23             }
     24             while (rnd12 < 9) {
     25                 rnd12 = Math.floor(Math.random() * nm4.length);
     26             }
     27             namelast = nm1[rnd8] + nm2[rnd9] + nm4[rnd12];
     28         }
     29         rnd = Math.floor(Math.random() * nm1.length);
     30         rnd2 = Math.floor(Math.random() * nm2.length);
     31         rnd3 = Math.floor(Math.random() * nm3.length);
     32         rnd4 = Math.floor(Math.random() * nm2.length);
     33         rnd5 = Math.floor(Math.random() * nm4.length);
     34         if (i < 7) {
     35             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + "  " + namelast;
     36         } else {
     37             rnd6 = Math.floor(Math.random() * nm3.length);
     38             rnd7 = Math.floor(Math.random() * nm2.length);
     39             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5] + "  " + namelast;
     40         }
     41         br = document.createElement('br');
     42         element.appendChild(document.createTextNode(names));
     43         element.appendChild(br);
     44     }
     45     if (document.getElementById("result")) {
     46         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     47     }
     48     document.getElementById("placeholder").appendChild(element);
     49 }