Skip to content

Commit 674758d

Browse files
committed
[Feature] add for new
1 parent 0f26244 commit 674758d

37 files changed

+98
-56
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ leetcode 算法解释。
44

55
## 在线阅读
66

7-
> [https://houbb.github.io/leetcode-notes](https://houbb.github.io/leetcode-notes)
7+
> [文章笔记](https://houbb.github.io/leetcode-notes)
88
9-
## 矩阵
9+
> [文章检索](https://houbb.github.io/leetcode-notes/leetcode/index/leecode.html)
10+
11+
## 可视化
1012

11-
[leetcode-visual 资源可视化](https://github.com/houbb/leetcode-visual)
13+
> [可视化](https://houbb.github.io/leetcode-notes/leetcode/visible/index.html)
14+
15+
## 矩阵
1216

1317
[leetcode 算法实现源码](https://github.com/houbb/leetcode)
1418

src/.vuepress/public/leetcode/README.md

Whitespace-only changes.
File renamed without changes.

src/posts/leetcode-index.js renamed to src/.vuepress/public/leetcode/index/leetcode-index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ window.LEETCODE_INDEX = [
66
categories: ["Algorithm"],
77
tags: ["algorithm", "data-struct", "array", "sweep-line", "sf"],
88
desc: "城市的天际线是从远处观看该城市中所有建筑物形成的轮廓的外部轮廓。给你所有建筑物的位置和高度,请返回由这些建筑物形成的天际线。",
9-
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-218-sweep-line-skyline.md"
9+
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-218-sweep-line-skyline.html"
1010
},
1111
{
1212
title: "leetcode 扫描线专题 06-leetcode.252 meeting room 力扣.252 会议室",
1313
date: "2020-06-08",
1414
categories: ["Algorithm"],
1515
tags: ["algorithm", "data-struct", "array", "sweep-line", "sf"],
1616
desc: "给定一个会议时间安排的数组 intervals,请你判断一个人是否能够参加这里面的全部会议。",
17-
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-252-sweep-line-meeting-room.md"
17+
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-252-sweep-line-meeting-room.html"
1818
},
1919
{
2020
title: "leetcode 扫描线专题 06-leetcode.253 meeting room ii 力扣.253 会议室 II",
2121
date: "2020-06-08",
2222
categories: ["Algorithm"],
2323
tags: ["algorithm", "data-struct", "array", "sweep-line", "sf"],
2424
desc: "返回所需会议室的最小数量。",
25-
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-253-sweep-line-meeting-room-ii.md"
25+
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-253-sweep-line-meeting-room-ii.html"
2626
},
2727
{
2828
title: "leetcode 扫描线专题 06-leetcode.223 rectangle-area 力扣.223 矩形面积",
2929
date: "2020-06-08",
3030
categories: ["Algorithm"],
3131
tags: ["algorithm", "data-struct", "array", "sweep-line", "sf"],
3232
desc: "给你二维平面上两个由直线构成且边与坐标轴平行/垂直的矩形,请你计算并返回两个矩形覆盖的总面积。",
33-
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-223-sweep-line-rectangle-area.md"
33+
url: "2020-06-06-algorithm-000-leetcode-data-struct-001-array-06-223-sweep-line-rectangle-area.html"
3434
}
3535
];

src/posts/leetcode.html renamed to src/.vuepress/public/leetcode/index/leetcode.html

Lines changed: 85 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,34 @@
77
<link href="https://fonts.googleapis.com/css?family=Montserrat:700,400&display=swap" rel="stylesheet">
88
<style>
99
body {
10-
background: linear-gradient(135deg, #0f2027 0%, #2c5364 100%);
10+
background: radial-gradient(circle at 20% 30%, #ff512f 0%, #dd2476 40%, #0f2027 100%);
1111
font-family: 'Montserrat', sans-serif;
1212
margin: 0;
1313
color: #fff;
1414
min-height: 100vh;
1515
overflow-x: hidden;
1616
}
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+
}
1738
.container {
1839
max-width: 1200px;
1940
margin: 40px auto;
@@ -27,7 +48,14 @@
2748
text-shadow: 0 4px 24px #000a, 0 1px 0 #fff3;
2849
background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
2950
-webkit-background-clip: text;
51+
background-clip: text;
3052
-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); }
3159
}
3260
.search-bar {
3361
display: flex;
@@ -44,88 +72,110 @@
4472
background: #fff1;
4573
color: #fff;
4674
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.2s;
4876
}
4977
.search-bar input:focus, .search-bar select:focus {
5078
background: #fff3;
5179
color: #ff512f;
80+
box-shadow: 0 4px 16px #ff512f44;
5281
}
5382
.card-list {
5483
display: grid;
5584
grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
56-
gap: 32px;
85+
gap: 40px;
5786
}
5887
.card {
5988
background: linear-gradient(120deg, #ff512f 0%, #dd2476 100%);
60-
border-radius: 20px;
61-
box-shadow: 0 8px 32px #0007, 0 1.5px 0 #fff2;
62-
padding: 32px 28px 48px 28px;
63-
transition: transform 0.25s, box-shadow 0.25s;
89+
border-radius: 24px;
90+
box-shadow: 0 12px 48px #dd2476cc, 0 2px 0 #fff5;
91+
padding: 36px 32px 56px 32px;
92+
transition: transform 0.25s, box-shadow 0.25s, border 0.3s;
6493
position: relative;
6594
overflow: hidden;
6695
animation: floatIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
96+
border: 3px solid transparent;
6797
}
6898
@keyframes floatIn {
6999
0% { opacity: 0; transform: translateY(40px) scale(0.95); }
70100
100% { opacity: 1; transform: translateY(0) scale(1); }
71101
}
72102
.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;
75106
}
76107
.card-title {
77-
font-size: 1.5em;
108+
font-size: 1.6em;
78109
font-weight: bold;
79-
margin-bottom: 10px;
110+
margin-bottom: 12px;
80111
background: linear-gradient(90deg, #fff 0%, #ffe0e0 100%);
81112
-webkit-background-clip: text;
113+
background-clip: text;
82114
-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); }
83122
}
84123
.card-meta {
85124
font-size: 1em;
86-
margin-bottom: 16px;
125+
margin-bottom: 18px;
87126
color: #ffe0e0;
88127
text-shadow: 0 1px 0 #0002;
89128
}
90129
.card-tags {
91-
margin-bottom: 14px;
130+
margin-bottom: 16px;
92131
}
93132
.tag {
94133
display: inline-block;
95134
background: linear-gradient(90deg, #fff2 0%, #ff512f 100%);
96135
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); }
104149
}
105150
.tag:hover {
106151
background: linear-gradient(90deg, #dd2476 0%, #ff512f 100%);
152+
transform: scale(1.08);
107153
}
108154
.card-desc {
109-
font-size: 1.08em;
155+
font-size: 1.12em;
110156
color: #fff;
111157
text-shadow: 0 1px 0 #0002;
158+
line-height: 1.7;
112159
}
113160
.card a {
114161
position: absolute;
115-
right: 24px;
116-
bottom: 24px;
162+
right: 28px;
163+
bottom: 28px;
117164
color: #fff;
118165
text-decoration: underline;
119-
font-size: 1em;
166+
font-size: 1.08em;
120167
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;
125174
}
126175
.card a:hover {
127176
background: linear-gradient(90deg, #fff 0%, #ff512f 100%);
128177
color: #dd2476;
178+
text-shadow: 0 1px 0 #fff6;
129179
}
130180
@media (max-width: 600px) {
131181
.container { padding: 8px; }
@@ -135,7 +185,8 @@
135185
}
136186
</style>
137187
</head>
138-
<body>
188+
</body>
189+
<div class="nav">Leetcode Notes 炫酷查询</div>
139190
<div class="container">
140191
<h1>Leetcode 专题查询</h1>
141192
<div class="search-bar">
@@ -151,7 +202,10 @@ <h1>Leetcode 专题查询</h1>
151202
</div>
152203
<script src="./leetcode-index.js"></script>
153204
<script>
154-
// 等待 window.LEETCODE_INDEX 加载
205+
function getHtmlUrl(mdUrl) {
206+
// 修正为 github pages 地址
207+
return `https://houbb.github.io/leetcode-notes/posts/leetcode/${mdUrl.replace(/\.md$/, '.html')}`;
208+
}
155209
function initLeetcodePage() {
156210
const data = window.LEETCODE_INDEX || [];
157211
const categories = [...new Set(data.flatMap(d => d.categories))];
@@ -186,7 +240,7 @@ <h1>Leetcode 专题查询</h1>
186240
<div class="card-meta">${item.date} | 分类: ${item.categories.join(', ')}</div>
187241
<div class="card-tags">${item.tags.map(t => `<span class='tag'>${t}</span>`).join('')}</div>
188242
<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>
190244
`;
191245
cardList.appendChild(card);
192246
});

src/posts/update-leetcode-index.bat renamed to src/.vuepress/public/leetcode/index/update-leetcode-index.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
REM 一键更新 leetcode-index.js 文件
33
REM 需安装 node 环境
4-
node src\posts\generate-leetcode-index.js
4+
node generate-leetcode-index.js
55
if %errorlevel% neq 0 (
66
echo 生成失败,请检查 node 环境和脚本!
77
) else (
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)