Skip to content

Commit dde32e5

Browse files
committed
style: 优化应用样式和布局
1 parent ebb14a8 commit dde32e5

File tree

1 file changed

+110
-5
lines changed

1 file changed

+110
-5
lines changed

src/App.css

Lines changed: 110 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
--text-color: #333;
5050
--light-bg: #f5f5f5;
5151
--border-color: #ddd;
52+
--highlight-color: #FF5722;
53+
--code-bg: #282c34;
54+
--code-text: #abb2bf;
5255
}
5356

5457
* {
@@ -79,12 +82,16 @@ body, html {
7982
align-items: center;
8083
padding: 0 10px 5px 10px;
8184
border-bottom: 1px solid var(--border-color);
82-
height: 50px;
85+
height: 60px;
86+
background-color: #f8f9fa;
87+
border-radius: 4px;
88+
margin-bottom: 5px;
8389
}
8490

8591
.app-header h1 {
8692
font-size: 1.5rem;
8793
margin: 0;
94+
color: var(--primary-color);
8895
}
8996

9097
.stairs-config {
@@ -103,17 +110,29 @@ body, html {
103110
.app-content {
104111
display: flex;
105112
flex: 1;
106-
height: calc(100vh - 60px);
113+
height: calc(100vh - 70px);
107114
overflow: hidden;
108115
}
109116

110117
.left-panel {
111-
width: 25%;
118+
width: 30%;
112119
padding: 5px;
113120
overflow-y: auto;
114121
border-right: 1px solid var(--border-color);
115122
}
116123

124+
.left-panel h2 {
125+
margin-bottom: 10px;
126+
color: var(--primary-color);
127+
padding-bottom: 5px;
128+
border-bottom: 1px solid var(--border-color);
129+
}
130+
131+
.left-panel h3 {
132+
color: var(--secondary-color);
133+
margin: 10px 0;
134+
}
135+
117136
.center-panel {
118137
flex: 1;
119138
display: flex;
@@ -125,13 +144,16 @@ body, html {
125144
.center-panel svg {
126145
flex: 1;
127146
min-height: 0;
147+
border-radius: 4px;
148+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
128149
}
129150

130151
.algorithm-description {
131152
margin-top: 10px;
132153
padding: 10px;
133154
background-color: var(--light-bg);
134155
border-radius: 4px;
156+
border-left: 4px solid var(--primary-color);
135157
}
136158

137159
.algorithm-description h3 {
@@ -141,6 +163,60 @@ body, html {
141163

142164
.algorithm-description ul {
143165
padding-left: 20px;
166+
text-align: left;
167+
}
168+
169+
.algorithm-description li {
170+
margin-bottom: 5px;
171+
}
172+
173+
/* 代码面板样式 */
174+
.code-section {
175+
margin-top: 20px;
176+
}
177+
178+
.code-panel {
179+
border: 1px solid var(--border-color);
180+
border-radius: 4px;
181+
overflow: hidden;
182+
margin-top: 10px;
183+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
184+
}
185+
186+
pre {
187+
background-color: var(--code-bg);
188+
color: var(--code-text);
189+
padding: 10px;
190+
border-radius: 4px;
191+
overflow: auto;
192+
font-family: 'Fira Code', monospace;
193+
text-align: left;
194+
}
195+
196+
code {
197+
font-family: 'Fira Code', monospace;
198+
}
199+
200+
/* 步骤显示样式 */
201+
.step-description {
202+
margin: 10px 0;
203+
padding: 10px;
204+
background-color: #E3F2FD;
205+
border-radius: 4px;
206+
border-left: 4px solid var(--secondary-color);
207+
text-align: left;
208+
}
209+
210+
/* 高亮动画 */
211+
@keyframes pulse {
212+
0% { opacity: 1; }
213+
50% { opacity: 0.6; }
214+
100% { opacity: 1; }
215+
}
216+
217+
.node-highlight {
218+
animation: pulse 1.5s infinite;
219+
filter: drop-shadow(0 0 5px var(--highlight-color));
144220
}
145221

146222
/* 色盲模式支持 */
@@ -157,19 +233,48 @@ button:focus, input:focus {
157233
}
158234

159235
/* 响应式设计 */
236+
@media (max-width: 1024px) {
237+
.app-content {
238+
flex-direction: column;
239+
}
240+
241+
.left-panel {
242+
width: 100%;
243+
height: 40%;
244+
border-right: none;
245+
border-bottom: 1px solid var(--border-color);
246+
display: flex;
247+
flex-wrap: wrap;
248+
}
249+
250+
.algorithm-description, .code-section {
251+
width: 50%;
252+
padding: 5px;
253+
}
254+
255+
.center-panel {
256+
height: 60%;
257+
}
258+
}
259+
160260
@media (max-width: 768px) {
161261
.app-content {
162262
flex-direction: column;
163263
}
164264

165265
.left-panel {
166266
width: 100%;
167-
height: 30%;
267+
height: 50%;
168268
border-right: none;
169269
border-bottom: 1px solid var(--border-color);
270+
flex-direction: column;
271+
}
272+
273+
.algorithm-description, .code-section {
274+
width: 100%;
170275
}
171276

172277
.center-panel {
173-
height: 70%;
278+
height: 50%;
174279
}
175280
}

0 commit comments

Comments
 (0)