Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: 增加首页大图位置调整功能 #8

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@
<div id="pjax-container"><!-- 开始 pjax-container -->
<header>
<?php if($this->is('post') || $this->is('page')): ?>
<div class="index-banner" style="background:url('<?php if($this->fields->banner && $this->fields->banner=!''): ?><?php $this->fields->banner(); ?><?php else: ?><?php $this->options->bannerUrl(); ?><?php endif; ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;">
<div class="index-banner" style="background:url('<?php if($this->fields->banner && $this->fields->banner=!''): ?><?php $this->fields->banner(); ?><?php else: ?><?php $this->options->bannerUrl(); ?><?php endif; ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;<?php $this->options->bannerPosition(); ?>">
<?php else: ?>
<div class="index-banner" style="background:url('<?php $this->options->bannerUrl(); ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;">
<div class="index-banner" style="background:url('<?php $this->options->bannerUrl(); ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;<?php $this->options->bannerPosition(); ?>">
<?php endif; ?>
<div class="banner-mask">
<div class="main-container container">
Expand Down
2 changes: 2 additions & 0 deletions libs/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function themeConfig($form) {
$form->addInput($bannerTitle);
$bannerIntro = new Typecho_Widget_Helper_Form_Element_Text('bannerIntro', NULL, NULL, _t('介绍'), _t('这里是首页大图标题下的简介<hr>'));
$form->addInput($bannerIntro);
$bannerPosition = new Typecho_Widget_Helper_Form_Element_Select('bannerPosition', array(''=>'默认','background-position:center,center;'=>'垂直水平居中'), '0', '位置', '这里选择首页大图的显示位置,“默认”图片从左上角开始显示,“垂直水平居中”为图片垂直水品居中显示。');
$form->addInput($bannerPosition);

//pjax
$pjax = new Typecho_Widget_Helper_Form_Element_Select('pjax',array('0'=>'关闭','1'=>'开启'),'1','<h2>Pjax 预加载</h2>是否开启','Pjax 预加载功能的开关');
Expand Down