🫨 Fix my crazy blur lags | Advanced

You guys know i love CSS only stuff, this time i wanted to focus on scroll animations, i want to recreate an image i found online and make it interactive The problem is, blur :D given the bubble gets rescaled during the animation quite heavily, it feels like it's trying to rerender the blurred segments every frame that makes it do crazy lags. https://codepen.io/Cubiq/pen/VworQqO?editors=0100 Do you think that going for transform 3d instead of scale might fix this bug? thanks a ton! original / inspired by: https://x.com/kravetzzzz/status/1792586595880640769
No description
No description
27 Replies
ἔρως
ἔρως5d ago
you can HUGELY reduce the "lag" by using will-change: scale on the <li> elements i can't guarantee it is perfect, since im using my igpu to render the browser, and stuff's sometimes a tiny bit weird
cubiq
cubiqOP5d ago
I tried that before, the lag still remains, i can't really see any difference but i guess i should put it there still..
ἔρως
ἔρως5d ago
i saw a massive difference
cubiq
cubiqOP5d ago
but thank you still!
ἔρως
ἔρως5d ago
try it again, it doesn't hurt but it is in the <li> elements, not the <ul>
cubiq
cubiqOP5d ago
it is :D the lag just feels about the same, but i didn't measure it, maybe its a bit better but my goal is to eliminate the lag entirely xd
ἔρως
ἔρως5d ago
that is so much worse on your pc you have NO IDEA how bad you have it
cubiq
cubiqOP5d ago
oh well, and over all i have pretty good pc :D
cubiq
cubiqOP5d ago
i mean yeah, its definitely caused because of that scale. i will try going perspective with translateZ, maybe that one could solve it 😅
ἔρως
ἔρως5d ago
ἔρως
ἔρως5d ago
this is how it looks for me it only skips frames when scrolling up i tried, but it didn't work for me but you can try it, instead of using scale
cubiq
cubiqOP5d ago
its moving in 3d but it is still laggy.. also very broken in terms of coords as you can't really go 0 when in perspective, its so broken xd, so yeah, also not a way..
ἔρως
ἔρως5d ago
still laggy but a lot less laggy
cubiq
cubiqOP5d ago
that's because the small ones aren't small enough to cause it xd
ἔρως
ἔρως5d ago
how about you transition the opacity at that point? instead of the scale?
cubiq
cubiqOP5d ago
that one is fine
ἔρως
ἔρως5d ago
looks better to me too sorta
clevermissfox
clevermissfox4d ago
I wonder if using a pseudo element for the bg with filter: blur(10px); would be any more performant- backdrop-filter esp with blur value seems to be more finicky
cubiq
cubiqOP4d ago
i could try doing that 😅 but expecting it's gonna be the same..
clevermissfox
clevermissfox4d ago
I’d be curious how different the performance measurements are. I’m not very familiar with how or where the metrics are for fps (performance or would it be in animation in dev tools?) edit: note to self- forgot about recording the animation ; - enable FPS meter and paint flashing( to see which parts of your page are being repainted) from Rendering , then record animation from Performance - Turn on Layer Borders to check if elements are promoted to GPU layers -Look for bottlenecks such as “Recalculate Style” or “Layout - Use CPU throttling in DevTools to test animation performance on less powerful devices When I’ve had issues with backdrop-filter , they’ve been solved with using filter instead so just thought I’d pipe in just in case
ἔρως
ἔρως4d ago
backdrop-filter is indeed heavier than filter, from what ive seen so, thats a good suggestion
cubiq
cubiqOP4d ago
well it is indeed, the problem is that we want to actually blur the background <-o , so filter that blurs o-> wouldn't work in this case.
ἔρως
ἔρως4d ago
the idea she proposed is to blur a pseudo-element (:before or :after) instead
capt_uhu
capt_uhu3d ago
the backdrop-filter blur web platform test shows that Chrome takes 3 to 4 times longer to paint the test than Firefox. So the heart of the problem might just be Chrome's current not so great implementation of backdrop-filters. Hopefully this gets fixed up this year as part of the Interop work: https://wpt.fyi/results/css/filter-effects/backdrop-filter-basic-blur.html?label=master&label=experimental&view=interop&q=label%3Ainterop-2025-backdrop-filter
ἔρως
ἔρως3d ago
🤔 that's very interesting specially since the effect has to be re-calculated every frame
cubiq
cubiqOP22h ago
because deeper functionalities of backdrop filters on firefox are directly limited.. Their optimization is not to include features (or better not to code them at all) while there were directly part of the whole svg filter spec 😅 I'm not saying that chrome's approach couldnt have been improved, for sure they could, but i feel like this is not the same thing.. https://discord.com/channels/436251713830125568/1217109466906886155/1217268831488180354
capt_uhu
capt_uhu20h ago
what "deeper functionalities of backdrop filters" are you talking about that are limited on Firefox?

Did you find this page helpful?