这是一款子比主题顶部多功能组件下面滚动波浪的动画,并且在子比主题中实现幻灯片循环滚动波浪动画效果,并且适配了子比主题白天/昼夜切换,这篇文章转载于腾飞博客,如果搬运请留下版权,喜欢的自行部署吧!
演示图片
代码部署
一共两个代码,一个是CSS样式,一个是JS代码,直接在子比主题后台 自定义代码 部署就行,话不多说直接开始!
CSS代码
.parallax {
fill: var(--body-bg-color);
}
.parallax > use {
animation: move-forever 30s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}
.parallax > use:nth-child(1) {
animation-delay: -2s;
animation-duration: 7s;
opacity: 0.5;
}
.parallax > use:nth-child(2) {
animation-delay: -3s;
animation-duration: 10s;
opacity: 0.6;
}
.parallax > use:nth-child(3) {
animation-delay: -4s;
animation-duration: 13s;
opacity: 0.7;
}
.parallax > use:nth-child(4) {
animation-delay: -5s;
animation-duration: 20s;
opacity: 1;
}
@keyframes move-forever {
0% {
transform: translate3d(-90px, 0, 0);
}
100% {
transform: translate3d(85px, 0, 0);
}
}
JS代码
<script src="/wp-content/themes/zibll/xiaogongju/daen/js/tengfei_slide_wave.js"></script>
谢谢分享
我去太好了
666