Add below code to the file that you want to develop the animations.main.js or another perhaps animations.js
require([
'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.1/gsap.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.1/ScrollTrigger.min.js'
], function (GreenSocks3, St) {
const gsap = GreenSocks3.gsap;
const ScrollTrigger = St.ScrollTrigger;
gsap.registerPlugin(ScrollTrigger);
});
- Upload min.js file to
app\design\[Theme]\[Theme-name]\web\js
- Add below code to require-config.js
packages: [
{
name: 'MorphSVGPlugin',
location: 'path/MorphSVGPlugin.min.js min.js',
main: 'MorphSVGPlugin.min.js'
}
],
require([
'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.1/gsap.min.js'
'MorphSVGPlugin', ],
function (GreenSocks3, Mrph) {
const gsap = GreenSocks3.gsap;
const MorphSVGPlugin = Mrph.MorphSVGPlugin;
gsap.registerPlugin(MorphSVGPlugin);
});