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

narniaMoles.js (2103B)


      1 function nameGen() {
      2     var nm1 = ["aloe", "anise", "apple", "aster", "beet", "bloom", "blossom", "breeze", "butter", "cabbage", "carrot", "cherry", "clover", "cluster", "coco", "cocoa", "comet", "cotton", "crocus", "daisy", "feather", "fern", "flake", "flannel", "flora", "floral", "flower", "fluff", "fluffy", "garden", "gilly", "gravel", "grotto", "grove", "herb", "holly", "iris", "jewel", "jute", "laurel", "lemon", "lilac", "lily", "lotus", "mango", "marble", "melon", "mistle", "moss", "myrtle", "nugget", "onion", "orchid", "parsnip", "pebble", "pepper", "petal", "plume", "poppy", "prim", "puff", "pumpkin", "quill", "radish", "ribbon", "rose", "shell", "shrub", "thistle", "truffle", "tuber", "tulip", "tumble", "turnip", "veggie", "vine", "violet", "whisper", "wool"];
      3     var nm2 = ["ball", "bead", "blanket", "bloom", "bow", "brim", "bud", "bump", "cap", "cloak", "clog", "coat", "comb", "cup", "drape", "feet", "fig", "flake", "flint", "fluff", "foot", "frill", "gem", "glove", "gloves", "glow", "hat", "hoop", "leaf", "lid", "lock", "lump", "mask", "mitt", "mitten", "moss", "plume", "puff", "rout", "sash", "scarf", "scarfs", "shawl", "shell", "shoe", "shoes", "shrub", "sock", "socks", "stem", "stone", "straw", "tie", "web", "wig", "wrap"];
      4     var br = "";
      5     $('#placeholder').css('textTransform', 'capitalize');
      6     var element = document.createElement("div");
      7     element.setAttribute("id", "result");
      8     for (i = 0; i < 10; i++) {
      9         rnd = Math.random() * nm1.length | 0;
     10         rnd2 = Math.random() * nm2.length | 0;
     11         while (nm1[rnd] === nm2[rnd2]) {
     12             rnd2 = Math.random() * nm2.length | 0;
     13         }
     14         names = nm1[rnd] + nm2[rnd2];
     15         nm1.splice(rnd, 1);
     16         nm2.splice(rnd2, 1);
     17         br = document.createElement('br');
     18         element.appendChild(document.createTextNode(names));
     19         element.appendChild(br);
     20     }
     21     if (document.getElementById("result")) {
     22         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     23     }
     24     document.getElementById("placeholder").appendChild(element);
     25 }