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

rsNaragi.js (2222B)


      1 var nm1 = ["", "", "", "d", "g", "h", "m", "n", "r", "v", "z"];
      2 var nm2 = ["aa", "ai", "a", "u", "a", "u", "o", "e", "i"];
      3 var nm3 = ["g", "j", "m", "n", "r", "rr", "t", "tt", "th", "v", "z"];
      4 var nm4 = ["i", "i", "u", "a", "i", "i", "u", "a", "o", "e"];
      5 var nm5 = ["d", "g", "k", "n", "t", "x"];
      6 var nm6 = ["", "", "", "", "c", "ch", "d", "fr", "h", "k", "l", "n", "r", "rh", "sh", "th", "v", "y"];
      7 var nm7 = ["ai", "aa", "a", "a", "a", "o", "e", "a", "a", "a", "o", "e"];
      8 var nm8 = ["d", "g", "j", "k", "n", "r", "v", "z"];
      9 var nm9 = ["a", "e", "i", "i", "i"];
     10 var nm10 = ["g", "h", "l", "n", "r", "z"];
     11 var br = "";
     12 
     13 function nameGen(type) {
     14     $('#placeholder').css('textTransform', 'capitalize');
     15     var tp = type;
     16     var element = document.createElement("div");
     17     element.setAttribute("id", "result");
     18     for (i = 0; i < 10; i++) {
     19         if (tp === 1) {
     20             nameFem();
     21             while (nMs === "") {
     22                 nameFem();
     23             }
     24         } else {
     25             nameMas();
     26             while (nMs === "") {
     27                 nameMas();
     28             }
     29         }
     30         br = document.createElement('br');
     31         element.appendChild(document.createTextNode(nMs));
     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 }
     39 
     40 function nameMas() {
     41     rnd = Math.random() * nm1.length | 0;
     42     rnd2 = Math.random() * nm2.length | 0;
     43     rnd3 = Math.random() * nm3.length | 0;
     44     rnd4 = Math.random() * nm4.length | 0;
     45     rnd5 = Math.random() * nm5.length | 0;
     46     nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     47     testSwear(nMs);
     48 }
     49 
     50 function nameFem() {
     51     nTp = Math.random() * 4 | 0;
     52     rnd = Math.random() * nm6.length | 0;
     53     rnd2 = Math.random() * nm7.length | 0;
     54     rnd3 = Math.random() * nm8.length | 0;
     55     if (nTp === 0) {
     56         rnd4 = Math.random() * nm9.length | 0;
     57         rnd5 = Math.random() * nm10.length | 0;
     58         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5] + "i";
     59     } else {
     60         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + "i";
     61     }
     62 }