narniaOwls.js (1885B)
1 var nm2 = ["beak", "belly", "bill", "breast", "claw", "crest", "crown", "eye", "eyes", "feather", "head", "mantle", "plume", "tail", "talon", "wing", "wings"]; 2 3 function nameGen(type) { 4 var nm1 = ["arch", "band", "beam", "bell", "bend", "bleak", "bold", "brash", "brass", "cave", "cloud", "clue", "cold", "cream", "dark", "dawn", "dim", "dirt", "dive", "draft", "dusk", "dust", "edge", "fan", "flame", "flight", "flock", "flow", "fluke", "fog", "force", "frost", "ghost", "gift", "glass", "glim", "glint", "gloom", "glow", "glum", "gold", "grace", "grand", "great", "grim", "hex", "high", "hook", "ice", "ink", "iron", "light", "lock", "lone", "long", "loud", "lush", "mad", "mass", "mist", "moon", "mud", "murk", "night", "pale", "perk", "phantom", "phase", "plume", "plump", "prime", "quick", "quill", "rain", "rash", "shade", "shadow", "silk", "silver", "sky", "slim", "smoke", "soot", "spirit", "spite", "spot", "star", "steel", "storm", "stout", "sun", "thick", "thorn", "thrift", "thunder", "tranquil", "trim", "veil", "vex", "wild", "woe"]; 5 var br = ""; 6 $('#placeholder').css('textTransform', 'capitalize'); 7 var tp = type; 8 var element = document.createElement("div"); 9 element.setAttribute("id", "result"); 10 for (i = 0; i < 10; i++) { 11 rnd = Math.random() * nm1.length | 0; 12 rnd2 = Math.random() * nm2.length | 0; 13 while (nm1[rnd] === nm2[rnd2]) { 14 rnd2 = Math.random() * nm2.length | 0; 15 } 16 names = nm1[rnd] + nm2[rnd2]; 17 nm1.splice(rnd, 1); 18 br = document.createElement('br'); 19 element.appendChild(document.createTextNode(names)); 20 element.appendChild(br); 21 } 22 if (document.getElementById("result")) { 23 document.getElementById("placeholder").removeChild(document.getElementById("result")); 24 } 25 document.getElementById("placeholder").appendChild(element); 26 }