Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone Safari strange css bug (z-index in animation) #13

Open
lordganymed opened this issue Oct 19, 2022 · 1 comment
Open

iPhone Safari strange css bug (z-index in animation) #13

lordganymed opened this issue Oct 19, 2022 · 1 comment

Comments

@lordganymed
Copy link

On the iPhone, the numbers are temporarily displayed mirror-inverted when rotating. I suspect here a css property is not supported.

@lordganymed
Copy link
Author

I have found the problem. In the .css file the animation of the rotating digits is defined in keyframes. There is an anination for the upper part (hide old digit) and an aniation for the lower part (show new digit). The visibility is controlled by z-index, which leads to problems with animations in Safari.

My solution is certainly not pretty, but seems to work (tested also on Android and Windows Chrome/Firefox). Instead of z-index I used opacity to control the visibility:

@keyframes countDown_flip_1{
	0%{transform:rotateX(0);opacity:100;}
	50%{transform:rotateX(-90deg);opacity:100;}
	51%{transform:rotateX(-90deg);opacity:0;}
	100%{transform:rotateX(-180deg);opacity:0;}
}
@keyframes countDown_flip_2{
	0%{transform:rotateX(0);opacity:0;}
	50%{transform:rotateX(-90deg);opacity:0;}
	51%{transform:rotateX(-90deg);opacity:100;}
	100%{transform:rotateX(-180deg);opacity:100;}
}

@lordganymed lordganymed changed the title iPhone strange css bug iPhone Safari strange css bug (z-index in animation) Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant