PageSourceSearch

https://nationalday.ai/js/mainloader.js

js nationalday.ai collected 2026-10-05 16:11:20 UTC 2,017 bytes, 69 lines download raw bytes

1const progressBar = document.querySelector(".progress-bar");
2const progressText = document.querySelector(".progress-text");
3const preloader = document.getElementById("preloader");
4
5let resourcesLoaded = 0;
6
7// Total resources to load (images + scripts + stylesheets + 1 for YouTube)
8let totalResources = document.images.length + 4 + 2 + 1; // 6 scripts, 2 stylesheets, and 1 YouTube video
9
10// Images
11Array.from(document.images).forEach(img => {
12    const fakeImg = new Image();
13    fakeImg.onload = resourceLoaded;
14    fakeImg.onerror = resourceLoaded;
15    fakeImg.src = img.src;
16});
17
18// Scripts
19const scripts = [
20    "js/mainscript.js",
21    "js/jquery.3.7.0.min.js",
22    "js/jarallax.min.js",
23    "js/jarallax-video.min.js",
24];
25
26scripts.forEach(scriptSrc => {
27    const script = document.createElement('script');
28    script.onload = resourceLoaded;
29    script.onerror = resourceLoaded;
30    script.src = scriptSrc;
31    document.body.appendChild(script);
32});
33
34// Stylesheets
35const stylesheets = [
36    "css/mainstyle.css",
37    "css/jarallax.css"
38];
39
40stylesheets.forEach(stylesheetSrc => {
41    const link = document.createElement('link');
42    link.onload = resourceLoaded;
43    link.onerror = resourceLoaded;
44    link.rel = "stylesheet";
45    link.type = "text/css";
46    link.href = stylesheetSrc;
47    document.head.appendChild(link);
48});
49
50// YouTube video (using a timeout as a rough estimate)
51setTimeout(resourceLoaded, 100); // 
52
53function resourceLoaded() {
54    resourcesLoaded++;
55    let progress = (resourcesLoaded / totalResources) * 100;
56    progressBar.style.width = progress + "%";
57    progressText.textContent = Math.round(progress) + "%";
58
59    if (resourcesLoaded === totalResources) {
60        setTimeout(() => {
61            preloader.style.display = "none";
62        }, 500); // Optional delay after loading
63    }
64}
65
66// If there are no resources, remove preloader immediately
67if (totalResources === 0) {
68    preloader.style.display = "none";
69}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.