Created
July 20, 2011 02:11
-
-
Save imaz/1094192 to your computer and use it in GitHub Desktop.
pomotimer作ってみた
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color:#ccffdd; | |
color:#000000; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-Type: text/html" charset="Shift_JIS"> | |
<title>pomodoro timer</title> | |
<link type="text/css" rel="stylesheet" href="./pomodoro.css"></script> | |
<script type="text/javascript" src="./pomodoro.js"></script> | |
<script language="JavaScript"> | |
<!----> | |
</script> | |
</head> | |
<body> | |
<span id="pomodoroStatus">停止中</span><br /> | |
<input type="button" value="StartTimer" onClick="startTimer()"><br /><br /> | |
(<span id="counter">0</span>+) <span id="resultCount">0</span><span id="message">ポモ</span> | |
<input type="button" value="PlusCount" onClick="plusCount()"><br /><br /> | |
<input type="button" value="MinusCount" onClick="minusCount()"><br /><br /> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showText(id,str){ | |
document.getElementById(id).innerHTML = str; | |
} | |
function getText(id){ | |
return(window.document.getElementById(id).innerHTML); | |
} | |
function textColoring(str,color); | |
var retText = "\<font style=\"color:"+color+"\"\>"+str+"\</font\>"; | |
return(retText); | |
} | |
function startTimer(){ | |
setTimeout("pomodoro()",1000*60*25); | |
showText("pomodoroStatus",textColoring("ポモ","red")+"なう"); | |
} | |
function pomodoro(){ | |
var cnt = getText("resultCount"); | |
cnt++; | |
showText("resultCount",cnt); | |
showText("message","ポモ完遂しました!"); | |
showText("pomodoroStatus","停止中"); | |
window.alert('25分経過しました。'); | |
} | |
function plusCount(){ | |
var cnt = getText("counter"); | |
cnt++; | |
showText("counter",cnt); | |
} | |
function minusCount(){ | |
var cnt = getText("counter"); | |
cnt--; | |
showText("counter",cnt); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment