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

lovecraftianNames.js (2790B)


      1 var nm1 = ["a", "e", "i", "u", "o", "a", "ai", "aiu", "aiue", "e", "i", "ia", "iau", "iu", "o", "u", "y", "ya", "yi", "yo"];
      2 var nm2 = ["bh", "br", "c'th", "cn", "ct", "cth", "cx", "d", "d'", "g", "gh", "ghr", "gr", "h", "k", "kh", "kth", "mh", "mh'", "ml", "n", "ng", "sh", "t", "th", "tr", "v", "v'", "vh", "vh'", "vr", "x", "z", "z'", "zh"];
      3 var nm3 = ["a", "e", "i", "u", "o", "a", "e", "i", "u", "o", "ao", "aio", "ui", "aa", "io", "ou", "y"];
      4 var nm4 = ["bb", "bh", "br", "cn", "ct", "dh", "dhr", "dr", "drr", "g", "gd", "gg", "ggd", "gh", "gn", "gnn", "gr", "jh", "kl", "l", "ld", "lk", "ll", "lp", "lth", "mbr", "nd", "p", "r", "rr", "rv", "th", "thl", "thr", "thrh", "tl", "vh", "x", "xh", "z", "zh", "zt"];
      5 var nm5 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "'dhr", "'dr", "'end", "'gn", "'ith", "'itr", "'k", "'kr", "'l", "'m", "'r", "'th", "'vh", "'x", "'zh"];
      6 var nm6 = ["a", "e", "i", "u", "o"];
      7 var nm7 = ["", "", "", "", "", "", "", "", "", "", "d", "g", "h", "l", "lb", "lbh", "n", "r", "rc", "rh", "s", "sh", "ss", "st", "sz", "th", "tl", "x", "xr", "xz"];
      8 var br = "";
      9 
     10 function nameGen() {
     11     $('#placeholder').css('textTransform', 'capitalize');
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         nameMas();
     16         while (nMs === "") {
     17             nameMas();
     18         }
     19         br = document.createElement('br');
     20         element.appendChild(document.createTextNode(nMs));
     21         element.appendChild(br);
     22     }
     23     if (document.getElementById("result")) {
     24         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     25     }
     26     document.getElementById("placeholder").appendChild(element);
     27 }
     28 
     29 function nameMas() {
     30     if (i < 5) {
     31         rnd = Math.floor(Math.random() * nm2.length);
     32         rnd2 = Math.floor(Math.random() * nm3.length);
     33         rnd3 = Math.floor(Math.random() * nm4.length);
     34         rnd4 = Math.floor(Math.random() * nm5.length);
     35         rnd5 = Math.floor(Math.random() * nm6.length);
     36         rnd6 = Math.floor(Math.random() * nm7.length);
     37         nMs = nm2[rnd] + nm3[rnd2] + nm4[rnd3] + nm5[rnd4] + nm6[rnd5] + nm7[rnd6];
     38     } else {
     39         rnd1 = Math.floor(Math.random() * nm1.length);
     40         rnd = Math.floor(Math.random() * nm2.length);
     41         rnd2 = Math.floor(Math.random() * nm3.length);
     42         rnd3 = Math.floor(Math.random() * nm4.length);
     43         rnd4 = Math.floor(Math.random() * nm5.length);
     44         rnd5 = Math.floor(Math.random() * nm6.length);
     45         rnd6 = Math.floor(Math.random() * nm7.length);
     46         nMs = nm1[rnd1] + nm2[rnd] + nm3[rnd2] + nm4[rnd3] + nm5[rnd4] + nm6[rnd5] + nm7[rnd6];
     47     }
     48 }