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

swIktotchiNames.js (2266B)


      1 var nm1 = ["", "", "", "c", "d", "f", "h", "k", "m", "n", "r", "s", "t", "v", "w", "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", "ee", "ae", "ie", "ye", "yi", "ei"];
      3 var nm3 = ["d", "dh", "f", "fl", "fn", "l", "ll", "ld", "ln", "lm", "lr", "lv", "m", "mm", "md", "mr", "mn", "mk", "n", "nn", "nh", "nk", "ng", "nv", "nl", "r", "rr", "rn", "rl", "rk", "rd", "s", "sl", "sh", "shk"];
      4 var nm4 = ["", "", "", "", "j", "l", "m", "n", "r", "s", "th"];
      5 var nm5 = ["ch", "d", "h", "j", "k", "m", "n", "t", "v", "z"];
      6 var nm6 = ["a", "e", "i", "a", "e", "i", "a", "e", "i", "o", "u", "aa", "ii"];
      7 var nm7 = ["d", "f", "h", "j", "l", "m", "n", "r", "s", "v", "w", "z"];
      8 var nm8 = ["", "", "l", "mm", "n", "r", "s"];
      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         rnd6 = Math.floor(Math.random() * nm5.length);
     18         rnd7 = Math.floor(Math.random() * nm6.length);
     19         rnd8 = Math.floor(Math.random() * nm8.length);
     20         if (i % 2 === 0) {
     21             rnd9 = Math.floor(Math.random() * nm7.length);
     22             rnd10 = Math.floor(Math.random() * nm6.length);
     23             namelast = nm5[rnd6] + nm6[rnd7] + nm7[rnd9] + nm6[rnd10] + nm8[rnd8];
     24         } else {
     25             namelast = nm5[rnd6] + nm6[rnd7] + nm8[rnd8];
     26         }
     27         rnd = Math.floor(Math.random() * nm1.length);
     28         rnd2 = Math.floor(Math.random() * nm2.length);
     29         rnd3 = Math.floor(Math.random() * nm3.length);
     30         rnd4 = Math.floor(Math.random() * nm2.length);
     31         rnd5 = Math.floor(Math.random() * nm4.length);
     32         names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + "  " + namelast;
     33         br = document.createElement('br');
     34         element.appendChild(document.createTextNode(names));
     35         element.appendChild(br);
     36     }
     37     if (document.getElementById("result")) {
     38         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     39     }
     40     document.getElementById("placeholder").appendChild(element);
     41 }