PRELOADER before the dynamic page's elements

How to load a PRELOADER before the dynamic page loads on clicking each link.

I have a website with the following structure

  1. A home page
  2. Home page connected to dynamic pages
  3. These Dynamic pages have various links connecting other sections/pages.

Here each Page loads very slowly.
Pls help me with a common code where a pre-loader is fired before loading a page.

Home page:

Dynamic pages:
https://www.lodhamumbai.com/lodha-projects/lodha-codename-central

i) At present i am using this code for #image1 of a repeater to connect image to the dynamic page/s;

//Item preloader

import wixLocation from ‘wix-location’ ;
$w . onReady (() => {
$w ( “#repeater1” ). onItemReady (( $item ) => {

    let  currentItem  = [ 'link-lodhaproject-page-title' ]; 

    $item ( "#image1" ). onClick (() => { 
        $item ( "#preloader" ). show () 

            . then (() => { 
                wixLocation . to (`${ currentItem  }`); 
            }) 
    }) 
}) 

})

//code ends here

ii) also, help me with additional lines in this code, to link
“View Details” button, #button29 to the same dynamic page link of #image1.