awardNames.js (3858B)
1 function nameGen() { 2 var nm1 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Acclaimed", "Adept", "Arcane", "Artistic", "Aurora", "Austere", "Bold", "Brass", "Bravery", "Bright", "Brilliant", "Candid", "Children's", "Clever", "Comfort", "Complexity", "Confusion", "Convention", "Crafty", "Creation", "Creative", "Critic", "Critics'", "Crystal", "Dapper", "Defiant", "Diamond", "Discovery", "Discretion", "Dual", "Duality", "Earnesty", "Education", "Elegance", "Elegant", "Elementary", "Enchanted", "Enlightened", "Ethic", "Exalted", "Excellence", "Experience", "Expert", "Expertise", "Fantasy", "Fashion", "Flawless", "Fragrant", "Free", "Future", "Gentle", "Golden", "Graceful", "Gracious", "Grand", "Guardian", "Handy", "Harmony", "Health", "Healthy", "Honest", "Honesty", "Honor", "Honored", "Humane", "Humanity", "Humble", "Imagination", "Impossible", "Incredible", "Independent", "Infinity", "Informed", "Innocence", "Intelligence", "Intelligent", "International", "Intrepid", "Jade", "Jubilant", "Knowledge", "Life", "Light", "Literary", "Logic", "Loyalty", "Luminous", "Luna", "Lunar", "Magic", "Majestic", "Majesty", "Medicine", "Melody", "Merry", "Miniature", "Motion", "Mysterious", "Mystery", "National", "Natural", "Nature", "Neo", "New", "Novel", "Novice", "Passion", "Peace", "People's", "Pointless", "Possibility", "Power", "Perseverance", "Prime", "Public's", "Regal", "Ruby", "Sanity", "Sapphire", "Science", "Short", "Silk", "Silver", "Solar", "Soul", "Stellar", "Style", "Stylish", "Superior", "Sympathy", "Teen", "Terror", "Truth", "Twin", "Unity", "Unsung", "Velvet", "Vigilant", "Virtuous", "Warped", "Wisdom", "Wise", "Young"]; 3 var nm2 = ["Act", "Actor", "Performance", "Performer", "Answer", "Art", "Atom", "Badge", "Balloon", "Band", "Bear", "Bell", "Bird", "Book", "Camera", "Canvas", "Chance", "Change", "Cherry", "Choice", "Clover", "Comet", "Cord", "Creator", "Crown", "Curtain", "Cushion", "Dance", "Design", "Droplet", "Eagle", "Education", "Engine", "Example", "Eye", "Fan", "Feather", "Film", "Fingerprint", "Flame", "Flower", "Footprint", "Globe", "Glove", "Halo", "Hammer", "Heart", "Hero", "Horse", "Image", "Impulse", "Instrument", "Invention", "Iris", "Jewel", "Ladybug", "Laugh", "Leaf", "Lion", "Locket", "Machine", "Mark", "Mask", "Melody", "Monkey", "Moon", "Mouse", "Music", "Owl", "Palm", "Performance", "Press", "Print", "Pulse", "Question", "Question Mark", "Quill", "Quiver", "Record", "Ribbon", "Smile", "Snail", "Song", "Spade", "Star", "Sun", "Taste", "Theory", "Throne", "Tune", "Veil", "Wand", "Wing"]; 4 var nm3 = ["", "", "", "", "", "Accolade", "Award", "Award", "Award", "Award", "Award", "Award", "Award", "Award", "Award", "Award", "Grant", "Hall of Fame", "Hall of Fame Award", "Prize", "Prize for Quality", "Quality Award", "Trophy", "of the Year"]; 5 var br = ""; 6 $('#placeholder').css('textTransform', 'capitalize'); 7 var element = document.createElement("div"); 8 element.setAttribute("id", "result"); 9 for (i = 0; i < 10; i++) { 10 rnd = Math.floor(Math.random() * nm1.length); 11 rnd2 = Math.floor(Math.random() * nm2.length); 12 rnd3 = Math.floor(Math.random() * nm3.length); 13 if (nm1[rnd] === "") { 14 while (rnd3 < 5) { 15 rnd3 = Math.floor(Math.random() * nm3.length); 16 } 17 } 18 names = "The " + nm1[rnd] + " " + nm2[rnd2] + " " + nm3[rnd3]; 19 nm1.splice(rnd, 1); 20 nm2.splice(rnd2, 1); 21 br = document.createElement('br'); 22 element.appendChild(document.createTextNode(names)); 23 element.appendChild(br); 24 } 25 if (document.getElementById("result")) { 26 document.getElementById("placeholder").removeChild(document.getElementById("result")); 27 } 28 document.getElementById("placeholder").appendChild(element); 29 }