You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
938 B
31 lines
938 B
console.log('scripts loaded');
|
|
document.onreadystatechange = function(event) {
|
|
if (document.readyState === "complete") {
|
|
if(document.getElementById('pourcent-reveil'))
|
|
{
|
|
setcurrentprogress(document.getElementById('pourcent-reveil'),5);
|
|
updateprogress(document.getElementById('pourcent-reveil'),5);
|
|
}
|
|
}
|
|
}
|
|
|
|
function setcurrentprogress(obj,value)
|
|
{
|
|
obj.setAttribute("value",value);
|
|
obj.setAttribute("aria-valuenow",value);
|
|
}
|
|
|
|
function updateprogress(obj, step=5)
|
|
{
|
|
currentprogress = parseInt(obj.getAttribute("value")) + step;
|
|
if(currentprogress >= 100)
|
|
{
|
|
console.log("finished");
|
|
setcurrentprogress(obj,100);
|
|
document.getElementById("finished").setAttribute("style","");
|
|
return;
|
|
}
|
|
console.log("updateprogress to "+currentprogress);
|
|
setcurrentprogress(obj,currentprogress);
|
|
setTimeout(updateprogress, 500, obj);
|
|
} |