hey y’all i have a little issue. so i’ve been trying to make some background pulses for my game and i came across an issue. the graident pulses arent smooth. How can I fix this?
code:
.leftPlayerGradient, .rightPlayerGradient {
position: fixed;
width: 100%;
height: 100%;
background-image: linear-gradient(90deg, rgba(77,77,77,0) -100%, rgba(77,77,77,0) 100%);
z-index: 1;
}
.leftAttack {
animation: leftFlash 3s linear infinite;
}
.rightAttack {
animation: rightFlash 3s infinite;
}
.leftBlockUp {
animation: leftBlock 1s infinite;
}
.rightBlockUp {
animation: rightBlock 1s infinite;
}
@keyframes leftFlash {
0% {
background-image: linear-gradient(90deg, rgba(0,255,0,0.5) -100%, rgba(77,77,77,0) 100%);
}
50% {
background-image: linear-gradient(90deg, rgba(0,128,0,0.5) -100%, rgba(77,77,77,0) 100%);
}
100% {
background-image: linear-gradient(90deg, rgba(77,77,77,0) -100%, rgba(77,77,77,0) 100%);
}
}
@keyframes rightFlash {
0% {
background: linear-gradient(90deg, rgba(77,77,77,0) 0%, rgba(0,255,0,0.5) 200%);
}
100% {
background: linear-gradient(90deg, rgba(77,77,77,0) 0%, rgba(77,77,77,0) 100%;
}
}
@keyframes leftBlock {
0% {
background: linear-gradient(90deg, rgba(0,61,255,0.5) -100%, rgba(77,77,77,0) 100%);
}
100% {
background: linear-gradient(90deg, rgba(0,99,255,0.5) -100%, rgba(77,77,77,0) 100%);
}
}
@keyframes rightBlock {
0% {
background: linear-gradient(90deg, rgba(77,77,77,0) 0%, rgba(0,61,255,0.5) 200%);
}
100% {
background: linear-gradient(90deg, rgba(77,77,77,0) 0%, rgba(0,99,255,0.5) 200%);
}
}
html for overlayed gradients:
<div class="leftPlayerGradient"></div>
<div class="rightPlayerGradient"></div>