103 for(var theme in themes) |
103 for(var theme in themes) |
104 { |
104 { |
105 sel.appendChild(opt.cloneNode(true)); |
105 sel.appendChild(opt.cloneNode(true)); |
106 sel.lastChild.value = theme; |
106 sel.lastChild.value = theme; |
107 sel.lastChild.lastChild.data = theme; |
107 sel.lastChild.lastChild.data = theme; |
108 if(theme == "Nature") sel.lastChild.selected = true; |
108 if(theme === "Nature") sel.lastChild.selected = true; |
109 } |
109 } |
110 var chk = document.createElement("input"); |
110 var chk = document.createElement("input"); |
111 chk.type = "checkbox"; |
111 chk.type = "checkbox"; |
112 chk.onclick = switchAnim; |
112 chk.onclick = switchAnim; |
113 document.body.appendChild(chk); |
113 document.body.appendChild(chk); |
114 chk = chk.cloneNode(false); |
114 chk = chk.cloneNode(false); |
115 chk.onclick = hideGirders; |
115 chk.onclick = hideGirders; |
116 document.body.appendChild(chk); |
116 document.body.appendChild(chk); |
117 var s = document.styleSheets[0].cssRules; |
117 var s = document.styleSheets[0].cssRules; |
118 for(var i=0;i<s.length;i++) |
118 for(var i=0;i<s.length;i++) |
119 if (s[i].selectorText.toLowerCase()==".girder") girder = s[i]; |
119 if (s[i].selectorText.toLowerCase() === ".girder") girder = s[i]; |
120 |
120 |
121 var a = document.createElement("a"); |
121 var a = document.createElement("a"); |
122 var g = document.createElement("div"); |
122 var g = document.createElement("div"); |
123 g.className="girder"; |
123 g.className="girder"; |
124 a.appendChild(document.createElement("div")); |
124 a.appendChild(document.createElement("div")); |
129 h.href = "//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
129 h.href = "//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
130 h.lastChild.style.backgroundImage = 'url("'+h.href+'")'; |
130 h.lastChild.style.backgroundImage = 'url("'+h.href+'")'; |
131 h.lastChild.lastChild.data = masks[i]; |
131 h.lastChild.lastChild.data = masks[i]; |
132 h.title = masks[i]; |
132 h.title = masks[i]; |
133 h.idle = Math.floor(Math.random()*19); |
133 h.idle = Math.floor(Math.random()*19); |
134 if (i%17==16 || i==masks.length-1) document.body.appendChild(g.cloneNode(false)); |
134 if (i%17 === 16 || i === masks.length-1) document.body.appendChild(g.cloneNode(false)); |
135 } |
135 } |
136 |
136 |
137 /* quick and dirty animation */ |
137 /* quick and dirty animation */ |
138 animationInterval = setInterval(animateHogs, 128); |
138 animationInterval = setInterval(animateHogs, 128); |
139 } |
139 } |