summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2020-02-27 12:09:57 +0800
committerGitHub <noreply@github.com>2020-02-27 12:09:57 +0800
commita5e7bf113274a9288b0728c625934ebf3cda7533 (patch)
treed86bc51639a21cf91c418c1e2439806310bddbf7
parentd8358ad37b4ac5f9a6029a09d6c517cbf444c6a9 (diff)
:wink: Perf: 移除首页大图颜色选项
-rw-r--r--includes/header.php6
-rwxr-xr-xlibs/Options.php2
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"'));