Skip to content

Custom loading text

develephant edited this page Apr 3, 2018 · 4 revisions

index.html

...

    progressElement.max = null;
    progressElement.hidden = true;
  }

  //Custom loading
  if (text.includes("Downloading data...")) {
    var res = text.match(/([0-9]+)\/([0-9]+)/)
    var loaded = Math.round((parseInt(res[1])/parseInt(res[2]))*100)
    statusElement.innerHTML = 'Loading '+loaded+'%';       
  } else {
    statusElement.innerHTML = text;
  }

},
  totalDependencies: 0,

...
Clone this wiki locally