Jump to content
Search Community

Ignore spaces in ScrambleText

superhighfives 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

Hey folks,

 

I'm using ScrambleTextPlugin with a wrapping paragraph of text:

 

Working across design, development and
interactive media, I build interfaces, websites,
applications and open source experiments
using web technologies.

 

Currently there's no way to ignore spaces while scrambling, which means the last word of each sentence flicks between each line. For example:

 

Working across design, development
and interactive media, I build interfaces,
websitesaoxooxoxxxoxxoooooxoxxxooxooxxoxxx
xooxxxxoxooxooxxxooxxoooxxxxox

 

Because the word website is tied to the remaining scrambled string.

 

I believe ignoring spaces could solve that issue:

 

Working across design, development and
interactive media, I build interfaces, xoxoxoxox
xoxoxoxoxxox xox oxox xxooxo xooxxoxoxox
xoxox xox oxoxoxxoxoxox

 

I have looked in the source, but I haven't been able to find a place where I could loop through the string before it is passed to the DOM. My goal would be to do something like the following (pseudo-code):

 

if(actualText[indexOfLetter] === " ") {

  awesomeScrambledText[indexOfLetter] = " ";

}

 

Any advice would be really appreciated, and I'd love to add something like this into the actual plugin.

 

If anyone has any suggestions that'd be awesome.

 

Cheers,

Charlie.

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...