misc/hats_js_anim.xhtml
changeset 11877 95a3041aadb9
parent 6936 8af2bf10ee62
child 12927 9400a272c88f
equal deleted inserted replaced
11876:ed98962b45c0 11877:95a3041aadb9
     6 
     6 
     7     <style type="text/css">
     7     <style type="text/css">
     8 * {padding: 0; margin: 0; }
     8 * {padding: 0; margin: 0; }
     9 body 
     9 body 
    10 {
    10 {
    11     background: url('http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Sky.png') fixed no-repeat bottom left;
    11     background: url('//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Sky.png') fixed no-repeat bottom left;
    12     -moz-background-size: 200%;
    12     -moz-background-size: 200%;
    13     background-size: 100% 100%;
    13     background-size: 100% 100%;
    14     font-family: sans-serif;
    14     font-family: sans-serif;
    15 }
    15 }
    16 h1 { text-shadow: 0 0 2px white; }
    16 h1 { text-shadow: 0 0 2px white; }
    20     margin-left: 20px;
    20     margin-left: 20px;
    21     float: left;
    21     float: left;
    22     height: 32px;
    22     height: 32px;
    23     width: 32px;
    23     width: 32px;
    24     color: transparent;
    24     color: transparent;
    25     background-image: url("http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/Hedgehog/Idle.png");
    25     background-image: url("//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hedgehog/Idle.png");
    26 }
    26 }
    27 .girder
    27 .girder
    28 {
    28 {
    29     width: 100%;
    29     width: 100%;
    30     height: 30px;
    30     height: 30px;
    31     clear: left;
    31     clear: left;
    32     background-image: url('http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Girder.png');
    32     background-image: url('//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Girder.png');
    33     background-repeat: repeat-x;
    33     background-repeat: repeat-x;
    34 }
    34 }
    35 .hide { visibility: hidden; }
    35 .hide { visibility: hidden; }
    36 a div
    36 a div
    37 {
    37 {
    80 var girder;
    80 var girder;
    81 var animationInterval;
    81 var animationInterval;
    82 window.onload = function()
    82 window.onload = function()
    83 {
    83 {
    84     var xml=new XMLHttpRequest();
    84     var xml=new XMLHttpRequest();
    85     xml.open("GET", "/hg/share/hedgewars/Data/Graphics/Hats/", false);
    85     xml.open("GET", "/hedgewars/file/tip/share/hedgewars/Data/Graphics/Hats/", false);
    86     xml.send(null);
    86     xml.send(null);
    87     /*var resp = xml.responseXML; unfortunately not served as XHTML
    87     /*var resp = xml.responseXML; unfortunately not served as XHTML
    88     var a = resp.getElementsByTagName("a");
    88     var a = resp.getElementsByTagName("a");
    89     for(var i=0;i<a.length;i++);
    89     for(var i=0;i<a.length;i++);
    90         if (/\.png/.test(a[0].href)) m.push(a[0].replace(/.png/,''));*/
    90         if (/\.png/.test(a[0].href)) m.push(a[0].replace(/.png/,''));*/
   124     a.appendChild(document.createElement("div"));
   124     a.appendChild(document.createElement("div"));
   125     a.lastChild.appendChild(document.createTextNode(""));
   125     a.lastChild.appendChild(document.createTextNode(""));
   126     for (var i=0;i<masks.length;i++)
   126     for (var i=0;i<masks.length;i++)
   127     {
   127     {
   128         var h = document.body.appendChild(a.cloneNode(true));
   128         var h = document.body.appendChild(a.cloneNode(true));
   129         h.href = "http://hedgewars.googlecode.com/hg/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));
   171     
   171     
   172 }
   172 }
   173 
   173 
   174 function switchTheme()
   174 function switchTheme()
   175 {
   175 {
   176     document.body.style.backgroundImage='url("http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/'+this.value+'/Sky.png")';
   176     document.body.style.backgroundImage='url("//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/'+this.value+'/Sky.png")';
   177     if (themes[this.value])
   177     if (themes[this.value])
   178         girder.style.backgroundImage='url("http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/'+this.value+'/Girder.png")';
   178         girder.style.backgroundImage='url("//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/'+this.value+'/Girder.png")';
   179     else
   179     else
   180         girder.style.backgroundImage='url("http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/Girder.png")';
   180         girder.style.backgroundImage='url("//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Girder.png")';
   181 }
   181 }
   182 //]]>
   182 //]]>
   183     </script>
   183     </script>
   184 </head>
   184 </head>
   185 <body>
   185 <body>