Version 1.12
This commit is contained in:
parent
2a066a7498
commit
de31cd3e9a
1373 changed files with 156282 additions and 45238 deletions
126
htdocs/js/game.js
Normal file
126
htdocs/js/game.js
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
function hide(o)
|
||||
{
|
||||
p = o.parentNode.nextSibling;
|
||||
|
||||
if (p.style.display != 'none')
|
||||
{
|
||||
p.style.display ='none';
|
||||
o.style.backgroundPosition = '0 0';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
p.style.display ='block';
|
||||
o.style.backgroundPosition = '0 100%';
|
||||
}
|
||||
o.blur();
|
||||
}
|
||||
|
||||
function checkboxes(v)
|
||||
{
|
||||
for (i=1; document.getElementsByName('m'+i)[0]; i++)
|
||||
{
|
||||
document.getElementsByName('m'+i)[0].checked = v;
|
||||
}
|
||||
}
|
||||
|
||||
function checkboxesr(v)
|
||||
{
|
||||
for (i=1; document.getElementsByName('r'+i)[0]; i++)
|
||||
{
|
||||
document.getElementsByName('r'+i)[0].checked = v;
|
||||
}
|
||||
}
|
||||
|
||||
function max(i)
|
||||
{
|
||||
document.getElementsByName('v'+i)[0].value = document.getElementById('v_'+i).innerHTML;
|
||||
}
|
||||
|
||||
function vaisseaux(b)
|
||||
{
|
||||
for(i=0; i<=12; i++)
|
||||
{
|
||||
if (document.getElementById('v_'+i) && document.getElementsByName('v'+i)[0]) document.getElementsByName('v'+i)[0].value = b ? document.getElementById('v_'+i).innerHTML : '0';
|
||||
}
|
||||
}
|
||||
|
||||
function reste(t,c,tf) {
|
||||
|
||||
var r;
|
||||
if (t>0) {
|
||||
var heures = Math.floor(t / 3600);
|
||||
var minutes = Math.floor(((t / 3600) - Math.floor(t / 3600)) * 60);
|
||||
var secondes = t - ((Math.floor(t / 60)) * 60);
|
||||
heures = heures < 10 ? '0'+heures : heures;
|
||||
minutes = minutes < 10 ? '0'+minutes : minutes;
|
||||
secondes = secondes < 10 ? '0'+secondes : secondes;
|
||||
document.getElementById(c).innerHTML = heures + ":" + minutes + ":" + secondes;
|
||||
var restant = t - 1;
|
||||
if (tf) setTimeout("reste("+restant+",\""+c+"\", true)", 1000);
|
||||
}
|
||||
else {
|
||||
document.getElementById(c).innerHTML = "Terminé";
|
||||
setTimeout(window.document.location.reload(),3000);
|
||||
}
|
||||
}
|
||||
|
||||
function bind(funct)
|
||||
{
|
||||
var args = [];
|
||||
for(var i = 1; i < arguments.length; i++) args[args.length] = arguments[i];
|
||||
return function(){funct.apply(this,args)};
|
||||
}
|
||||
|
||||
function opacity(opacity)
|
||||
{
|
||||
this.style.opacity = opacity / 100;
|
||||
this.style.MozOpacity = opacity / 100;
|
||||
this.style.KhtmlOpacity = opacity / 100;
|
||||
this.style.filter = "alpha(opacity="+ opacity +")";
|
||||
}
|
||||
|
||||
function fadeIn(element,speed)
|
||||
{
|
||||
for(var i = 0; i <= 10; i++) setTimeout(bind(function(i){opacity.call(element,i*10)},i),i/10*speed);
|
||||
}
|
||||
|
||||
function fadeOut(element,speed)
|
||||
{
|
||||
for(var i = 0; i <= 10; i++) setTimeout(bind(function(i){opacity.call(element,i*10)},10-i),i/10*speed);
|
||||
}
|
||||
|
||||
var loop = function()
|
||||
{
|
||||
if(current > 0)
|
||||
{
|
||||
fadeOut(leftBanners[current],1000);
|
||||
current--;
|
||||
}
|
||||
else if(current == 0)
|
||||
{
|
||||
fadeIn(leftBanners[leftBanners.length - 1],1000);
|
||||
setTimeout(function()
|
||||
{
|
||||
for(var i = 1; i < leftBanners.length - 1; i++) opacity.call(leftBanners[i],100);
|
||||
|
||||
current = leftBanners.length - 1;
|
||||
|
||||
},1010);
|
||||
}
|
||||
else return;
|
||||
|
||||
setTimeout(loop,8000);
|
||||
}
|
||||
|
||||
window.onload = function()
|
||||
{
|
||||
banners = document.getElementById('banner').getElementsByTagName('div');
|
||||
|
||||
leftBanners = [];
|
||||
for(var i = 0; i < banners.length; i++) if(banners[i].getAttribute('class') == 'bannerleft') leftBanners.push(banners[i]);
|
||||
|
||||
current = leftBanners.length - 1;
|
||||
|
||||
if(leftBanners.length > 1) setTimeout(loop,8000);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue