欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 前端技术 > CSS >内容正文

CSS

css3 线条出现动画效果,CSS3实现的线条波浪动画效果

发布时间:2025/3/21 CSS 52 豆豆
生活随笔 收集整理的这篇文章主要介绍了 css3 线条出现动画效果,CSS3实现的线条波浪动画效果 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

HTML结构

该css3线条波浪动画效果的HTML结构如下:

CSS样式

然后通过下面的CSS代码来制作线条波浪动画效果。

@keyframes move_wave {

0% {

transform: translateX(0) translateZ(0) scaleY(1)

}

50% {

transform: translateX(-25%) translateZ(0) scaleY(0.55)

}

100% {

transform: translateX(-50%) translateZ(0) scaleY(1)

}

}

.waveWrapper {

overflow: hidden;

position: absolute;

left: 0;

right: 0;

bottom: 0;

top: 0;

margin: auto;

}

.waveWrapperInner {

position: absolute;

width: 100%;

overflow: hidden;

height: 100%;

bottom: -1px;

background-image: linear-gradient(to top, #86377b 20%, #27273c 80%);

}

.bgTop {

z-index: 15;

opacity: 0.5;

}

.bgMiddle {

z-index: 10;

opacity: 0.75;

}

.bgBottom {

z-index: 5;

}

.wave {

position: absolute;

left: 0;

width: 200%;

height: 100%;

background-repeat: repeat no-repeat;

background-position: 0 bottom;

transform-origin: center bottom;

}

.waveTop {

background-size: 50% 100px;

}

.waveAnimation .waveTop {

animation: move-wave 3s;

-webkit-animation: move-wave 3s;

-webkit-animation-delay: 1s;

animation-delay: 1s;

}

.waveMiddle {

background-size: 50% 120px;

}

.waveAnimation .waveMiddle {

animation: move_wave 10s linear infinite;

}

.waveBottom {

background-size: 50% 100px;

}

.waveAnimation .waveBottom {

animation: move_wave 15s linear infinite;

}

总结

以上是生活随笔为你收集整理的css3 线条出现动画效果,CSS3实现的线条波浪动画效果的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。