Some time ago I noticed that in Safari the animations work in a different way.
For example, if we have a text inside a span
and want to hover
the letters of this text decrease 1px
, we set letter-spacing: -1px;
. Putting a transition: all 0.5 ease;
on Chrome and Firefox will work smoothly.
But in Safari , this happens abruptly, ignoring the smoothness of the transition. Why?
Because I did not define in the normal element a letter-spacing: 0px;
. That is, the property must have an initial value for the transition to take place. Only in Safari does this happen.
Now in the case below I can not get around the situation. When entering the site, two images perform an animation. But with% of% of these images, another effect happens.
Then when you take the mouse over the image, it returns to its initial properties and not to the properties that I set in hover
of 100%
of the animation.
In CSS I defined in the element that the image will begin with:
opacity: 0;
transform: scale(0);
And in KeyFrame I've set it to end with:
opacity: 1;
transform: scale(1);
Then in Safari the image returns with keyframes
...
CSS
.menu-language-full{
position: absolute;
right: 0;
width: 100px;
height: 50px;
display: block;
z-index: 1;
top: 15px;
img{
margin-left: 5px;
vertical-align: middle;
opacity: 0;
transform: scale(0);
animation-name: ShowImgIdioma;
animation-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55);
animation-fill-mode: forwards;
animation-duration: 0.5s;
transition: all 0.6s ease;
&.pt-br{
animation-delay: 2.2s;
}
&.en{
animation-delay: 2.4s;
}
&:hover{
transform: scale(1.1);
filter: blur(1px);
}
}
}
KeyFrames
@keyframes ShowImgIdioma{
100%{
opacity: 1;
transform: scale(1);
}
}