[svn r39] add icon + manage message
This commit is contained in:
parent
de9ae97e94
commit
82496dc3f6
|
@ -14,5 +14,5 @@ div.new_year_count_css
|
|||
{
|
||||
text-align:center;
|
||||
color:red;
|
||||
font-size:500px;
|
||||
font-size:250px;
|
||||
}
|
||||
|
|
26
newyear.js
26
newyear.js
|
@ -47,16 +47,34 @@ function Pause(time)
|
|||
/*Get controls*/
|
||||
var new_year_text = document.getElementById("new_year_text");
|
||||
var new_year_count = document.getElementById("new_year_count");
|
||||
var next_year_val = new Date().getFullYear() + 1;
|
||||
var next_year = new Date("01/01/" + next_year_val + " 00:00:00");
|
||||
var next_year_val;
|
||||
var next_year;
|
||||
var coef=1000;
|
||||
function calcNextYear()
|
||||
{
|
||||
next_year_val = new Date().getFullYear() + 1;
|
||||
next_year = new Date("01/01/" + next_year_val + " 00:00:00");
|
||||
}
|
||||
|
||||
function CountDown()
|
||||
{
|
||||
/*Init years*/
|
||||
var now = new Date();
|
||||
new_year_count.innerHTML = Math.round((next_year.getTime() - now.getTime()) / coef) + " s";
|
||||
setTimeout("CountDown()",100);
|
||||
var countdown = Math.round((next_year.getTime() - now.getTime()) / coef);
|
||||
if(countdown < 1 )
|
||||
{
|
||||
new_year_count.innerHTML = "BONNE ANNE !! YOUPI";
|
||||
if(countdown > -60)
|
||||
{
|
||||
calcNextYear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
new_year_count.innerHTML = countdown + " s";
|
||||
}
|
||||
setTimeout("CountDown()",250);
|
||||
}
|
||||
|
||||
calcNextYear();
|
||||
CountDown();
|
Loading…
Reference in New Issue