Autoload page

My site has a splash page, which should be shown only when the user first goes to the site.
It shows an animated logo for 1 sec.
After that, I would like it to automatically load the home page.

I could not find any add-in solution, so have tried JavaScript (without really knowing, what I’m doing).

$w.onReady( function () {
“alert(‘hello world’)”

“setTimeout(function(){window.open = ‘https://www.getnumo.com/’;}, 1800);”

});

Save, publish and try. No luck

Even the alert never gets called.
Any ideas on how to do this would be great.

Thanks!

Olaf, alert and window.open (and the whole DOM, for that matter) are not available in Wix. You need to use console.log and ‘wix-location’ to achieve this.

A friend figured it out. For others:
1 - go to the console
2 - Tracking & Analytics
3 - + New Tool
4 - Custom

Paste in the code snippet

Select the page to run on.

Worked for me

when we change the location or go to other page i want it to be animated

import wixAnimations from ‘wix-animations’ ;
import wixLocation from ‘wix-location’ ;
import wixWindow from ‘wix-window’ ;

let timeline = wixAnimations . timeline ();
const fadeOptions = {
“duration” : 200
};
$w . onReady ( function () {
if ( wixWindow . rendering . env === “browser” ) {
setTimeout (() => {
return wixLocation . to ( “/sursona” )
}, 1000 );
}

**const**  myImage  =  $w ( "#image134" ); 
timeline 
    . add ( myImage , { 
        "opacity" :  0 , 
        "duration" :  900 
    }) 
    . onComplete (() => { 
        $w ( "#image134" ). hide ( "FadeOut" ,  fadeOptions ); 
        $w ( "#columnStrip88" ). hide ( "FadeOut" ,  fadeOptions ); 
              }). play (); 

});
this code is creating gaps like white screen also it doesn’t show proper animation effects . . . how can i improve it