Jump to content
GreenSock

celli

Diagonal Div Page transition

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

I have a crude example in my codePen of a diagonal div that I am trying to cover the entire window, and when I click the button the diagonal shape will slide down to the bottom left of the window, and reveal the content underneath.

 

I am sure there is a much better way to approach this, so the diagonal is not a huge shape stretching way beyond the borders of the browser and so that it looks like a diagonal triangle shape, as it slides down to the left and out of view at any screen size. Can someone shed some light...?

See the Pen RNNvQW by celli (@celli) on CodePen

Link to comment
Share on other sites

Hi celli  :)

 

personally i prefer to using SVG or Canvas for this type of page intro / preloading gate , or use simple div fade out effect .

 

a simple demo , check this out  :

 

See the Pen JoozxE by MAW (@MAW) on CodePen

  • Like 1
Link to comment
Share on other sites

Maybe for bigger compatibility try drawing two svg shapes and set those as a background. You can then make it responsive by setting background-size:cover or use percentage.

  • Like 1
Link to comment
Share on other sites

yes, these are awesome ideas. thanks!

Link to comment
Share on other sites

No problem. The people here are really helpful and nice. 

 

Diaco is a greensock magician by the way :D

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