Snippet to reproduce the problem:
for (let img of document.querySelectorAll('.test')) { img.addEventListener('mouseenter', function () { this.classList.add('active'); }); img.addEventListener('mouseleave', function () { this.classList.remove('active'); }); }
.test { transition: all 0.3s ease-out; } .active { filter: blur(10px); transform: translateY(20px); }
<img class="test" src="https://picsum.photos/200/150/?image=11"> <img class="test" src="https://picsum.photos/200/150/?image=15"> <img class="test" src="https://picsum.photos/200/150/?image=16">
The reason is resource intensity blur.
Accordingly, it is impossible to solve the problem 100% . But, can apply CSS voodoo some optimizations that will help in most cases.
upd .: After reading the comments and checking in Firefox (Win, Andr) and Opera (Win), I conclude that I was wrong about the reasons. Apparently, they are still in Chrome under Windows and android.
Solution option:
for (let img of document.querySelectorAll('.test')) { img.addEventListener('mouseenter', function () { this.classList.add('active'); }); img.addEventListener('mouseleave', function () { this.classList.remove('active'); }); }
.test { transition: filter 0.3s steps(18), transform 0.3s ease-out; backface-visibility: hidden !important; transform: translate3d(0, 0, 0) scale(1, 1); } .active { filter: blur(10px); transform: translate3d(0, 20px, 0) scale(1, 1); }
<img class="test" src="https://picsum.photos/200/150/?image=11"> <img class="test" src="https://picsum.photos/200/150/?image=15"> <img class="test" src="https://picsum.photos/200/150/?image=16">
This solution includes (in order of importance):
limiting the number of transition frames, steps(18)
60 frames / s (browser limit) * 0.3s = 18
It also makes the time transition function linear, which greatly accelerates the calculations (but this is not just an analog of linear , but better).
disabling rendering of the back side of an element through backface-visibility: hidden
The meaning is obvious: the flip is not executed => there is no point in rendering a revolve.
exclusion from recalculation of transform transformations on X and Z, as well as scaling
Plus, translate3d creates a new layer when rendering the element - which, in turn, should force the browser to use the GPU not only when blurring.