One of my XPages there are mo many design elements. The page takes time to load more than expected according to connection speed. I would like to create an indicator to show the
How you do this will not be XPages-specific. It's important to understand the order of events.
So adding anything to the XPage that is the target of the browser request at step 2 cannot have an effect. You need to do something client-side at step 1, before the request is sent to the browser. If you think about how you did it for the partial refresh and what's happening, again it's running CSJS before triggering the partial refresh, the same process.
If users are coming externally, the only option is to send them to a redirect web page first, render that, and continue programmatically running step 1.