Template:IGEM Kyoto/game/js

From OpenWetWare
Jump to navigationJump to search

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

   function game_start()
   {
       setTimeout("game_menu_fadeout()",0);
       setTimeout("game_menu_return()",300);
       setTimeout("game_open()",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_open(){
       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);
   }

</script> </html>