diff options
| -rw-r--r-- | includes/header.php | 6 | ||||
| -rwxr-xr-x | libs/Options.php | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/includes/header.php b/includes/header.php index 667357d..9caec0b 100644 --- a/includes/header.php +++ b/includes/header.php @@ -151,11 +151,11 @@ <div id="pjax-container"><!-- 开始 pjax-container --> <header> <?php if($this->is('post') || $this->is('page')): ?> - <div class="index-banner" style="background-position:center;<?php if($this->fields->banner && $this->fields->banner=!''): ?>background:url('<?php $this->fields->banner(); ?>') no-repeat;<?php else: ?>background-color:<?php $this->options->bannerColor(); ?>;<?php endif; ?>height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;"> + <div class="index-banner" style="background-position:center!important;<?php if($this->fields->banner && $this->fields->banner=!''): ?>background:url('<?php $this->fields->banner(); ?>') no-repeat;<?php endif; ?>height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;"> <?php elseif($this->is('archive')): ?> - <div class="index-banner" style="height:<?php $this->options->bannerHeight(); ?>vh;background-position:center;background-color:<?php $this->options->bannerColor(); ?>;<?php if($this->options->bannerUrl!=''): echo $this->options->bannerUrl(); endif; ?>"> + <div class="index-banner" style="height:<?php $this->options->bannerHeight(); ?>vh;background-position:center!important;<?php if($this->options->bannerUrl!=''): echo $this->options->bannerUrl(); endif; ?>"> <?php else: ?> - <div class="index-banner" style="background-position:center;background:url('<?php $this->options->bannerUrl(); ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;background-color:<?php $this->options->bannerColor(); ?>"> + <div class="index-banner" style="background-position:center;background:url('<?php $this->options->bannerUrl(); ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;"> <?php endif; ?> <div class="banner-mask"<?php if($this->is('post') || $this->is('page')):?><?php if($this->fields->banner==''):?> style="background:rgba(0,0,0,0)!important"<?php endif;?><?php endif; ?><?php if($this->is('index')):?><?php if($this->options->bannerUrl && $this->options->bannerUrl=!''): ?><?php else:?> style="background:rgba(0,0,0,0)!important"<?php endif;?><?php endif;?>> <div class="main-container container"> diff --git a/libs/Options.php b/libs/Options.php index ce3272b..cd0dd54 100755 --- a/libs/Options.php +++ b/libs/Options.php @@ -94,8 +94,6 @@ function themeConfig($form) { //index-banner
$bannerUrl = new Typecho_Widget_Helper_Form_Element_Text('bannerUrl', NULL, 'https://s2.ax1x.com/2019/07/10/ZcRGX8.png', _t('<h2>首页大图 Banner</h2>图片 Url'), _t('首页大图的图片地址'));
$form->addInput($bannerUrl);
- $bannerColor = new Typecho_Widget_Helper_Form_Element_Text('bannerColor', NULL, NULL, _t('背景色'), _t('填写 16 进制颜色代码或 rgb 值,方便某些懒得找图的懒人(比如我就是!)'));
- $form->addInput($bannerColor);
$bannerFont = new Typecho_Widget_Helper_Form_Element_Select('bannerFont',array('0'=>'白色','1'=>'黑色'),'0','字体颜色','为了兼容不同的底色和背景色');
$form->addInput($bannerFont);
$bannerHeight = new Typecho_Widget_Helper_Form_Element_Text('bannerHeight', NULL, '60', _t('高度'), _t('首页大图所占屏幕的高度,100为最大,填入纯数字,如"35"'));
|
