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

gorgonNames.js (2811B)


      1 var nm1 = ["ch", "chr", "d", "h", "k", "m", "n", "ph", "r", "sth", "th", "x", "v", "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", "y", "a", "e", "i", "o", "u", "y", "eia", "ei", "eu", "ae", "ya", "ai", "ia"];
      3 var nm3 = ["d", "l", "m", "n", "r", "s", "x", "v", "z", "d", "l", "m", "n", "r", "s", "x", "v", "z", "d", "l", "m", "n", "r", "s", "x", "v", "z", "dn", "dr", "gg", "gn", "kt", "lc", "ld", "mbr", "nc", "ndr", "nt", "nth", "rd", "rl", "rr", "sc", "sd", "sn", "sp", "st", "str", "th", "tt"];
      4 var nm4 = ["a", "e", "o", "a", "e", "o", "a", "e", "o", "ea", "ia", "y"];
      5 var nm5 = ["aemon", "aenon", "aeon", "aestus", "aeus", "agos", "aios", "anes", "anos", "antos", "aon", "arus", "as", "ates", "atos", "aumas", "eas", "eidon", "er", "erion", "erus", "es", "etheus", "etus", "eus", "ias", "ibos", "ion", "ios", "is", "iton", "ius", "o", "oeis", "oeus", "olus", "on", "onos", "or", "os", "oteus", "otos", "otus", "ous", "us", "yrus", "ys", "ytion"];
      6 var br = "";
      7 
      8 function nameGen(type) {
      9     $('#placeholder').css('textTransform', 'capitalize');
     10     var tp = type;
     11     var element = document.createElement("div");
     12     element.setAttribute("id", "result");
     13     for (i = 0; i < 10; i++) {
     14         if (tp === 1) {
     15             rnd = Math.floor(Math.random() * nm1.length);
     16             rnd2 = Math.floor(Math.random() * nm2.length);
     17             rnd3 = Math.floor(Math.random() * nm3.length);
     18             rnd4 = Math.floor(Math.random() * nm4.length);
     19             if (i < 5) {
     20                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4];
     21             } else {
     22                 rnd5 = Math.floor(Math.random() * nm3.length);
     23                 rnd6 = Math.floor(Math.random() * nm2.length);
     24                 if (rnd3 > 26) {
     25                     while (rnd5 > 26) {
     26                         rnd5 = Math.floor(Math.random() * nm3.length);
     27                     }
     28                 }
     29                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd6] + nm3[rnd5] + nm4[rnd4];
     30             }
     31         } else {
     32             rnd = Math.floor(Math.random() * nm1.length);
     33             rnd2 = Math.floor(Math.random() * nm2.length);
     34             rnd3 = Math.floor(Math.random() * nm3.length);
     35             rnd4 = Math.floor(Math.random() * nm5.length);
     36             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm5[rnd4];
     37         }
     38         br = document.createElement('br');
     39         element.appendChild(document.createTextNode(names));
     40         element.appendChild(br);
     41     }
     42     if (document.getElementById("result")) {
     43         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     44     }
     45     document.getElementById("placeholder").appendChild(element);
     46 }