Team:OUC-China

From 2012.igem.org

(Difference between revisions)
Line 19: Line 19:
   margin-top:330px;
   margin-top:330px;
}
}
 +
.center{margin-top:60px;font-family:arial;font-size:1em;font-weight:bold;color:#00FF00;}
 +
.right{text-align:right;font-family:arial;font-size:1em;font-weight:bold;}
</style>
</style>
-
<script language="JavaScript">
+
<script>
-
var now = new Date();
+
var endtimes=new Array();
-
function GetServerTime()
+
endtimes[0]="4/6/2012 9:03:00";
-
{
+
var nowtimes;
-
var urodz = new Date("03/01/2012 23:59:59");
+
function givetime(){
-
now.setTime(now.getTime()+250);
+
nowtimes=new Date("4/6/2010 9:03:00");
-
days = (urodz - now) / 1000 / 60 / 60 / 24;
+
window.setTimeout("DownCount()",1000)
-
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;
+
}
}
-
setInterval("GetServerTime()",250);
+
function DownCount(){
-
</script><p><span>we only have</span><span id="date"></span><span class="white14b">days</span><span id="time"></span>
+
nowtimes=Number(nowtimes)+1000;
 +
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:70px;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:20, 29 February 2012

We only have:


Thanks to zhihu