Rich-Harris / ramjet

Morph DOM elements from one state to another with smooth animations and transitions

Home Page:http://www.rich-harris.co.uk/ramjet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two steps transition ?

wmcmurray opened this issue · comments

Hi,

I wonder if it could be possible to morph two elements in two steps instead of one.

...Explanation :

I'm making a transition between two pages. Lets say the first one is a listing of blog articles and the other is the blog article itself. I want the smaller version of an article (in the listing) to transition into the full version of the article (in the single article page). But because the second one is on a different page, the layouts differs. I can only have either the smaller article OR the full article in the DOM at the same time. Therefore I can't transition between the two elements because the state of the elements are recorded at the same time.

What I would need is :

  • Step 1 : record the state of the DOM element A in the listing page
  • Step 2 : erase the listing page layout and replace it with the single article page
  • Step 3 : morph my recorded state of the DOM element A into the DOM element B (the full article)

Achieving this would be incredibly awesome to me, is it hard to implement ? :)