mirror of https://github.com/mashirozx/sakura.git
添加支持首页波浪
parent
e918b590e6
commit
d161d48951
|
@ -87,6 +87,15 @@ window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}
|
|||
?>
|
||||
<div class="headertop <?php echo $filter; ?>">
|
||||
<?php get_template_part('layouts/imgbox'); ?>
|
||||
<?php if (akina_option('homewave') == true) { ?>
|
||||
<div id="banner_wave_1"></div>
|
||||
<div id="banner_wave_2"></div>
|
||||
<div class="headertop-down faa-float animated" onclick="headertop_down()">
|
||||
<span>
|
||||
<i class="fa fa-chevron-down" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="page" class="site wrapper">
|
||||
|
|
|
@ -1976,3 +1976,31 @@ if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventL
|
|||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
//首页 波浪 播放视频时自动隐藏
|
||||
var visible="visible";
|
||||
window.onload=function(){
|
||||
document.getElementById('video-btn').onclick=function (){
|
||||
if(visible=="visible")
|
||||
{
|
||||
visible="hidden";
|
||||
}else{
|
||||
visible="visible";
|
||||
}
|
||||
try{
|
||||
banner_wave_1.style="visibility: "+visible+";";
|
||||
}catch(Error){}
|
||||
try{
|
||||
banner_wave_2.style="visibility: "+visible+";";
|
||||
}catch(Error){}
|
||||
};
|
||||
};
|
||||
|
||||
//首页 向下箭头 onclick
|
||||
function headertop_down()
|
||||
{
|
||||
var coverOffset = $('#content').offset().top;
|
||||
$('html,body').animate({
|
||||
scrollTop: coverOffset
|
||||
}, 600);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,33 @@
|
|||
'''
|
||||
一个简易的修改行号脚本,当前只添加options.php的行号修改,start是修改起始行,行号大于这个值才会被修改,修改规则是将匹配到的行号值加上offset。
|
||||
'''
|
||||
|
||||
import re
|
||||
|
||||
update_files = ['en_US.po', 'zh_CN.po']
|
||||
|
||||
update_content = 'options.php'
|
||||
|
||||
start = 218
|
||||
offset = 7
|
||||
|
||||
for i in update_files:
|
||||
mod_lines = []
|
||||
with open(i, 'r', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
items = line.split(' ')
|
||||
mod_items = []
|
||||
for item in items:
|
||||
cur = re.findall(r'%s:(\d+)' % update_content, item)
|
||||
if cur:
|
||||
before = int(cur[0])
|
||||
after = (before + offset) if before > start else before
|
||||
item = re.sub('%s:%d' % (update_content, before), '%s:%d' % (update_content, after), item)
|
||||
print(before, item)
|
||||
mod_items.append(item)
|
||||
mod_lines.append(' '.join(mod_items))
|
||||
print(mod_lines)
|
||||
|
||||
with open(i, 'w+', encoding='utf-8') as f:
|
||||
for line in mod_lines:
|
||||
f.write(line)
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -224,6 +224,13 @@ function optionsframework_options()
|
|||
'no' => __('Close', 'sakura'),
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Homewave', 'sakura'),
|
||||
'desc' => __('Display wave in home page.', 'sakura'),
|
||||
'id' => 'homewave',
|
||||
'std' => '1',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Home article style', 'sakura'), /*首页文章风格*/
|
||||
'id' => 'post_list_style',
|
||||
|
|
79
style.css
79
style.css
|
@ -1274,6 +1274,85 @@ a:hover {
|
|||
color: #545454
|
||||
}
|
||||
|
||||
#banner_wave_1 {
|
||||
width: auto;
|
||||
height: 65px;
|
||||
background: url(https://cdn.qnight.ink/blogfile/wave1.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://cdn.qnight.ink/blogfile/wave2.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;
|
||||
}
|
||||
}
|
||||
|
||||
.banner_wave_hide,.banner_wave_hide_fit_skin {
|
||||
opacity:0 !important;
|
||||
bottom:-999px !important
|
||||
}
|
||||
|
||||
.headertop-down {
|
||||
position:absolute;
|
||||
bottom:50px;
|
||||
left:calc(50% - 14px);
|
||||
cursor:pointer;
|
||||
z-index:5
|
||||
}
|
||||
|
||||
@media(max-width:860px) {
|
||||
.headertop-down {
|
||||
display:none
|
||||
}
|
||||
}
|
||||
|
||||
.headertop-down i {
|
||||
font-size:28px;
|
||||
color:#fff;
|
||||
-ms-transform:scale(1.5,1);
|
||||
-webkit-transform:scale(1.5,1);
|
||||
transform:scale(1.5,1)
|
||||
}
|
||||
|
||||
.site-main {
|
||||
padding: 40px 0 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue