Tôi cố gắng tạo hoạt ảnh chạy 3 giây một lần mà không cần JavaScript. Thời lượng hoạt ảnh của tôi là 1 giây.Tạm dừng trong hoạt ảnh CSS3 vô hạn
Tôi chỉ có thể đợi 3 giây sau lần xuất hiện đầu tiên sau đó là vòng lặp hoạt ảnh 1 giây.
Mã của tôi cho đến nay: https://jsfiddle.net/belut/aojp8ozn/32/
.face.back {
-webkit-animation: BackRotate 1s linear infinite;
-webkit-animation-delay: 3s;
animation: BackRotate 1s linear infinite;
animation-delay: 3s;
}
.face.front {
-webkit-animation: Rotate 1s linear infinite;
-webkit-animation-delay: 3s;
animation: Rotate 1s linear infinite;
animation-delay: 3s;
}
@-webkit-keyframes Rotate {
from {-webkit-transform:rotateY(0deg);}
to {-webkit-transform:rotateY(360deg);}
}
@-webkit-keyframes BackRotate {
from {-webkit-transform:rotateY(180deg);}
to {-webkit-transform:rotateY(540deg);}
}
@keyframes Rotate {
from {-webkit-transform:rotateY(0deg);}
to {-webkit-transform:rotateY(360deg);}
}
@keyframes BackRotate {
from {-webkit-transform:rotateY(0deg);}
to {-webkit-transform:rotateY(360deg);}
}
tôi biết làm thế nào để làm điều đó với javascript: https://jsfiddle.net/belut/fk3f47jL/1/
tôi đã cố gắng câu trả lời này nhưng không thành công: Cycling CSS3 animation with a pause period?
bạn có thể giúp tôi xin vui lòng?
EDIT Cảm ơn câu trả lời tuyệt vời tôi cũng là có thể làm cho tình huống này: 2s chờ đợi, chạy 1s lật, chờ 2s, 1s chạy back_flip, đợi 2s.
#f1_container {
position: relative;
margin: 10px auto;
width: 90px;
height: 90px;
z-index: 1;
}
#f1_container {
perspective: 1000;
}
#f1_card {
width: 100%;
height: 100%;
}
img {
width: 90px;
height: 90px;
}
.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.face.back {
display: block;
transform: rotateY(180deg);
}
.face.back {
-webkit-animation: BackRotate 5s linear infinite;
}
.face.front {
-webkit-animation: Rotate 5s linear infinite;
}
@-webkit-keyframes Rotate {
0%,40% {-webkit-transform:rotateY(0deg);}
50%,90% {-webkit-transform:rotateY(180deg);}
100% {-webkit-transform:rotateY(360deg);}
}
@-webkit-keyframes BackRotate {
0%,40% {-webkit-transform:rotateY(180deg);}
50%,90% {-webkit-transform:rotateY(360deg);}
100% {-webkit-transform:rotateY(540deg);}
}
Đánh bại tôi. Tôi đã bình luận và đang xây dựng bản demo. :) - https://jsfiddle.net/aojp8ozn/36/ –
@Paulie_D Ah, xin lỗi về điều đó. Tôi đã thấy bình luận của bạn sau khi tôi gửi nó. Ước gì tôi có thể cung cấp cho bạn một upvote –
Không có vấn đề Bạn có câu trả lời. Tôi không phải là tuyệt vọng cho đại diện:> –