I need assistance in making the CSS code below responsive for phone screens.
It seems that the issue may be due to using pixel dimensions for the book sides (not included in this CSS), and I thought it could be solved by using vh/vw or % in the div.
Please refer to the code snippet provided:
@-webkit-keyframes rotatingAnimationX {
0%{
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
100% {
-webkit-transform: rotateX(360deg);
transform: rotateX(360deg);
}
}
@keyframes rotatingAnimationX {
0%{
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
100% {
-webkit-transform: rotateX(360deg);
transform: rotateX(360deg);
}
}
@-webkit-keyframes rotatingAnimationY {
0%{
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
100% {
-webkit-transform: rotateY(360deg);
transform: rotateY(360deg);
}
}
@keyframes rotatingAnimationY {
0%{
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
100% {
-webkit-transform: rotateY(360deg);
transform: rotateY(360deg);
}
}
@-webkit-keyframes rotatingAnimationZ {
0%{
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
100% {
-webkit-transform: rotateZ(360deg);
transform: rotateZ(360deg);
}
}
@keyframes rotatingAnimationZ {
0%{
-webkit-transform: rotateZ(0deg);
transform: rotateZ(0deg);
}
100% {
-webkit-transform: rotateZ(360deg);
transform: rotateZ(360deg);
}
}
.containerp {
/*width: 100vw;*/
height: 100vh;
overflow: hidden;
-webkit-perspective: 1200px;
perspective: 1200px;
display: -webkit-box;
display: -ms-flexbox;
/*display: flex;*/
-webkit-box-pack: center;
-ms-flex-pack: center;
/*justify-content: center;*/
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.containerp > div {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.boockup {
-webkit-transform: rotateX(29deg) rotateY(-88deg) rotateZ(0deg);
transform: rotateX(29deg) rotateY(-88deg) rotateZ(0deg);
}
.book-container {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-animation: 30s rotatingAnimationY linear infinite;
animation: 30s rotatingAnimationY linear infinite;
}
.book-container > div {
position: absolute;
top: 0;
left: 0;
background-size: cover;
background-position: center center;
-webkit-backface-visibility: visible;
backface-visibility: visible;
}
Your help is greatly appreciated. Thank you!