Skip to content

Commit e4209f7

Browse files
committed
遮罩效果
1 parent e2e93c2 commit e4209f7

File tree

6 files changed

+29
-3
lines changed

6 files changed

+29
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "notion-next",
3-
"version": "3.13.1",
3+
"version": "3.13.2",
44
"homepage": "https://github.com/tangly1024/NotionNext.git",
55
"license": "MIT",
66
"repository": {

public/css/theme-hexo.css

+10
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,13 @@
1313
color: #928CEE;
1414
}
1515

16+
/* 设置了从上到下的渐变黑色 */
17+
#theme-hexo .header-cover::before {
18+
content: "";
19+
position: absolute;
20+
top: 0;
21+
left: 0;
22+
width: 100%;
23+
height: 100%;
24+
background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.5) 100%);
25+
}

public/css/theme-matery.css

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
/* 设置了从上到下的渐变黑色 */
3+
#theme-matery .header-cover::before {
4+
content: "";
5+
position: absolute;
6+
top: 0;
7+
left: 0;
8+
width: 100%;
9+
height: 100%;
10+
background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.5) 100%);
11+
}

themes/hexo/components/Header.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const Header = props => {
8686
<header id="header" style={{ zIndex: 1 }} className="w-full h-screen relative" >
8787

8888
<div id='header-cover' style={{ backgroundImage: `url('${siteInfo.pageCover}')` }}
89-
className={`w-full h-screen bg-cover ${CONFIG_HEXO.HOME_NAV_BACKGROUND_IMG_FIXED ? 'bg-fixed' : ''}`}/>
89+
className={`header-cover w-full h-screen bg-cover ${CONFIG_HEXO.HOME_NAV_BACKGROUND_IMG_FIXED ? 'bg-fixed' : ''}`}/>
9090

9191
<div className="text-white absolute bottom-0 flex flex-col h-full items-center justify-center w-full ">
9292
<div className='text-4xl md:text-5xl shadow-text'>{siteInfo?.title}</div>

themes/matery/LayoutBase.js

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useGlobal } from '@/lib/global'
1010
import BLOG from '@/blog.config'
1111
import FloatDarkModeButton from './components/FloatDarkModeButton'
1212
import throttle from 'lodash.throttle'
13+
import { isBrowser, loadExternalResource } from '@/lib/utils'
1314

1415
/**
1516
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
@@ -36,6 +37,10 @@ const LayoutBase = props => {
3637
return () => document.removeEventListener('scroll', scrollListener)
3738
}, [])
3839

40+
if (isBrowser()) {
41+
loadExternalResource('/css/theme-matery.css', 'css')
42+
}
43+
3944
return (
4045
<div id='theme-matery' className="min-h-screen flex flex-col justify-between bg-hexo-background-gray dark:bg-black w-full">
4146

themes/matery/components/Header.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const Header = props => {
102102
</div>
103103

104104
<div id='header-cover' style={{ backgroundImage: `url('${siteInfo.pageCover}')` }}
105-
className={`w-full h-screen bg-cover ${CONFIG_MATERY.HOME_NAV_BACKGROUND_IMG_FIXED ? 'bg-fixed' : ''}`}/>
105+
className={`header-cover w-full h-screen bg-cover ${CONFIG_MATERY.HOME_NAV_BACKGROUND_IMG_FIXED ? 'bg-fixed' : ''}`}/>
106106

107107
</header>
108108
)

0 commit comments

Comments
 (0)