0
Hello, I’m trying to put a delay in my Buzz out animation after each loop, I’m applying it in a text, which is inside the p tag. I’ve looked for several answers and most of them say to put the first percentage at 33%, so that there is a delay, I understood the concept, but it doesn’t seem to apply to my problem.
My html code
<div className={style.container}>
<div className={style.divImage}>
<img src={image} alt="" className={style.image} />
</div>
<p onClick={onClick} className={style.text}>
{text}
</p>
</div>
My css code
.text {
font-family: RobotoCondensedBold;
color: #7c7c7c;
font-size: 22px;
animation: text 1s linear infinite;
animation-delay: 1s;
cursor: pointer;
}
/* @-webkit-keyframes text {
10% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
20% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
30% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
40% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
50% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
60% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
70% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
80% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
90% {
-webkit-transform: translateX(1px) rotate(0);
transform: translateX(1px) rotate(0);
}
100% {
-webkit-transform: translateX(-1px) rotate(0);
transform: translateX(-1px) rotate(0);
}
} */
@keyframes text {
10% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
20% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
30% {
-webkit-transform: translateX(3px) rotate(2deg);
transform: translateX(3px) rotate(2deg);
}
40% {
-webkit-transform: translateX(-3px) rotate(-2deg);
transform: translateX(-3px) rotate(-2deg);
}
50% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
60% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
70% {
-webkit-transform: translateX(2px) rotate(1deg);
transform: translateX(2px) rotate(1deg);
}
80% {
-webkit-transform: translateX(-2px) rotate(-1deg);
transform: translateX(-2px) rotate(-1deg);
}
90% {
-webkit-transform: translateX(1px) rotate(0);
transform: translateX(1px) rotate(0);
}
100% {
-webkit-transform: translateX(-1px) rotate(0);
transform: translateX(-1px) rotate(0);
}
}
.text {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
}
.text:hover,
.text:focus,
.text:active {
-webkit-animation-name: text;
animation-name: text;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
animation-iteration-count: 1;
}
If anyone can tell me what I’m doing wrong I’ll be very grateful, Thank you!
I’m not very familiar with the concept of animation using just css, I ended up getting confused when trying to understand, I thank you for the very detailed explanation, I would like to ask if you wouldn’t have any material to tell me about it, I intend to understand more about these concepts of animations. Thank you very much.
– Pedro
Guy on Youtube yourself you find some material, but also I recommend the Mozilla doc, but the main and you train, try to replicate animations and test the properties to go seeing what happens etc...
– hugocsl