Jump to content
Search Community

Tilt effect with ScrollTrigger plugin

ghisleouf test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hi guys,

 

I'm new here and I wanted to ask a question about creating a quite simple animation with ScrollTrigger plugin.

I would like to create a "kind of" tilt animation on an element.

 

I created a very approximative pen just to have a starting point ..sorry ... it is not my current project.

 

Actually, what I would like to do is to create a scroll animation where my picture scale size varies from 1.5 to 1 when it comes to the center of the viewport (from the bottom) and then scales down from 1.5 to 1 when leaving the viewport on scroll.

 

if you have any advice to achieve it properly ... that would be perfect !!!

 

Thanks for your help.

 

Best regards 

 

See the Pen wvrreoW by ghislefou (@ghislefou) on CodePen

Link to comment
Share on other sites

  • Solution

Welcome the forums @ghisleouf

 

Have you check out the new keyframes features added in v3.9? 

 

 

You could define all your scale values in a single tween like so...

 

gsap.to('.tilt', {
  // scale: 1.5,
  keyframes: {
    scale: [1.5, 1, 1.5]
  },
  ease: "none",
  scrollTrigger: {
    trigger: '.wrapper',
    scrub: true,
    markers: true
  }
})

 

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