DIR : /home/kozerus/public_html/jkwii/js/jsdoit/hndsigns/index.js

/home/kozerus/public_html/jkwii/js/jsdoit/hndsigns

// forked from jsdo.it_team's "第一回全国統一 HTML5実技コンテスト エントリー用コード" http://jsdo.it/jsdo.it_team/esTj

//初期化

var pc=1;
var my;
var point=0;
var img=new Array();
img[0] ='http://jsrun.it/assets/s/u/Q/i/suQix.png';
img[1] ='http://jsrun.it/assets/o/i/u/X/oiuXy.png';
img[2] ='http://jsrun.it/assets/9/Q/e/5/9Qe5M.png'; 

//メインプログラム
var frame=0;
var TimerId=setInterval(anime,2000);
function anime(){
    frame++;
    if(frame<0){startup();}
    else if(frame<=30){run();}else{end();}
}

//動作中
function run(){	
    my=Math.floor(Math.random()*3);
 	$style('me').backgroundImage='url('+img[my]+')';
 	if(pc===my)point++;
 	$('me').innerHTML=point;
    $('frame').innerHTML=30-frame+'sec';
}

//終了
function end(){	
    clearInterval(TimerId);
    $style('gu').opacity=$style('choki').opacity=$style('pa').opacity=$style('frame').opacity=0.1;
    $style('shadow').opacity=0;
    $style('me').webkitTransform="scale(1,1.3)";
    $style('me').top="500px"; 
    $style('me').left="100px"; 
    $style('me').textAlign='center';
    $style('me').fontSize='50px';
    $('me').innerHTML='got<br>'+point+'!';
}

//諸々関数
function gu(){
    pc=0;
    $style('me').left="0px";		$style('me').top="500px";	
    $style('shadow').left="4px";	$style('shadow').top="508px";
}

function choki(){
    pc=1;
    $style('me').left="100px";		$style('me').top="550px";
    $style('shadow').left="100px";	$style('shadow').top="558px";
}

function pa(){
    pc=2;
    $style('me').left="200px";		$style('me').top="500px";
    $style('shadow').left="196px";	$style('shadow').top="508px";
}

function $(id){return document.getElementById(id);}
function $style(id){return document.getElementById(id).style;}

//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer