Forum Discussion
How to use GSAP for animation in Storyline
As i get this question quit often, i am making a online tester for Gsap animation in Storyline. First step is scaling an image. And defining where you want to scale it from. This transformation point can be set by Gsap and thus change the effect of your animation completely.
Here you can see how this works. To be continued.
https://360.articulate.com/review/content/8b6932db-b253-4e60-b0df-e7569a2cf0ea/review
- MathNotermans-9Community Member
Recently someone asked me whether its possible to trigger elements on SlideLayers with Javascript from the main layer. In fact thats easy with Javascript as the SlideLayers are treated as separate DIVs, nothing more , nothing less. So the selector(s) you use on the main timeline will also work on SlideLayers... if they are visible ofcourse.
Here you can see the sample i made for that.
https://360.articulate.com/review/content/41f9e131-b5ba-4bef-8656-d57cd1d6f526/review
Adding the story of that to this post too.
What i wanted to make however was a rotating animation of a child around a parent. Earth around the sun... and with that i encountered the issue that the transformation point needed to be outside the bounds of the element....
to be continued... - TianxuanLiuCommunity Member
Nice!
- MathNotermans-9Community Member
Next one in this series is about animating groups in Storyline with GSAP. For now only a Review link, more complete post including source file in progress...
https://360.articulate.com/review/content/7224b214-e6bc-4111-9821-9c96c0d0aa03/review
A post about GSAP for groups in Storyline is now here available.
https://community.articulate.com/discussions/building-better-courses/animate-storyline-groups-with-gsap - JordanBestCommunity Member
Hi Math, I'm enjoying your posts regarding GSAP. I've been messing around quite a bit with them and would love to know if you've implemented some of the other plugins like Pixi or MorphSVG? If you have, I'm wondering if you could share how you get those to work in Storyline? Do you load them locally with JavaScript or is there another way? Thank you!
- MathNotermans-9Community Member
Yes i have.
Ofcourse you need a Greensock license for the plugins. Pixi and both MorphSVG work great together with Storyline and GSAP. I do think i have some samples in the forum...
https://community.articulate.com/discussions/articulate-storyline/morphing-animation-in-storyline
https://360.articulate.com/review/content/a447cc04-524a-40cb-8345-aa86660f3637/review
I used Pixi before and indeed love it too. Especially in combination with the GSAP Pixi plugin you can create great things.
As im working on a sprite based approach ( in Storyline360 ) to use in a multiplayer game im planning to show on the Articulate Usersdays overhere in Belgium/Netherlands....i might spent some time in Pixi too...as it has great sprite tools too.
I probably cannot share publicly any tips/tricks with GSAP plugins...as they are licensed... but for sure will explain how to use them.
- AyseSahin-3327fCommunity Member
Hello, could we use it to make a webObject rotate ? (I think of a 3d model for example)
Thank you for all your tips !
- TilburgTeacherECommunity Member
For sure... the biggest issue is getting a selector for the WebObject. If you have that...you can simply use GSAP to rotate it.
If you however mean control animation inside a WebObject... so the html in it..from Storyline..well thats possible too, but what more complex. - TilburgTeacherECommunity Member
As you can see here... thats easy.
https://360.articulate.com/review/content/7db4273f-fc1b-4558-928c-7117be2d0d81/review
Im gonna make a sample where i change the settings of the animation in the WebGL-WebObject. Stopping it, changing rotation speed and things like that.- AyseSahin-3327fCommunity Member
Thank you Math, it's really awesome !
You know, what I would like is to manipulate a 3d object by sliding the object (with gesture or mouse).
I am into interactive module atm (like everybody ?).
Thank you for your help !
- MerveSatmazCommunity Member
Thanks, Math. I have a question, I use Xpercent 'vw' values to get the x and y positions to work correctly when the screen size changes when using gsap and it works but there is some degradation when the user changes the window size with the course open. I saw that you had the same problem in the example you shared. Do you have a solution for this?
- MathNotermans-9Community Member
Hi Merve, i am not sure which example you are referring to... and what degradation.
If its GSAP related im quite sure you find a solution on their forum...or make a sample codepen on their forum showing the issue and im 100% sure either Jack or one of the other GSAP heroes onthere will quickly help and solve it.
If its HTML related or Storyline/Articulate related...well this forum is your only chance :-)
Add a sample showing it clearly and i will help.
Kind regards,
Math- MerveSatmazCommunity Member
- DavidOliver-2a7Community Member
GSAP (GreenSock Animation Platform) is a powerful JavaScript library for creating high-performance animations. Here are the steps to use GSAP for animation in Storyline:
-
Open the Storyline project and create a new slide where you want to add the animation.
-
Click on the "Insert" tab in the Storyline ribbon and select "Web Object."
-
In the "Web Object" dialog box, enter the URL for the HTML file that contains your GSAP animation code. You can also choose to display the HTML file in a new browser window or within the Storyline slide.
-
Click on "OK" to insert the web object into your Storyline slide.
-
Open the HTML file in a text editor and add the necessary GSAP animation code. For example, you can use the TweenMax library to animate objects on the screen.
-
Save the HTML file and preview the Storyline slide to see the animation in action.
Note that the exact implementation of GSAP in Storyline may vary depending on your specific project and animation requirements. However, these basic steps should give you a starting point for integrating GSAP into your Storyline project.
- MathNotermans-9Community Member
Comeon David, dont dump generic info thats incorrect too.
GSAP is included in Storyline360 and you can use it right of the bat with simple JS code i show abudantly.- DanLidholm-48cdCommunity Member
Hi Math,
I've been reading through your posts about GSAP and it looks great. I tried some of them and it looks really nice. Thanks for all the info.
However, I have problem with responsiveness and I cannot find a solution. Is it possible to use an object, like a rectangle to limit the playground for the animation to just take place inside that box? Now, I am using vw & vh but as soon as I change the size of the browser window the animation ends up in the wrong place.
Hope you can help me.
-
- DavidHolzemer-7Community Member
Hi Math,
I'm super new to javascript, but am trying to learn a little :-) Hope you don't mind if I ask probably an incredibly novice question.
I want to have a 3 buttons on a screen ... and if you hover over one it grows and bounces just a little bit.
For the trigger I was just using When user hovers over execute JavaScript
This is the Javascript I was trying to make work
//Reference the object
var theObject1 = document.querySelectorAll("[data-acc-text='bounceMe']");
//Animate in GSAP
gsap.to(theObject1,{scale:1.05,ease:bounce.out})bounceMe is the name I gave the button in the Accessibility panel
Any chance you coud tell me what I did wrong? I'd be greatful to just get something simple to work..lol!
David
- JordanBestCommunity Member
Hi David,
It looks like you're missing some quotes:
gsap.to(theObject1,{scale:1.15,ease: "bounce.out"});
- DavidHolzemer-7Community Member
OMG!!! It actually works :-) Thank you so much Jordan.. Can't wait to do more :-)
- SuatDilekCommunity Member
Hi. I want to create a color filling animation inside the svg object on Articulate. The svg element is a letter and I am trying to give the effect that this letter is written when the interaction starts. Do you have any ideas about this?
- MathNotermans-9Community Member
Yes, quite some sample i shared online how to change SVG in Storyline. Do share a sample and i show how.