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

drellNames.js (2252B)


      1 var nm1 = [""];
      2 var nm2 = ["ka", "ki", "ku", "ke", "ko", "sa", "si", "su", "se", "so", "sha", "shi", "shu", "she", "sho", "ta", "ti", "tu", "te", "to", "tha", "thi", "thu", "the", "tho", "dra", "dri", "dru", "dre", "dro", "ma", "mi", "mu", "me", "mo", "na", "ni", "nu", "ne", "no", "ha", "hi", "hu", "he", "ho", "fa", "fi", "fu", "fe", "fo", "ra", "ri", "ru", "re", "ro", "la", "li", "lu", "le", "lo", "ya", "yi", "yu", "ye", "yo"];
      3 var nm3 = ["n", "l", "t", "k", "s", "", "", "", "", "", "", "", "", "", "", "", ""];
      4 var nm4 = ["ka", "ki", "ku", "ke", "ko", "sa", "si", "su", "se", "so", "ta", "ti", "tu", "te", "to", "ma", "mi", "mu", "me", "mo", "na", "ni", "nu", "ne", "no", "ha", "hi", "hu", "he", "ho", "fa", "fi", "fu", "fe", "fo", "ra", "ri", "ru", "re", "ro", "la", "li", "lu", "le", "lo", "ya", "yi", "yu", "ye", "yo"];
      5 var nm5 = ["n", "l", "t", "k", "s", "h", "m", "", "", "", "", "", "", "", "", "", "", "", ""];
      6 var nm6 = ["a", "e", "i", "o", "u"];
      7 var nm7 = ["n", "l", "t", "k", "s"];
      8 
      9 function nameGen(type) {
     10     $('#placeholder').css('textTransform', 'capitalize');
     11     var tp = type;
     12     if (tp === 1) {
     13         nm1 = ["a", "e", "i", "o", "u"];
     14     } else {
     15         nm1 = [""];
     16     }
     17     var br = "";
     18     var element = document.createElement("div");
     19     element.setAttribute("id", "result");
     20     for (i = 0; i < 10; i++) {
     21         rnd = Math.floor(Math.random() * nm1.length);
     22         rnd2 = Math.floor(Math.random() * nm2.length);
     23         rnd3 = Math.floor(Math.random() * nm3.length);
     24         rnd4 = Math.floor(Math.random() * nm4.length);
     25         rnd5 = Math.floor(Math.random() * nm5.length);
     26         rnd6 = Math.floor(Math.random() * nm2.length);
     27         rnd7 = Math.floor(Math.random() * nm6.length);
     28         rnd8 = Math.floor(Math.random() * nm7.length);
     29         names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + " " + nm2[rnd6] + nm6[rnd7] + nm7[rnd8];
     30         br = document.createElement('br');
     31         element.appendChild(document.createTextNode(names));
     32         element.appendChild(br);
     33     }
     34     if (document.getElementById("result")) {
     35         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     36     }
     37     document.getElementById("placeholder").appendChild(element);
     38 }