Team:OUC-China

From 2012.igem.org

(Difference between revisions)
Line 22: Line 22:
.right{text-align:right;font-family:arial;font-size:1em;font-weight:bold;}
.right{text-align:right;font-family:arial;font-size:1em;font-weight:bold;}
</style>
</style>
-
<script>
+
<script language=JavaScript>
-
var endtimes=new Array();
+
var now = new Date();
-
endtimes[0]="4/6/2012 9:03:00";
+
function GetServerTime()
-
var nowtimes;
+
{
-
function givetime(){
+
var urodz = new Date("03/01/2012 23:59:59");
-
nowtimes=new Date("4/6/2010 9:03:00");
+
now.setTime(now.getTime()+250);
-
window.setTimeout("DownCount()",1000)
+
days = (urodz - now) / 1000 / 60 / 60 / 24;
 +
daysRound = Math.floor(days);
 +
hours = (urodz - now) / 1000 / 60 / 60 - (24 * daysRound);
 +
hoursRound = Math.floor(hours);
 +
minutes = (urodz - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
 +
minutesRound = Math.floor(minutes);
 +
seconds = (urodz - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
 +
secondsRound = Math.round(seconds);
 +
document.getElementById("date").innerHTML = daysRound;
 +
document.getElementById("time").innerHTML = hoursRound + ":" + minutesRound + ":" + secondsRound;
}
}
-
function DownCount(){
+
setInterval("GetServerTime()",250);
-
nowtimes=Number(nowtimes)+1000;
+
</script><p><span>we only have</span><span id="date"></span><span class="white14b">days</span><span id="time"></span>
-
for(var i=0;i<=0;i++)
+
-
{
+
-
var theDay=new Date(endtimes[i]);
+
-
theDay=theDay++;
+
-
if(theDay<=nowtimes)
+
-
{
+
-
document.getElementById("times"+i).innerHTML = "00小时,00分钟,00秒";
+
-
}
+
-
else{
+
-
timechange(theDay,i);
+
-
+
-
}
+
-
}
+
-
window.setTimeout("DownCount()",1000)
+
-
}
+
-
function timechange(theDay,i){
+
-
var theDays=new Date(theDay);
+
-
var seconds = (theDays - nowtimes)/1000;
+
-
var minutes = Math.floor(seconds/60);
+
-
var hours = Math.floor(minutes/60);
+
-
var days = Math.floor(hours/24);
+
-
var CDay= days;
+
-
var CHour= hours % 24;
+
-
var CMinute= minutes % 60;
+
-
var CSecond= seconds % 60;
+
-
var CHour=CHour+CDay*24;
+
-
if(CMinute<10)
+
-
{
+
-
CMinute="0"+CMinute;
+
-
}
+
-
if(CHour<10)
+
-
{
+
-
CHour="0"+CHour;
+
-
}
+
-
if(CSecond<10)
+
-
{
+
-
CSecond="0"+CSecond;
+
-
}
+
-
document.getElementById("times"+i).innerHTML = CHour + "hours," + CMinute + "minutes," + CSecond + "seconds";
+
-
}
+
-
</script>  
+
-
<body>
+
-
    <img style="margin-left:400px;margin-top:150px;" src="https://static.igem.org/mediawiki/2012/0/03/OUC-China.ready.png"/>
+
-
<body onload="givetime()">  
+
-
<p class="center">We only have:<div style="color:#00FF00;margin-top:60px;margin-left:460px;font-size:2em;" id="times0"></div></p>
+
<hr>
<hr>
<p class="right">Thanks to zhihu</p>
<p class="right">Thanks to zhihu</p>
</body>
</body>
</html>
</html>

Revision as of 15:11, 29 February 2012

we only havedays


Thanks to zhihu