The issue isn’t with GitHub Pages but with how browsers handle PDF loading in iframes—onload fires when the PDF viewer is initialized, not when the actual PDF content is fully rendered and visible, so your loading screen disappears too early. Since you can't reliably detect when the PDF becomes visually ready from an iframe, a simple workaround is to delay hiding the loading screen using setTimeout (e.g., 5–7 seconds) after the iframe's onload event. For a more accurate solution, you'd need to use something like PDF.js, which gives proper rendering events—but for most cases, a timed delay does the trick.