Sorry ehm… apparently I don’t know what I should put inside the bracket. Because when I put the animation code in the wix-window code you give, like this:
import wixWindow from 'wix-window';
let formFactor = wixWindow.formFactor; // can be either "Mobile" or "Desktop"
if (formFactor === "Mobile")
{
//do some mobile only code }
else
{
export function Header_onViewportLeave(event){
$w("#LoveIcon").show("FadeIn");
//Add your code for this event here:
}
//do some desktop only code
}
There is an error “import and export may only appear at the top level” #OMG