Shadow could be done with a pseudo element that has its opacity animated. But resizing things in a performant way could be easier indeed
-
-
Replying to @szynszyliszys @DasSurma and
Would love to see a pen. I'm presuming you want accurate shadows. To GPU-accel resize with correct corners, you'd need to 9-patch...
1 reply 0 retweets 0 likes -
Replying to @appsforartists @szynszyliszys and
...and to have the shadows on the patches align seamlessly, you'd need to mask the patches, which is either DOM complexity or paintWorklets.
1 reply 0 retweets 0 likes -
Replying to @appsforartists @szynszyliszys and
But if you know better techniques, I would love to see examples!
1 reply 0 retweets 0 likes -
Replying to @appsforartists @szynszyliszys and
My original pen doesn’t have shadows so I wasn’t factoring that in. Pseudo el shadows via opacity/translate/scale for expansion could work
1 reply 0 retweets 0 likes -
Replying to @shshaw @appsforartists and
Here's a transform-based equivalent of the original. Haven't fully performance tested, but there does seem to be a perceivable difference:https://codepen.io/shshaw/pen/LOZgJr?editors=1100 …
2 replies 1 retweet 1 like -
Replying to @shshaw @appsforartists and
So much nicer! :D You can try adding will-change to see if it makes the performance any better (now everything is on the same layer).
2 replies 0 retweets 1 like -
Replying to @szynszyliszys @appsforartists and
Is `will-change` on the top moving element sufficient, or should everything moving with transform have a `will-change`?
1 reply 0 retweets 0 likes -
Replying to @shshaw @appsforartists and
My first guess would be to have every element on separate layer, but just checked and they still seem to cause repaints because of pseudo elements inside. Would have to dig deeper, but my brain is telling me to sleep.
1 reply 0 retweets 1 like -
Replying to @szynszyliszys @shshaw and
Small proof video with Layers tab (my new fav
@ChromeDevTools).pic.twitter.com/iPRdVDT9JI2 replies 0 retweets 2 likes
Here's a doc on how to access the Layers tab (it's quite hidden) https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference#layers …
-
-
Replying to @ChromeDevTools @szynszyliszys and
I totally have a Supercharged MicroTip coming up on that one :3
2 replies 0 retweets 5 likes -
Replying to @DasSurma @ChromeDevTools and
I had to ask PDR where to find the Rendering tab once.
@ChromeDevTools is a great tool, but I don't always know where to find things in it (even if I've used them many times before).1 reply 0 retweets 2 likes - 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.