用css动画效果实现一个酷炫的波浪效果
时间: 2024-05-07 20:16:33 浏览: 118
swift-炫酷波浪效果动画
好的,我可以为您演示一个用CSS动画效果实现的酷炫波浪效果。请参考以下代码:
```
.wave {
width: 100%;
height: 200px;
position: relative;
}
.wave:before {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
background-image: linear-gradient(-45deg, #8BC34A 0%, #CDDC39 50%, #8BC34A 100%);
animation: wave 5s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
transform: translate3d(0, 0, 0);
z-index: 1;
opacity: 0.6;
}
.wave:after {
content: "";
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
background-image: linear-gradient(-45deg, #8BC34A 0%, #CDDC39 50%, #8BC34A 100%);
animation: wave 5s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
transform: translate3d(0, 0, 0);
z-index: 2;
opacity: 0.4;
}
@keyframes wave {
0% {
transform: translate3d(-90px, 0, 0);
}
100% {
transform: translate3d(85px, 0, 0);
}
}
```
这段代码会在指定的元素上创建一个波浪效果,您可以根据需要进行调整。希望这能帮助到您,有什么其他问题可以随时问我哦~
阅读全文