_marta Posted August 19, 2020 Share Posted August 19, 2020 Hello all, I've been using gsap for quite a while with no problems, but today I started experimenting with CustomEase. I dowloaded the zip file and ran npm install for the .tgz file on the "npm-install-this" folder. After that I went to the js file in which I was using CustomEase and I added at the beginning of the file: import 'gsap/CustomEase'; And then where I wanted to use the easing function I did: CustomEase.create('custom', 'M0,0,C0.126,0.382,0.324,0.584,0.482,0.732,0.553,0.798,0.612,0.78,0.69,0.796,0.69,0.796,0.816,0.842,0.816,0.842,0.84,0.862,0.859,0.879,0.893,0.918,0.918,0.946,0.951,1,1,1'); But when I ran the easing it gave me the error ReferenceError: CustomEase is not defined. Am I missing something? Link to comment Share on other sites More sharing options...
PointC Posted August 19, 2020 Share Posted August 19, 2020 Did you register the plugin too? gsap.registerPlugin(CustomEase); 2 Link to comment Share on other sites More sharing options...
_marta Posted August 19, 2020 Author Share Posted August 19, 2020 1 minute ago, PointC said: Did you register the plugin too? gsap.registerPlugin(CustomEase); Where should I use that? In the same file that I am importing CustomEase? Link to comment Share on other sites More sharing options...
OSUblake Posted August 19, 2020 Share Posted August 19, 2020 You have to import it. See the install helper. https://greensock.com/docs/v3/Installation import { gsap } from "gsap"; import { CustomEase } from "gsap/CustomEase"; gsap.registerPlugin(CustomEase); 2 Link to comment Share on other sites More sharing options...
_marta Posted August 19, 2020 Author Share Posted August 19, 2020 It is working now, thank you both!! I am sorry, I thought that I had read everything on the installation guide but apparently not. 1 Link to comment Share on other sites More sharing options...
Ruben Se Posted June 15, 2023 Share Posted June 15, 2023 How can i do this if I am not using imports, I am using the cdn and I have referenced this in my html <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.0/gsap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.0/EasePack.min.js"></script> Link to comment Share on other sites More sharing options...
Cassie Posted June 15, 2023 Share Posted June 15, 2023 Are you trying to use customEase? <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.0/CustomEase.min.js"></script> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now