Анимация заканчивается рывком, как сделать ее плавной
Анимация на css, запустите пример, чтобы увидеть. Каждые 6 секунд прерывается и начинается по новой. Как сделать, чтобы она была плавно бесконечной, подскажите? :)
body {
background-color: #000000;
}
.hero-waves {
display: block;
width: 100%;
height: 60px;
position: relative;
z-index: 2;
}
.wave1 use {
-webkit-animation: hero-wave1 10s linear infinite;
animation: hero-wave1 10s linear infinite;
-webkit-animation-delay: -2s;
animation-delay: -2s;
}
.wave2 use {
-webkit-animation: hero-wave2 8s linear infinite;
animation: hero-wave2 8s linear infinite;
-webkit-animation-delay: -2s;
animation-delay: -2s;
}
.wave3 use {
-webkit-animation: hero-wave3 6s linear infinite;
animation: hero-wave3 6s linear infinite;
-webkit-animation-delay: -2s;
animation-delay: -2s;
}
@-webkit-keyframes hero-wave1 {
0% {
transform: translate(85px, 0%);
}
100% {
transform: translate(-90px, 0%);
}
}
@keyframes hero-wave1 {
0% {
transform: translate(85px, 0%);
}
100% {
transform: translate(-90px, 0%);
}
}
@-webkit-keyframes hero-wave2 {
0% {
transform: translate(-90px, 0%);
}
100% {
transform: translate(85px, 0%);
}
}
@keyframes hero-wave2 {
0% {
transform: translate(-90px, 0%);
}
100% {с
transform: translate(85px, 0%);
}
}
@-webkit-keyframes hero-wave3 {
0% {
transform: translate(-90px, 0%);
}
100% {
transform: translate(85px, 0%);
}
}
@keyframes hero-wave3 {
0% {
transform: translate(-90px, 0%);
}
100% {
transform: translate(85px, 0%);
}
}
<svg class="hero-waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28 " preserveAspectRatio="none">
<defs>
<path id="wave-path" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z">
</defs>
<g class="wave1">
<use xlink:href="#wave-path" x="50" y="3" fill="rgba(255,255,255, .1)">
</g>
<g class="wave2">
<use xlink:href="#wave-path" x="50" y="0" fill="rgba(255,255,255, .2)">
</g>
<g class="wave3">
<use xlink:href="#wave-path" x="50" y="9" fill="#fff">
</g>
</svg>
Ответы (1 шт):
Автор решения: Gurev Aleksey
→ Ссылка
У Вас опечатка в коде
@keyframes hero-wave2 {
0% {
transform: translate(-90px, 0%);
}
100% {с
transform: translate(85px, 0%);
}
}
Символ с оказался не в том месте :)