Template:IGEM Kyoto/game/js: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 26: Line 26:
         menubase.style.top="-480px";
         menubase.style.top="-480px";
     }
     }
     function game_fadein(){
     function game_fadein()
    {
         var gamebase=document.getElementById("kyoto-game-base");
         var gamebase=document.getElementById("kyoto-game-base");
         var top = -480;
         var top = -480;
Line 67: Line 68:
     }
     }


  fuction game_start()
    fuction game_start()
  {
    {
         var a;
         var a;
  }
    }
 
 
 
 
</script>
</script>
</html>
</html>

Revision as of 06:36, 4 March 2015

<html> <script type="text/javascript">

   function game_open()
   {
       var gamebase=document.getElementById("kyoto-game-base");
       gamebase.style.opacity=1.0;
       setTimeout("game_menu_fadeout()",0);
       setTimeout("game_menu_return()",300);
       setTimeout("game_fadein()",300);
   }
   function game_menu_fadeout()
   {
       var menubase=document.getElementById("kyoto-menu-base");
       var opa = 1.0;
       var id = setInterval(function() {
           menubase.style.opacity = opa;
           opa+=-0.2;
           if(opa < 0) {
               clearInterval(id);
           }
       }, 60);
   }
   function game_menu_return()
   {
       var menubase=document.getElementById("kyoto-menu-base");
       menubase.style.top="-480px";
   }
   function game_fadein()
   {
       var gamebase=document.getElementById("kyoto-game-base");
       var top = -480;
       var t=0;
       var id = setInterval(function() {
           gamebase.style.top = top + "px";
           t+=1;
           top=-0.09375*(t-80)*(t-80)+120;
           if(t > 80) {
               clearInterval(id);
           }
       }, 12.5);
   }
   function game_close()
   {
       setTimeout("game_fadeout()",0);
       setTimeout("game_return()",300);
   }
   function game_fadeout()
   {
       var back=document.getElementById("kyoto-menu-background");
       var gamebase=document.getElementById("kyoto-game-base");
       var opa = 1.0;
       var id = setInterval(function() {
           back.style.opacity = opa;
           gamebase.style.opacity = opa;
           opa+=-0.2;
           if(opa < 0) {
               clearInterval(id);
           }
       }, 60);
   }
   function game_return()
   {
       var back=document.getElementById("kyoto-menu-background");
       var gamebase=document.getElementById("kyoto-game-base");
       back.style.height="0%";
       gamebase.style.top="-480px";
   }
   fuction game_start()
   {
       var a;
   }

</script> </html>