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

metalNames.js (2293B)


      1 var nm1 = ["", "", "", "", "", "b", "c", "d", "f", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"];
      2 var nm2 = ["a", "e", "o", "u"];
      3 var nm3 = ["br", "cr", "dr", "fr", "gr", "pr", "str", "tr", "bl", "cl", "fl", "gl", "pl", "sl", "sc", "sk", "sm", "sn", "sp", "st", "sw", "ch", "sh", "th", "wh", "kr"];
      4 var nm4 = ["ae", "ai", "ao", "au", "a", "ay", "ea", "ei", "eo", "eu", "e", "ey", "ua", "ue", "ui", "uo", "u", "uy", "ia", "ie", "iu", "io", "iy", "oa", "oe", "ou", "oi", "o", "oy"];
      5 var nm5 = ["sium", "cium", "lium", "rium", "trium", "tium", "nese", "nium", "sten", "nor", "tine", "ntine", "rhil", "thil", "nyx", "dian"];
      6 var nm6 = ["ium", "ese", "alt", "um", "ian", "il", "ine", "yx", "ite"];
      7 
      8 function nameGen() {
      9     $('#placeholder').css('textTransform', 'capitalize');
     10     var br = "";
     11     var element = document.createElement("div");
     12     element.setAttribute("id", "result");
     13     for (i = 0; i < 10; i++) {
     14         if (i < 4) {
     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             rnd5 = Math.floor(Math.random() * nm5.length);
     20             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     21         } else if (i < 7) {
     22             rnd3 = Math.floor(Math.random() * nm3.length);
     23             rnd4 = Math.floor(Math.random() * nm4.length);
     24             rnd5 = Math.floor(Math.random() * nm5.length);
     25             names = nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     26         } else {
     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() * nm6.length);
     31             names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4];
     32         }
     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 }