1- /* 主页 */
2- .homepage {
3- display : flex;
4- flex-direction : column;
5- justify-content : center;
1+ /* =========================================
2+ 1. 变量定义
3+ ========================================= */
4+ : root {
5+ /* 亮色模式背景图 */
6+ --home-bg-image : url ('../images/home_bg_light.png' );
7+ --hero-height : 100vh ;
8+ }
9+
10+ /* 暗黑模式适配 */
11+ [data-md-color-scheme = "slate" ] {
12+ --home-bg-image : url ('../images/home_bg_dark.png' );
13+ }
14+
15+ /* =========================================
16+ 2. 导航栏透明化处理 (强力版)
17+ ========================================= */
18+ .transparent-header {
19+ background-color : transparent !important ;
20+ background : transparent !important ;
21+ box-shadow : none !important ;
22+ border-bottom : none !important ;
23+ backdrop-filter : none !important ;
24+ -webkit-backdrop-filter : none !important ;
25+ }
26+
27+ .transparent-header .md-tabs {
28+ background-color : transparent !important ;
29+ background : transparent !important ;
30+ }
31+
32+ .transparent-header .md-header__title ,
33+ .transparent-header .md-tabs__link ,
34+ .transparent-header .md-header__button {
35+ text-shadow : 0 1px 3px rgba (0 , 0 , 0 , 0.6 );
36+ color : # fff !important ;
37+ }
38+
39+ /* =========================================
40+ 3. 修复“返回顶部”按钮层级 (Bug Fix)
41+ ========================================= */
42+ .md-top {
43+ /* 关键修复:原主题 z-index 较低,被我们的 hero 和 container 盖住了。
44+ 这里设置为 100,确保它永远在最上层,可点击且可见。 */
45+ z-index : 100 !important ;
46+
47+ /* 可选:为了让它在图片上更明显,可以加一点阴影 */
48+ box-shadow : 0 4px 10px rgba (0 , 0 , 0 , 0.3 ) !important ;
49+ }
50+
51+ /* =========================================
52+ 4. Hero 区域
53+ ========================================= */
54+ .mdx-hero {
55+ position : fixed;
56+ top : 0 ;
57+ left : 0 ;
58+ width : 100% ;
59+ height : var (--hero-height );
60+ z-index : 0 ;
61+ overflow : hidden;
62+ display : flex;
663 align-items : center;
7- margin-top : 5 % ;
8- font-size : 120 %
9- }
64+ justify-content : center ;
65+ will-change : transform;
66+ }
1067
11- .md-typeset a {
12- border-bottom : none;
68+ /* 背景图片层 */
69+ .mdx-hero__layer--bg {
70+ position : absolute;
71+ top : 0 ;
72+ left : 0 ;
73+ width : 100% ;
74+ height : 100% ;
75+ background-image : var (--home-bg-image );
76+ background-size : cover;
77+ background-position : center;
78+ z-index : 1 ;
79+ will-change : transform, opacity;
1380}
1481
15- [data-md-color-scheme = "slate" ] {
16- background-attachment : fixed;
17- background-repeat : no-repeat;
18- background-position : center center;
19- background-image : url ('../assets/images/home_background_dark.jpg' );
82+ /* =========================================
83+ 5. 统一蒙版效果 (Dark & Light)
84+ ========================================= */
85+
86+ /* --- 暗黑模式 (Slate) --- */
87+ [data-md-color-scheme = "slate" ] .mdx-hero__layer--bg {
88+ /* 底部羽化:80%处开始变透明,100%完全透明 */
89+ -webkit-mask-image : linear-gradient (to bottom, black 80% , transparent 100% );
90+ mask-image : linear-gradient (to bottom, black 80% , transparent 100% );
2091}
2192
93+ /* --- 浅色模式 (Default) - 现已启用蒙版 --- */
94+ [data-md-color-scheme = "default" ] .mdx-hero__layer--bg {
95+ /* 同样启用底部羽化,效果统一 */
96+ -webkit-mask-image : linear-gradient (to bottom, black 85% , transparent 100% );
97+ mask-image : linear-gradient (to bottom, black 85% , transparent 100% );
98+ }
2299
23- [data-md-color-scheme = "default" ] {
24- background-attachment : fixed;
25- background-repeat : no-repeat;
26- background-position : center center;
27- background-image : url ('../assets/images/home_background_light.png' );
28- background-color : rgba (0 , 0 , 0 , 0.3 ); /* 设置半透明背景色 */
29- background-size : cover
30- /* position: relative; 使伪元素相对定位 */
100+ /* 彻底移除旧的覆盖层 */
101+ .mdx-hero__overlay {
102+ display : none !important ;
31103}
104+
105+ /* 首页大字内容 */
106+ .mdx-hero__content {
107+ position : relative;
108+ z-index : 3 ;
109+ text-align : center;
110+ color : # fff ;
111+ text-shadow : 0 4px 20px rgba (0 , 0 , 0 , 0.8 );
112+ will-change : transform, opacity;
113+ margin-top : -5vh ;
114+ }
115+
116+ .hero-title {
117+ font-size : 3.5rem ;
118+ font-weight : 800 ;
119+ margin-bottom : 1rem ;
120+ line-height : 1.2 ;
121+ }
122+ .hero-subtitle {
123+ font-size : 1.5rem ;
124+ opacity : 0.95 ;
125+ font-weight : 500 ;
126+ }
127+
128+ /* 跳动箭头 */
129+ .mdx-hero__scroll-down {
130+ position : absolute;
131+ bottom : 50px ;
132+ left : 50% ;
133+ transform : translateX (-50% );
134+ color : # fff ;
135+ z-index : 10 ;
136+ cursor : pointer;
137+ animation : bounce 2s infinite;
138+ opacity : 0.9 ;
139+ text-shadow : 0 2px 5px rgba (0 , 0 , 0 , 0.5 );
140+ }
141+
142+ @keyframes bounce {
143+ 0% , 20% , 50% , 80% , 100% {transform : translateX (-50% ) translateY (0 );}
144+ 40% {transform : translateX (-50% ) translateY (-10px );}
145+ 60% {transform : translateX (-50% ) translateY (-5px );}
146+ }
147+
148+ /* =========================================
149+ 6. Content 区域 (正文)
150+ ========================================= */
151+ .mdx-container {
152+ position : relative;
153+ z-index : 10 ;
154+ margin-top : 100vh ;
155+ width : 100% ;
156+ min-height : 100vh ;
157+ margin-top : 99.8vh ;
158+ }
159+
160+ /* --- 浅色模式:改为透明背景 --- */
161+ [data-md-color-scheme = "default" ] .mdx-container {
162+ /* 之前是白色,现在改为透明,配合上面的蒙版,
163+ 让图片自然淡出到底部的背景色(通常是浅灰色)中 */
164+ background-color : transparent;
165+ box-shadow : none;
166+ }
167+
168+ /* --- 暗黑模式:透明背景 --- */
169+ [data-md-color-scheme = "slate" ] .mdx-container {
170+ background-color : transparent;
171+ }
172+
173+ .content-wrapper {
174+ padding : 4rem 1rem ;
175+ padding-bottom : 8rem ;
176+ background : transparent;
177+ }
178+
179+ /* =========================================
180+ 7. 动画相关
181+ ========================================= */
182+ .scroll-animate-item {
183+ opacity : 0 ;
184+ transform : translateY (30px );
185+ transition : opacity 0.8s ease-out, transform 0.8s ease-out;
186+ }
187+
188+ .scroll-animate-item .is-visible {
189+ opacity : 1 ;
190+ transform : translateY (0 );
191+ }
192+
193+ .md-sidebar { display : none !important ; }
0 commit comments