Hi everyone.
Is it possible to get the Power “soft” setting for the spin effect within the code?
Basically I want two little gears to turn when entering into the viewport but so far it is not possible to adjust the power setting which results in a combination of zoom-in spin effect which defeats the purpose.
This is the code so far and works like a charm but the automatic Power “Hard” mode results in the described fade/zoom-in version. In the wix references nothing is mentioned about the possibility to adjust it. Yet when manually fitting the animation without code the power level can be adjusted.
let spinOptionscw = {
“duration”: 2000,
“delay”: 500,
“direction”: “ccw”,
“cycles”: 5
};
let spinOptionsccw = {
“duration”: 2000,
“delay”: 500,
“direction”: “ccw”,
“cycles”: 5
};
$w(“#text26”).onViewportEnter( (event) => {
$w(“#image71”).show(“spin”, spinOptionscw);
$w(“#image72”).show(“spin”, spinOptionsccw);
})
$w(“#text26”).onViewportLeave( (event) => {
$w(“#image71”).hide();
$w(“#image72”).hide();
})
That is because there is none currently.
It is available on the bounce function though.
https://www.wix.com/corvid/reference/$w.EffectOptions.html#BounceEffectOptions
intensity: soft, medium, hard - default medium
Although, obviously that will be no use to yourself as you would want it on the spin effect.
You could always just try adding the intensity line into your options and see if it accepts it even though it isn’t listed as usable.
Thank you for the quick reply!
I just tried with intensity and also power but was not recognized… Petty :D.
Problem solved. Manually put animation without the code with the desired “soft setting” and just leave the code for the viewport enter and leave so basically when show is triggered the manual selected animation is played (happy again):
$w(“#text26”).onViewportEnter( (event) => {
$w(“#image71”).show();
$w(“#image72”).show();
})
$w(“#text26”).onViewportLeave( (event) => {
$w(“#image71”).hide();
$w(“#image72”).hide();
})
Well done, although I am sure that we would all prefer it if it could all be done in the same block of code, instead of having to use part code and part animation settings, that time will come, eventually, hopefully…