Add option for fixed background

This commit is contained in:
Pig Fang 2019-07-10 10:53:19 +08:00
parent a082bec096
commit c387794e17
8 changed files with 29 additions and 3 deletions

View File

@ -113,6 +113,8 @@ class AdminController extends Controller
$form->checkbox('hide_intro')->label();
$form->checkbox('fixed_bg')->label();
$form->select('copyright_prefer')
->option('0', 'Powered with ❤ by Blessing Skin Server.')
->option('1', 'Powered by Blessing Skin Server.')

View File

@ -2,7 +2,6 @@ body
font-size 16px
.layout-top-nav > .hp-wrapper
background-color #eaeaea
// background image settings
background-size cover
background-repeat no-repeat
@ -162,6 +161,13 @@ hr
.hp-wrapper
width 100%
#fixed-bg
position fixed
z-index -1
height 100vh
width 100%
background-size cover
/* ==========================================================================
Wrap Sections
========================================================================== */
@ -169,6 +175,7 @@ Wrap Sections
#intro
padding 50px 0 50px
border-top #bdc3c7 solid 5px
background-color white
i
font-size 80px

View File

@ -16,6 +16,9 @@ homepage:
hide_intro:
title: Hide Introduction at Bottom
label: Scroll bar will be disabled if this option is enabled, as version 2.x.
fixed_bg:
title: Fixed Background
label: This option will make background fixed, not scrolled with scroll bar.
copyright_prefer:
title: Program Copyright
description: "You can specify a different style of program copyright for each language. To edit a specific language's corresponding program copyright style, please switch to that language and submit your edit. <br><b>Warning:</b> Any evil modification applied on the footer program copyright (including deleting, modifying author, changing link target) with out permission is <b>FORBIDDEN</b>. The author reserves the right to pursue relevant responsibilities."

View File

@ -12,10 +12,13 @@ homepage:
description: 所使用的图像必须具有相同的宽度和高度(留空以使用默认图标)
transparent_navbar:
title: 首页导航栏透明
label: 开启后首页顶部的导航栏将透明化,但页面滚动到底部时会变为不透明
label: 开启后首页顶部的导航栏将透明化,但页面滚动到底部时会变为不透明
hide_intro:
title: 隐藏底部的网站介绍
label: 开启后页面将不再需要滚动条,就像 2.x 版本中的首页那样。
label: 开启后页面将不再需要滚动条,就像 2.x 版本中的首页那样
fixed_bg:
title: 固定首页背景
label: 开启后背景不会随页面滚动而滚动
copyright_prefer:
title: 程序版权信息
description: 每种支持的语言都可以对应不同的程序版权信息,如果想要编辑某种特定语言下的版权信息,请在右上角切换至该语言后再提交修改。<b>对于任何恶意修改页面右下角的版权信息(包括不限于删除、修改作者信息、修改链接指向)的用户,作者保留对其追究责任的权利。</b>

View File

@ -2,6 +2,7 @@
- Added experimental Laradock (Docker) support.
- Added option for hiding introduction of home page. (Like 2.x)
- Added option for fixed background.
## Tweaked

View File

@ -2,6 +2,7 @@
- 增加 Docker 支持。(实验性)
- 增加「隐藏首页底部的网站介绍」的选项(即 2.x 时的样式)
- 增加「固定首页背景」的选项
## 调整

View File

@ -13,7 +13,11 @@
@include('common.dependencies.style')
<style>
.hp-wrapper {
@if (option('fixed_bg'))
background-color: rgba(0, 0, 0, 0);
@else
background-image: url('{{ $home_pic_url }}');
@endif
height: 100vh;
}
@ -38,6 +42,9 @@
<body class="hold-transition {{ option('color_scheme') }} layout-top-nav">
<div class="hp-wrapper">
@if (option('fixed_bg'))
<div id="fixed-bg" style="background-image: url('{{ $home_pic_url }}')"></div>
@endif
<!-- Navigation -->
<header class="main-header {{ $transparent_navbar ? 'transparent' : ''}}">
<nav class="navbar navbar-fixed-top">

View File

@ -32,6 +32,7 @@ class AdminConfigurationsTest extends BrowserKitTestCase
->type('url', 'favicon_url')
->check('transparent_navbar')
->check('hide_intro')
->check('fixed_bg')
->select('1', 'copyright_prefer')
->type('copyright', 'copyright_text')
->press('submit_homepage');
@ -39,6 +40,7 @@ class AdminConfigurationsTest extends BrowserKitTestCase
$this->assertEquals('url', option('favicon_url'));
$this->assertTrue(option('transparent_navbar'));
$this->assertTrue(option('hide_intro'));
$this->assertTrue(option('fixed_bg'));
$this->assertEquals('1', option('copyright_prefer'));
$this->assertEquals('copyright', option('copyright_text'));