Hi Ziv,
Okay let me start from the beginning. Two weeks ago my editor started to act crazy. It didn’t want to save and publish on desktop view, can’t cut and paste more than one element, and further down the road the whole editor crashing frequently. It happened after Wix Code has been turned on for my account. Story short, they just fix it yesterday and it goes back to normal. But they give that message, which is a headache.
FIRST PROBLEM
What I’m trying to implement here is I pin a love shape button on my screen, it will show up at viewport leave from the header, when I click the love button it will show social sharing icons to Facebook, Twitter, and G+, when my mouse move out from a certain range (using container box) the social sharing icons goes hidden again. As I make it show in all pages so the code is in the Site Console section. Here is the code:
export function Header_onViewportLeave(event) {
$w("#LoveIcon").show("FadeIn");
//Add your code for this event here:
}
export function LoveIcon_onClick(event) {
$w("#SocialShareContainer").show("FadeIn");
//Add your code for this event here:
}
export function SocialShareContainer_onMouseOut(event) {
$w("#SocialShareContainer").hide();
//Add your code for this event here:
}
Now the problem is all of this thing is hidden in mobile view and it produces a console error. Thus the Wix Support team said so. Right now I don’t know how to solve the error as per the steps they give, which is:
Adding these 2 lines of code that will return the state of the Viewer Form:
Reference: https://www.wix.com/code/reference/wix-window.html#formFactor
import wixWindow from 'wix-window';
let formFactor = wixWindow.formFactor; // "Mobile"
Then you can wrap your code to only run if the result of "formFactor" is "Desktop".
If it is possible so I can learn from this problem, please explain a bit: Why is that code matter? What will it do? How will it affect the whole site? Will it differentiate between the code that will be processed in Mobile vs Desktop?
SECOND PROBLEM
As you can see from the attached screenshots, there is one page on my site that has this “Code Not Loaded” error. Yesterday when I open that page and took the screenshots, it freeze my editor and unable to save, so I have to reload the editor.
THIRD PROBLEM
This is just a question on animation. Is it possible to give properties to the animation effect. Let’s say like “Float In” from bottom with 2 speed and 1 delay. If it is possible, how should the code be?
Sorry if there is so many questions. I have so many others, because I’m just so new to coding. Right now I’m settled doing this interaction coding, as making form feels like a very hard thing to do.