7
7
< link href ="https://fonts.googleapis.com/css?family=Montserrat:700,400&display=swap " rel ="stylesheet ">
8
8
< style >
9
9
body {
10
- background : linear -gradient (135 deg , # 0f2027 0% , # 2c5364 100% );
10
+ background : radial -gradient (circle at 20 % 30 % , # ff512f 0% , # dd2476 40 % , # 0f2027 100% );
11
11
font-family : 'Montserrat' , sans-serif;
12
12
margin : 0 ;
13
13
color : # fff ;
14
14
min-height : 100vh ;
15
15
overflow-x : hidden;
16
16
}
17
+ .nav {
18
+ width : 100% ;
19
+ background : linear-gradient (90deg , # ff512f 0% , # dd2476 100% );
20
+ box-shadow : 0 2px 12px # 0003 ;
21
+ padding : 16px 0 ;
22
+ text-align : center;
23
+ font-size : 1.2em ;
24
+ letter-spacing : 2px ;
25
+ font-weight : bold;
26
+ color : # fff ;
27
+ margin-bottom : 18px ;
28
+ position : sticky;
29
+ top : 0 ;
30
+ z-index : 10 ;
31
+ border-bottom : 2px solid # fff2 ;
32
+ animation : navFadeIn 1s ;
33
+ }
34
+ @keyframes navFadeIn {
35
+ 0% { opacity : 0 ; transform : translateY (-30px ); }
36
+ 100% { opacity : 1 ; transform : translateY (0 ); }
37
+ }
17
38
.container {
18
39
max-width : 1200px ;
19
40
margin : 40px auto;
27
48
text-shadow : 0 4px 24px # 000a, 0 1px 0 # fff3 ;
28
49
background : linear-gradient (90deg , # ff512f 0% , # dd2476 100% );
29
50
-webkit-background-clip : text;
51
+ background-clip : text;
30
52
-webkit-text-fill-color : transparent;
53
+ text-fill-color : transparent;
54
+ animation : titlePop 1.2s cubic-bezier (.68 , -0.55 , .27 , 1.55 );
55
+ }
56
+ @keyframes titlePop {
57
+ 0% { opacity : 0 ; transform : scale (0.8 ); }
58
+ 100% { opacity : 1 ; transform : scale (1 ); }
31
59
}
32
60
.search-bar {
33
61
display : flex;
44
72
background : # fff1 ;
45
73
color : # fff ;
46
74
box-shadow : 0 2px 12px # 0003 ;
47
- transition : background 0.2s , color 0.2s ;
75
+ transition : background 0.2s , color 0.2s , box-shadow 0.2 s ;
48
76
}
49
77
.search-bar input : focus , .search-bar select : focus {
50
78
background : # fff3 ;
51
79
color : # ff512f ;
80
+ box-shadow : 0 4px 16px # ff512f44 ;
52
81
}
53
82
.card-list {
54
83
display : grid;
55
84
grid-template-columns : repeat (auto-fit, minmax (340px , 1fr ));
56
- gap : 32 px ;
85
+ gap : 40 px ;
57
86
}
58
87
.card {
59
88
background : linear-gradient (120deg , # ff512f 0% , # dd2476 100% );
60
- border-radius : 20 px ;
61
- box-shadow : 0 8 px 32 px # 0007 , 0 1.5 px 0 # fff2 ;
62
- padding : 32px 28 px 48 px 28 px ;
63
- transition : transform 0.25s , box-shadow 0.25s ;
89
+ border-radius : 24 px ;
90
+ box-shadow : 0 12 px 48 px # dd2476cc , 0 2 px 0 # fff5 ;
91
+ padding : 36 px 32px 56 px 32 px ;
92
+ transition : transform 0.25s , box-shadow 0.25s , border 0.3 s ;
64
93
position : relative;
65
94
overflow : hidden;
66
95
animation : floatIn 0.7s cubic-bezier (.68 , -0.55 , .27 , 1.55 );
96
+ border : 3px solid transparent;
67
97
}
68
98
@keyframes floatIn {
69
99
0% { opacity : 0 ; transform : translateY (40px ) scale (0.95 ); }
70
100
100% { opacity : 1 ; transform : translateY (0 ) scale (1 ); }
71
101
}
72
102
.card : hover {
73
- transform : translateY (-12px ) scale (1.04 ) rotate (-1deg );
74
- box-shadow : 0 16px 48px # dd2476cc, 0 2px 0 # fff5 ;
103
+ transform : translateY (-16px ) scale (1.05 ) rotate (-1deg );
104
+ box-shadow : 0 24px 64px # ff512f99, 0 2px 0 # fff5 ;
105
+ border : 3px solid # fff6 ;
75
106
}
76
107
.card-title {
77
- font-size : 1.5 em ;
108
+ font-size : 1.6 em ;
78
109
font-weight : bold;
79
- margin-bottom : 10 px ;
110
+ margin-bottom : 12 px ;
80
111
background : linear-gradient (90deg , # fff 0% , # ffe0e0 100% );
81
112
-webkit-background-clip : text;
113
+ background-clip : text;
82
114
-webkit-text-fill-color : transparent;
115
+ text-fill-color : transparent;
116
+ letter-spacing : 1px ;
117
+ animation : cardTitlePop 0.8s ;
118
+ }
119
+ @keyframes cardTitlePop {
120
+ 0% { opacity : 0 ; transform : scale (0.9 ); }
121
+ 100% { opacity : 1 ; transform : scale (1 ); }
83
122
}
84
123
.card-meta {
85
124
font-size : 1em ;
86
- margin-bottom : 16 px ;
125
+ margin-bottom : 18 px ;
87
126
color : # ffe0e0 ;
88
127
text-shadow : 0 1px 0 # 0002 ;
89
128
}
90
129
.card-tags {
91
- margin-bottom : 14 px ;
130
+ margin-bottom : 16 px ;
92
131
}
93
132
.tag {
94
133
display : inline-block;
95
134
background : linear-gradient (90deg , # fff2 0% , # ff512f 100% );
96
135
color : # fff ;
97
- border-radius : 8px ;
98
- padding : 4px 14px ;
99
- font-size : 0.95em ;
100
- margin-right : 8px ;
101
- margin-bottom : 4px ;
102
- box-shadow : 0 1px 4px # 0002 ;
103
- transition : background 0.2s ;
136
+ border-radius : 10px ;
137
+ padding : 5px 16px ;
138
+ font-size : 1em ;
139
+ margin-right : 10px ;
140
+ margin-bottom : 5px ;
141
+ box-shadow : 0 2px 8px # ff512f33 ;
142
+ transition : background 0.2s , transform 0.2s ;
143
+ cursor : pointer;
144
+ animation : tagFadeIn 0.7s ;
145
+ }
146
+ @keyframes tagFadeIn {
147
+ 0% { opacity : 0 ; transform : scale (0.8 ); }
148
+ 100% { opacity : 1 ; transform : scale (1 ); }
104
149
}
105
150
.tag : hover {
106
151
background : linear-gradient (90deg , # dd2476 0% , # ff512f 100% );
152
+ transform : scale (1.08 );
107
153
}
108
154
.card-desc {
109
- font-size : 1.08 em ;
155
+ font-size : 1.12 em ;
110
156
color : # fff ;
111
157
text-shadow : 0 1px 0 # 0002 ;
158
+ line-height : 1.7 ;
112
159
}
113
160
.card a {
114
161
position : absolute;
115
- right : 24 px ;
116
- bottom : 24 px ;
162
+ right : 28 px ;
163
+ bottom : 28 px ;
117
164
color : # fff ;
118
165
text-decoration : underline;
119
- font-size : 1 em ;
166
+ font-size : 1.08 em ;
120
167
background : linear-gradient (90deg , # ff512f 0% , # dd2476 100% );
121
- border-radius : 8px ;
122
- padding : 4px 12px ;
123
- box-shadow : 0 1px 8px # 0002 ;
124
- transition : background 0.2s ;
168
+ border-radius : 10px ;
169
+ padding : 6px 16px ;
170
+ box-shadow : 0 2px 12px # dd2476cc ;
171
+ transition : background 0.2s , color 0.2s ;
172
+ font-weight : bold;
173
+ letter-spacing : 1px ;
125
174
}
126
175
.card a : hover {
127
176
background : linear-gradient (90deg , # fff 0% , # ff512f 100% );
128
177
color : # dd2476 ;
178
+ text-shadow : 0 1px 0 # fff6 ;
129
179
}
130
180
@media (max-width : 600px ) {
131
181
.container { padding : 8px ; }
135
185
}
136
186
</ style >
137
187
</ head >
138
- < body >
188
+ </ body >
189
+ < div class ="nav "> Leetcode Notes 炫酷查询</ div >
139
190
< div class ="container ">
140
191
< h1 > Leetcode 专题查询</ h1 >
141
192
< div class ="search-bar ">
@@ -151,7 +202,10 @@ <h1>Leetcode 专题查询</h1>
151
202
</ div >
152
203
< script src ="./leetcode-index.js "> </ script >
153
204
< script >
154
- // 等待 window.LEETCODE_INDEX 加载
205
+ function getHtmlUrl ( mdUrl ) {
206
+ // 修正为 github pages 地址
207
+ return `https://houbb.github.io/leetcode-notes/posts/leetcode/${ mdUrl . replace ( / \. m d $ / , '.html' ) } ` ;
208
+ }
155
209
function initLeetcodePage ( ) {
156
210
const data = window . LEETCODE_INDEX || [ ] ;
157
211
const categories = [ ...new Set ( data . flatMap ( d => d . categories ) ) ] ;
@@ -186,7 +240,7 @@ <h1>Leetcode 专题查询</h1>
186
240
<div class="card-meta">${ item . date } | 分类: ${ item . categories . join ( ', ' ) } </div>
187
241
<div class="card-tags">${ item . tags . map ( t => `<span class='tag'>${ t } </span>` ) . join ( '' ) } </div>
188
242
<div class="card-desc">${ item . desc } </div>
189
- <a href="./leetcode/ ${ item . url } " target="_blank">查看原文</a>
243
+ <a href="${ getHtmlUrl ( item . url ) } " target="_blank">查看原文</a>
190
244
` ;
191
245
cardList . appendChild ( card ) ;
192
246
} ) ;
0 commit comments