Jump to content
Search Community

Can't import ScrambleTextPlugin

Tom_17892 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

When I try to import the ScrambleTextPlugin, it can't be found. I installed the Greensock package with NPM in my Angular 2 poject, but I don't see any files for the ScrambleText plugin...

 

Can anyone help me? Thanks in advance!

Link to comment
Share on other sites

Thanks for the fast reply Dipscom! I've tried the method like OSUblake desribed:

 

import * as Draggable from "gsap/Draggable";

And for the draggable plugin it works just fine, but the ScrambleTextPlugin can't be found. If I search in the package I can see the draggable plugins and all, but ScrambleTextPlugin. Was this plugin deleted from the package?

 

Also the "MorphSVGPlugin" is not available, maybe I am doing something wrong..

Link to comment
Share on other sites

  • 10 months later...

And how to import it if we are member and we have those files

I use TweenMax from npm

```
import {TweenMax, Expo} from 'gsap'

import ScrollToPlugin from 'gsap/src/uncompressed/plugins/ScrollToPlugin';
```

and I added pro plugins in a folder

```
import 'src/vendors/gsap/SplitText';
// I am able to use splitText
```

But this specific plugin doesn't work

I've tried
```
import 'src/vendors/gsap/ScrambleTextPlugin';
import ScrambleTextPlugin from 'src/vendors/gsap/ScrambleTextPlugin';
import * as ScrambleTextPlugin 'src/vendors/gsap/ScrambleTextPlugin';
```

(but if i add the script directly in the `<head>` that will work)
`<script src="/static/ScrambleTextPlugin.js"></script>`

Link to comment
Share on other sites

Well, we're close to releasing 1.20.5 which will make this even easier but for now I think the best way to do this would be to use the files from the "bonus-files-for-npm-users" that's in the zip download. That has all the bonus stuff with dependencies that point to the "gsap" that's in the node_modules (typically). So it should be relatively simple. It looks like you were just using a set of files that aren't optimal for your setup (the ones in /src/uncompressed/). 

 

Of course it's totally fine to use a <script> tag instead. In many ways, that might even be the cleanest solution, especially for the main files since they're so widely cached from the CDN. 

 

(curious - I can't seem to find any Club GreenSock memberships associated with your account; do you mind me asking how you got the bonus plugins? Are you perhaps registered under a different account?)

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...