Skip to content

Commit

Permalink
feat: 更新背景图片配置
Browse files Browse the repository at this point in the history
  • Loading branch information
everfu committed Jul 11, 2024
1 parent f008519 commit 89da235
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ expire:
# Background image
background:
enable: false
img: https://img.truimo.com/2022/807b270630a51.jpg
opacity: 0.2
dark: https://bu.dusays.com/2023/09/29/651685ce667d1.jpg
light: https://bu.dusays.com/2023/09/29/651685cc18d39.jpg

# CDN
# Don't modify the following settings unless you know how they work
Expand Down
4 changes: 4 additions & 0 deletions layout/includes/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ html(lang=config.language, data-theme="light")
if theme.display_mode.universe
canvas#universe

// background img
if theme.background.enable
#global_bg

// loading
if theme.loading.fullpage
include ./loading.pug
Expand Down
31 changes: 16 additions & 15 deletions source/css/_global/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ body
user-select none
-webkit-user-select none

if hexo-config('background.enable')
&:before
top 0
left 0
right 0
bottom 0
z-index -1
content ""
position fixed
pointer-events none
background-blend-mode multiply
opacity hexo-config('background.opacity')
background url(hexo-config('background.img')) center / cover;

*
box-sizing border-box

Expand Down Expand Up @@ -443,4 +429,19 @@ if hexo-config('memorial.enable')
-moz-filter grayscale(100%)
-ms-filter grayscale(100%)
-o-filter grayscale(100%)
filter grayscale(100%)
filter grayscale(100%)

if hexo-config('background.enable')
#global_bg
position fixed
z-index 999
opacity .2
width 100%
height 100%
background-image url(hexo-config('background.light'))
background-size cover
pointer-events none
background-repeat no-repeat

[data-theme=dark] &
background-image url(hexo-config('background.dark'))

0 comments on commit 89da235

Please sign in to comment.