loadImg.js 703 B

12345678910111213141516171819202122232425262728
  1. window.onload = function () {
  2. console.log("End expe " + END_EXPE)
  3. // only if not end of expe
  4. if (END_EXPE == "False"){
  5. setTimeout(function(){
  6. document.getElementById("expeImg").style.display = "inline";
  7. }, 500);
  8. }
  9. // redirect if end of expe after 5 sec
  10. if (END_EXPE == "True"){
  11. for(var i=0; i<6; i++){
  12. ((x)=>{
  13. setTimeout(()=>
  14. document.getElementById("refreshTime").textContent = 5 - x
  15. ,1000 * i)
  16. })(i);
  17. }
  18. setTimeout(function(){
  19. // TODO : refresh to home app
  20. window.location = baseUrl
  21. }, 5000);
  22. }
  23. }