Jump to content
Search Community

Scale for the frame but do not scale image

trieuvy test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hi guys,

 

I'm trying to recreate the scaling effect that Apple is using for their Apple Watch page (https://www.apple.com/watch/), but haven't achieved the desired result yet.

Currently, I'm using scale to shrink the images as I scroll down, it works as expected but the image shrinks along with its container frame. I want only the container frame to shrink while the image maintains its original size, similar to this video (https://streamable.com/n9xj3e).

See the Pen Povwwwj by trieuvy (@trieuvy) on CodePen

Link to comment
Share on other sites

  • Solution

Hi,

 

Actually they're using clip-path inset with round:

clip-path: inset(4rem 20% round 1rem 2rem 3rem 4rem);

https://developer.mozilla.org/en-US/docs/Web/CSS/basic-shape/inset

 

If you inspect with devtools you'll see this:

element.style {
  clip-path: inset(2.87718% round 20.2554px);
}

You should have a look at this thread:

 

Hopefully this helps.

Happy Tweening!

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