galaxyNames.js (4681B)
1 var nm1 = ["Alpha", "Apus", "Aquila", "Ara", "Beta", "Canis", "Carina", "Comae", "Corona", "Crux", "Delta", "Draco", "Epsilon", "Gamma", "Lambda", "Lyra", "Nemo", "Omega", "Omicron", "Pavo", "Proxima", "Sagitta", "Serpens", "Sigma", "Theta", "Upsilon", "Ursa", "Vela", "Virgo", "Zeta", "", "", "", "", "", ""]; 2 var nm2 = ["Acallaris", "Achelois", "Adastreia", "Aegialeus", "Aegimius", "Alatheia", "Alcyoneus", "Aldebaran", "Amphiaraus", "Anadeia", "Andromeda", "Aquarii", "Arcturus", "Aristaeus", "Asteria", "Asteropaios", "Astraeus", "Aurigae", "Boreas", "Borysthenis", "Calesius", "Capella", "Cassiopeia", "Centauri", "Centaurus", "Chronos", "Cymopoleia", "Dioscuri", "Draconis", "Eioneus", "Eridani", "Eridanus", "Eubuleus", "Euphorion", "Eusebeia", "Euthenia", "Hemithea", "Hyperbius", "Hyperes", "Hyperion", "Icarius", "Ichnaea", "Ilioneus", "Kentaurus", "Leporis", "Librae", "Lyrae", "Majoris", "Miriandynus", "Myrmidon", "Nebula", "Nemesis", "Odysseus", "Ophiuchi", "Orion", "Orionis", "Orithyia", "Palioxis", "Peleus", "Perileos", "Perseus", "Phoroneus", "Polystratus", "Porphyrion", "Proioxis", "Sagittarius", "Sirius", "Solymus", "Zagreus", "Zephyrus"]; 3 var nm3 = ["Abyss", "Acorn", "Arrowhead", "Banana", "Beansprout", "Beanstalk", "Bell", "Blue Ribbon", "Blueberry", "Bottleneck", "Bowl", "Bull's Eye", "Bullet", "Butterfly", "Cat's Ear", "Cat's Eye", "Catterpillar", "Cherry", "Chickpea", "Clover", "Coconut", "Comet", "Crescent", "Crow's Feet", "Crown", "Dandelion", "Diamond", "Dragontooth", "Droplet", "Eagle Claw", "Eggshell", "Exploding", "Eyebrow", "Eyelash", "Falling", "Feather", "Fern Leaf", "Fingerprint", "Fisheye", "Fishscale", "Flame", "Football", "Grain", "Halo", "Heart", "Horseshoe", "Hurricane", "Icicle", "Iris", "Jellyfish", "Kettle", "Leaf", "Lemon", "Lightbulb", "Lilypad", "Lion's Mane", "Lion's Tail", "Maelstrom", "Meridian", "Mosaic", "Mouse", "Octopus", "Oculus", "Onion", "Owl Head", "Pear", "Pepper", "Pig's Tail", "Pinecone", "Ponytail", "Potato", "Red Ribbon", "Rippled", "Rose Petal", "Sawblade", "Seashell", "Serpent", "Serpent's Eye", "Sharkfin", "Sharktooth", "Shield", "Shooting Star", "Snail Shell", "Snowflake", "Soap Bubble", "Sparrow", "Spearpoint", "Spiderleg", "Spiderweb", "Spiral", "Starfish", "Strawberry", "Teacup", "Tiara", "Tiger Paw", "Tree Root", "Tree Trunk", "Turtle Shell", "Vortex", "Wave", "Whale's Tail", "Zodiac"]; 4 var nm4 = ["Nebula", "Galaxy", "Cloud", "Star System"]; 5 var nm5 = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ""]; 6 var nm6 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ""]; 7 8 function nameGen() { 9 $('#placeholder').css('textTransform', 'capitalize'); 10 var br = ""; 11 var element = document.createElement("div"); 12 element.setAttribute("id", "result"); 13 for (i = 0; i < 10; i++) { 14 if (i < 3) { 15 rnd = Math.floor(Math.random() * nm1.length); 16 rnd2 = Math.floor(Math.random() * nm2.length); 17 names = nm1[rnd] + " " + nm2[rnd2]; 18 } else if (i < 5) { 19 rnd = Math.floor(Math.random() * nm2.length); 20 rnd2 = Math.floor(Math.random() * nm4.length); 21 names = nm2[rnd] + " " + nm4[rnd2]; 22 } else if (i < 8) { 23 rnd = Math.floor(Math.random() * nm3.length); 24 rnd2 = Math.floor(Math.random() * nm4.length); 25 names = nm3[rnd] + " " + nm4[rnd2]; 26 } else if (i < 9) { 27 rnd = Math.floor(Math.random() * nm5.length); 28 rnd2 = Math.floor(Math.random() * nm5.length); 29 rnd3 = Math.floor(Math.random() * nm6.length); 30 rnd4 = Math.floor(Math.random() * nm6.length); 31 rnd5 = Math.floor(Math.random() * nm6.length); 32 names = nm5[rnd] + nm5[rnd2] + "-" + nm6[rnd3] + nm6[rnd4] + nm6[rnd5]; 33 } else { 34 rnd = Math.floor(Math.random() * nm5.length); 35 rnd2 = Math.floor(Math.random() * nm5.length); 36 rnd3 = Math.floor(Math.random() * nm5.length); 37 rnd4 = Math.floor(Math.random() * nm6.length); 38 rnd5 = Math.floor(Math.random() * nm6.length); 39 rnd6 = Math.floor(Math.random() * nm5.length); 40 names = nm5[rnd] + nm5[rnd2] + nm5[rnd3] + " " + nm6[rnd4] + nm6[rnd5] + nm5[rnd5]; 41 } 42 br = document.createElement('br'); 43 element.appendChild(document.createTextNode(names)); 44 element.appendChild(br); 45 } 46 if (document.getElementById("result")) { 47 document.getElementById("placeholder").removeChild(document.getElementById("result")); 48 } 49 document.getElementById("placeholder").appendChild(element); 50 }