使用 CSS3 Animation 复现
直接扒 JS 代码固然省时省力……【省嘛?好像没有吧,当初扒的时候眼睛都快瞎了】,但是 JS 似乎不是每次都起作用……
然后我就自己用 CSS3 Animation 重写这个动画。CSS 如下:
#banner_wave_1 { width: auto; height: 65px; background: url(https://view.amogu.cn/images/2020/08/30/wave_1.png) repeat-x; _filter: alpha(opacity=80); position: absolute; bottom: 0; width: 400%; left: -236px; z-index: 5; opacity: 1; transiton-property: opacity, bottom; transition-duration: .4s, .4s; animation-name: move2; animation-duration: 240s; animation-fill-mode: backwards; animation-timing-function: linear; animation-iteration-count: infinite; } #banner_wave_2 { width: auto; height: 80px; background: url(https://view.amogu.cn/images/2020/08/30/wave_2.png) repeat-x; _filter: alpha(opacity=80); position: absolute; bottom: 0; width: 400%; left: 0; z-index: 4; opacity: 1; transiton-property: opacity, bottom; transition-duration: .4s, .4s; animation-name: move2; animation-duration: 160s; animation-fill-mode: backwards; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes move1 { 100% { background-position: 100% 0; } } @keyframes move2 { 100% { background-position: -100% 0; } }
|
波浪图片可以自己保存但是不要直接引用……叭,一分CDN流量一分钱啊TAT
两个DIV的穿插位置
在路径 /wp-content/themes/Sakura/layouts下,打开 imgbox.php。在下面所述位置插入。
…… <style>.header-info::before{display: none !important;opacity: 0 !important;}</style> <div id="banner_wave_1"></div><div id="banner_wave_2"></div><!--两个DIV插在这。--> <figure id="centerbg" class="centerbg"> <?php if ( !akina_option('focus_infos') ){ ?> <div class="focusinfo"> <?php if (akina_option('focus_logo')):?> ……
|
转自 https://m1314.cn/148.html