summaryrefslogtreecommitdiffstats
path: root/includes/header.php
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2020-02-29 11:36:36 +0800
committerGitHub <noreply@github.com>2020-02-29 11:36:36 +0800
commit658b67a078f7464e9980a4c2d1a795ba6e1c57ef (patch)
treeda3301dd6f81939548c4fead5b7bef8755f9a2cf /includes/header.php
parent28bfee0651f4609d5b2982a7828fb892c9f13264 (diff)
✂️ Perf: 优化首页大图
Diffstat (limited to 'includes/header.php')
-rw-r--r--includes/header.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/header.php b/includes/header.php
index 8530ddf..8ec824f 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -95,13 +95,15 @@
<?php endif; ?>
<div id="pjax-container"><!-- 开始 pjax-container -->
<header>
+ <!-- Banner -->
<?php if($this->is('post') || $this->is('page')): ?>
- <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;">
+ <div class="index-banner" style="background-position:center!important;<?php if($this->fields->banner && $this->fields->banner=!''): ?>background-image: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!important;<?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;background-image:url<?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;">
+ <div class="index-banner" style="background-position:center;background-image: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">
<div class="banner-content<?php if($this->is('index') && $this->options->bannerFont==1): ?> banner-font-black<?php endif; ?><?php if($this->is('page') || $this->is('post')): if($this->fields->banner==''): ?> banner-font-black<?php endif; endif; ?>" id="banner-content">