From c387794e17762d68e1210546fc048261813fe684 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 10 Jul 2019 10:53:19 +0800 Subject: [PATCH] Add option for fixed background --- app/Http/Controllers/AdminController.php | 2 ++ resources/assets/src/styles/home.styl | 9 ++++++++- resources/lang/en/options.yml | 3 +++ resources/lang/zh_CN/options.yml | 7 +++++-- resources/misc/changelogs/en/4.4.0.md | 1 + resources/misc/changelogs/zh_CN/4.4.0.md | 1 + resources/views/index.blade.php | 7 +++++++ tests/AdminConfigurationsTest.php | 2 ++ 8 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index ffda7561..feb92554 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -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.') diff --git a/resources/assets/src/styles/home.styl b/resources/assets/src/styles/home.styl index 68e4a225..eca6c0d1 100644 --- a/resources/assets/src/styles/home.styl +++ b/resources/assets/src/styles/home.styl @@ -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 diff --git a/resources/lang/en/options.yml b/resources/lang/en/options.yml index eb3c5b7c..aa18ba11 100644 --- a/resources/lang/en/options.yml +++ b/resources/lang/en/options.yml @@ -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.
Warning: Any evil modification applied on the footer program copyright (including deleting, modifying author, changing link target) with out permission is FORBIDDEN. The author reserves the right to pursue relevant responsibilities." diff --git a/resources/lang/zh_CN/options.yml b/resources/lang/zh_CN/options.yml index 0e9636c8..7e405c3c 100644 --- a/resources/lang/zh_CN/options.yml +++ b/resources/lang/zh_CN/options.yml @@ -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: 每种支持的语言都可以对应不同的程序版权信息,如果想要编辑某种特定语言下的版权信息,请在右上角切换至该语言后再提交修改。对于任何恶意修改页面右下角的版权信息(包括不限于删除、修改作者信息、修改链接指向)的用户,作者保留对其追究责任的权利。 diff --git a/resources/misc/changelogs/en/4.4.0.md b/resources/misc/changelogs/en/4.4.0.md index 06d02e91..bf2cf863 100644 --- a/resources/misc/changelogs/en/4.4.0.md +++ b/resources/misc/changelogs/en/4.4.0.md @@ -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 diff --git a/resources/misc/changelogs/zh_CN/4.4.0.md b/resources/misc/changelogs/zh_CN/4.4.0.md index af78e64a..b6f96c82 100644 --- a/resources/misc/changelogs/zh_CN/4.4.0.md +++ b/resources/misc/changelogs/zh_CN/4.4.0.md @@ -2,6 +2,7 @@ - 增加 Docker 支持。(实验性) - 增加「隐藏首页底部的网站介绍」的选项(即 2.x 时的样式) +- 增加「固定首页背景」的选项 ## 调整 diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 636c1954..22305789 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -13,7 +13,11 @@ @include('common.dependencies.style')