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

instrumentNames.js (4554B)


      1 var names1 = ["a", "e", "i", "o", "u", "", "", "", "", "", "", "", "", "", ""];
      2 var names2 = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z", "br", "cr", "gr", "pr", "tr", "ch", "bl", "cl", "fl", "gl", "kl", "pl", "sl", "vl", "st", "str"];
      3 var names3 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ia", "ie", "io", "ai", "ea", "ei", "eo"];
      4 var names4 = ["b", "d", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "s", "t", "w", "x", "y", "ld", "lf", "lk", "lm", "ln", "lp", "ls", "lt", "ck", "cs", "ct", "ft", "mn", "ms", "ng", "ns", "ps", "rd", "rg", "rk", "rs", "rt", "sk", "ss", "ll", "st", "sh"];
      5 var names5 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ia", "ie", "io", "ai", "ea", "ei", "eo"];
      6 var names6 = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z", "bb", "cc", "dd", "ff", "gg", "kk", "ll", "mm", "nn", "pp", "rr", "ss", "tt", "zz", "br", "cr", "gr", "pr", "tr", "ch", "bl", "cl", "fl", "gl", "kl", "pl", "sl", "vl", "st", "str"];
      7 var names7 = ["a", "e", "i", "o", "u", "ia", "io", "ea", "ei", "eo"];
      8 var names8 = [" Accordion", " Bass", " Bow", " Clarinet", " Drum", " Drums", " Flute", " Guitar", " Harmonica", " Horn", " Organ", " Pipe", " Saxophone", " Trombone", " Trumpet", " Tuba", " Violin", " Whistle", "horn", "phone", "pipe", "horn", "phone", "phone", "phone", "phone", "pipe"];
      9 var names9 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ia", "io", "ai", "ea", "eo", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""];
     10 var br = "";
     11 
     12 function nameGen() {
     13     $('#placeholder').css('textTransform', 'capitalize');
     14     var element = document.createElement("div");
     15     element.setAttribute("id", "result");
     16     for (i = 0; i < 10; i++) {
     17         if (i < 3) {
     18             rnd = Math.floor(Math.random() * names1.length);
     19             rnd2 = Math.floor(Math.random() * names2.length);
     20             rnd3 = Math.floor(Math.random() * names3.length);
     21             rnd4 = Math.floor(Math.random() * names4.length);
     22             rnd5 = Math.floor(Math.random() * names5.length);
     23             names = names1[rnd] + names2[rnd2] + names3[rnd3] + names4[rnd4] + names5[rnd5];
     24         } else if (i < 6) {
     25             rnd = Math.floor(Math.random() * names1.length);
     26             rnd2 = Math.floor(Math.random() * names2.length);
     27             rnd3 = Math.floor(Math.random() * names3.length);
     28             rnd4 = Math.floor(Math.random() * names4.length);
     29             names = names1[rnd] + names2[rnd2] + names3[rnd3] + names4[rnd4];
     30         } else if (i < 8) {
     31             rnd = Math.floor(Math.random() * names1.length);
     32             rnd2 = Math.floor(Math.random() * names2.length);
     33             rnd3 = Math.floor(Math.random() * names3.length);
     34             rnd4 = Math.floor(Math.random() * names4.length);
     35             rnd5 = Math.floor(Math.random() * names9.length);
     36             rnd6 = Math.floor(Math.random() * names8.length);
     37             names = names1[rnd] + names2[rnd2] + names3[rnd3] + names4[rnd4] + names9[rnd5] + names8[rnd6];
     38         } else if (i === 8) {
     39             rnd = Math.floor(Math.random() * names1.length);
     40             rnd2 = Math.floor(Math.random() * names2.length);
     41             rnd3 = Math.floor(Math.random() * names3.length);
     42             rnd4 = Math.floor(Math.random() * names4.length);
     43             rnd5 = Math.floor(Math.random() * names5.length);
     44             rnd6 = Math.floor(Math.random() * names6.length);
     45             rnd7 = Math.floor(Math.random() * names7.length);
     46             names = names1[rnd] + names2[rnd2] + names3[rnd3] + names4[rnd4] + names5[rnd5] + names6[rnd6] + names7[rnd7];
     47         } else {
     48             rnd = Math.floor(Math.random() * names1.length);
     49             rnd2 = Math.floor(Math.random() * names2.length);
     50             rnd3 = Math.floor(Math.random() * names3.length);
     51             rnd4 = Math.floor(Math.random() * names4.length);
     52             rnd5 = Math.floor(Math.random() * names5.length);
     53             rnd6 = Math.floor(Math.random() * names4.length);
     54             names = names1[rnd] + names2[rnd2] + names3[rnd3] + names4[rnd4] + names5[rnd5] + names4[rnd6];
     55         }
     56         br = document.createElement('br');
     57         element.appendChild(document.createTextNode(names));
     58         element.appendChild(br);
     59     }
     60     if (document.getElementById("result")) {
     61         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     62     }
     63     document.getElementById("placeholder").appendChild(element);
     64 }