Jump to content
Search Community

Shuffle Grid

quintonjason test
Moderator Tag

Go to solution Solved by OSUblake,

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

  • Solution

Kind of strange. That demo is obviously based off of my sortable grid, but it doesn't use a single line of code from it. Even the CSS is completely different.

See the Pen RNLdpz by osublake (@osublake) on CodePen

 

Like Diaco said, just create a fromTo animation. The grid is setup using floated elements, so you can use relative animations, which lets the browser calculate the layout. All you have to do is offset it from it's old position and then animate it to 0. Here's an example of a relative animation.

See the Pen QjQGBa?editors=001 by osublake (@osublake) on CodePen

 

Apply that technique to that demo and it looks pretty good! It works with the reorder too.

See the Pen wMJeRb?editors=001 by osublake (@osublake) on CodePen

  • Like 3
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...