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

avatarFireNation.js (4706B)


      1 var nm22 = ["", "", "ch", "d", "j", "m", "n", "r", "s", "sh", "t", "y", "z"];
      2 var nm20 = ["ao", "ai", "ee", "a", "a", "e", "i", "o", "o", "u", "u"];
      3 var nm23 = ["j", "k", "m", "r", "s", "z", "k", "m", "r", "s", "z"];
      4 var nm21 = ["l", "n", "r", "s"];
      5 var nm24 = ["", "", "", "", "", "", "h", "k", "m", "n"];
      6 var nm19 = ["a", "a", "e", "i", "o", "o", "u", "u"];
      7 var nm25 = ["", "", "ch", "h", "l", "m", "n", "s", "sh", "t", "y", "z"];
      8 var nm26 = ["k", "l", "m", "n", "ng", "r", "rs", "s", "y", "z"];
      9 var nm27 = ["", "", "", "n", "h"];
     10 var nm28 = ["ei", "ai", "ee", "a", "a", "e", "i", "o", "o", "u", "u", "y", "y"];
     11 var nm29 = ["k", "l", "m", "n", "r", "s", "y", "z"];
     12 first = -1;
     13 triggered = 0;
     14 reset = 0;
     15 
     16 function preload(arrayOfImages) {
     17     $(arrayOfImages).each(function() {
     18         $('<img/>')[0].src = this;
     19     });
     20 }
     21 preload(['../images/backgrounds/avatarIrohEaster.jpg', '../images/backgrounds/avatarZukoEaster.jpg', '../images/backgrounds/avatarAzula.jpg']);
     22 
     23 function nameGen(type) {
     24     if (reset === 1) {
     25         $("#nameGen").css("background-image", bg);
     26         reset = 0;
     27     }
     28     $('#placeholder').css('textTransform', 'capitalize');
     29     var tp = type;
     30     var br = "";
     31     var element = document.createElement("div");
     32     element.setAttribute("id", "result");
     33     nTp = Math.random() * 50 | 0;
     34     if (nTp === 0 && first !== 0 && triggered === 0) {
     35         nTp = Math.random() * 3 | 0;
     36         if (nTp === 0) {
     37             iroh();
     38         } else if (nTp === 1) {
     39             zuko();
     40         } else {
     41             azula();
     42         }
     43     } else {
     44         for (i = 0; i < 10; i++) {
     45             if (tp === 1) {
     46                 nameFem()
     47                 while (nMs === "") {
     48                     nameFem();
     49                 }
     50             } else {
     51                 nameMas()
     52                 while (nMs === "") {
     53                     nameMas();
     54                 }
     55             }
     56             br = document.createElement('br');
     57             element.appendChild(document.createTextNode(nMs));
     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         first++;
     65     }
     66 }
     67 
     68 function nameMas() {
     69     nTp = Math.random() * 6 | 0;
     70     rnd = Math.random() * nm22.length | 0;
     71     rnd2 = Math.random() * nm20.length | 0;
     72     rnd5 = Math.random() * nm24.length | 0;
     73     if (nTp === 0) {
     74         while (nm22[rnd] === "" && nm24[rnd5] === "") {
     75             rnd = Math.random() * nm22.length | 0;
     76         }
     77         nMs = nm22[rnd] + nm20[rnd2] + nm24[rnd5];
     78     } else {
     79         rnd3 = Math.random() * nm23.length | 0;
     80         rnd4 = Math.random() * nm20.length | 0;
     81         if (rnd2 < 3) {
     82             while (rnd4 < 3) {
     83                 rnd4 = Math.random() * nm20.length | 0;
     84             }
     85         }
     86         if (nTp < 5) {
     87             while (nm23[rnd3] === nm22[rnd] || nm23[rnd3] === nm24[rnd5]) {
     88                 rnd3 = Math.random() * nm23.length | 0;
     89             }
     90             nMs = nm22[rnd] + nm20[rnd2] + nm23[rnd3] + nm20[rnd4] + nm24[rnd5];
     91         } else {
     92             rnd6 = Math.random() * nm21.length | 0;
     93             rnd7 = Math.random() * nm19.length | 0;
     94             while (nm21[rnd6] === nm23[rnd3] || nm21[rnd6] === nm24[rnd5]) {
     95                 rnd6 = Math.random() * nm21.length | 0;
     96             }
     97             nMs = nm20[rnd2] + nm23[rnd3] + nm19[rnd7] + nm21[rnd6] + nm20[rnd4] + nm24[rnd5];
     98         }
     99     }
    100     testSwear(nMs);
    101 }
    102 
    103 function nameFem() {
    104     nTp = Math.random() * 6 | 0;
    105     rnd = Math.random() * nm25.length | 0;
    106     rnd2 = Math.random() * nm28.length | 0;
    107     rnd5 = Math.random() * nm27.length | 0;
    108     if (nTp < 2) {
    109         while (nm25[rnd] === "" && nm27[rnd5] === "") {
    110             rnd = Math.random() * nm25.length | 0;
    111         }
    112         nMs = nm25[rnd] + nm28[rnd2] + nm27[rnd5];
    113     } else {
    114         rnd3 = Math.random() * nm26.length | 0;
    115         rnd4 = Math.random() * nm19.length | 0;
    116         if (nTp < 4) {
    117             while (nm26[rnd3] === nm25[rnd] || nm26[rnd3] === nm27[rnd5]) {
    118                 rnd3 = Math.random() * nm26.length | 0;
    119             }
    120             nMs = nm25[rnd] + nm28[rnd2] + nm26[rnd3] + nm19[rnd4] + nm27[rnd5];
    121         } else {
    122             rnd3 = Math.random() * nm29.length | 0;
    123             rnd6 = Math.random() * nm29.length | 0;
    124             rnd7 = Math.random() * nm19.length | 0;
    125             while (nm29[rnd6] === nm29[rnd3]) {
    126                 rnd6 = Math.random() * nm29.length | 0;
    127             }
    128             nMs = nm28[rnd2] + nm29[rnd3] + nm19[rnd4] + nm29[rnd6] + nm19[rnd7];
    129         }
    130     }
    131     testSwear(nMs);
    132 }