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

gethNames.js (1447B)


      1 var names1 = ["Unit", "Platform", "Mod", "System", "SysMod", "GU", "G-Unit", "Geth-Unit", "Module"];
      2 var names3 = ["a", "b", "c", "e", "s", "x"];
      3 var names4 = ["Armada", "Batallion", "Alpha", "Omega", "Myriad", "Sundry", "Horde", "Brigade", "Phalanx", "Host", "Enigma", "Terminus", "Prophet", "Genesis", "Dawn", "Oracle", "Anomaly", "Centurion", "Obelisk", "Pinnacle", "Goliath", "Apex", "Vortex", "Vertex", "Armageddon", "Oblivion", "Eternity", "Daemon", "Demise", "Destiny"];
      4 
      5 function nameGen() {
      6     $('#placeholder').css('textTransform', 'capitalize');
      7     var br = "";
      8     var element = document.createElement("div");
      9     element.setAttribute("id", "result");
     10     for (i = 0; i < 10; i++) {
     11         if (i < 6) {
     12             rnd = Math.floor(Math.random() * names1.length);
     13             var names2 = Math.floor((Math.random() * 250) + 1);
     14             rnd1 = Math.floor(Math.random() * names3.length);
     15             names = names1[rnd] + "-" + names2 + names3[rnd1];
     16         } else {
     17             rnd0 = Math.floor(Math.random() * names4.length);
     18             names = names4[rnd0];
     19         }
     20         br = document.createElement('br');
     21         element.appendChild(document.createTextNode(names));
     22         element.appendChild(br);
     23     }
     24     if (document.getElementById("result")) {
     25         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     26     }
     27     document.getElementById("placeholder").appendChild(element);
     28 }