Skip to content

Commit a392470

Browse files
committed
优化布局:压缩所有组件实现单屏幕显示
1 parent ac72206 commit a392470

File tree

6 files changed

+197
-166
lines changed

6 files changed

+197
-166
lines changed

src/App.css

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
.app {
2-
min-height: 100vh;
2+
height: 100vh;
3+
max-height: 100vh;
34
display: flex;
45
flex-direction: column;
6+
overflow: hidden;
57
}
68

79
.main {
810
flex: 1;
9-
padding: 0.5rem 1rem;
11+
padding: 0.25rem 0.5rem;
1012
display: flex;
1113
overflow: hidden;
14+
min-height: 0;
1215
}
1316

1417
.container {
15-
padding: 0.5rem;
18+
padding: 0.25rem;
1619
margin: 0;
1720
width: 100%;
1821
max-width: 100%;
1922
display: flex;
2023
flex-direction: column;
21-
gap: 0.5rem;
24+
gap: 0.25rem;
25+
overflow: hidden;
2226
}
2327

2428
.title {
2529
text-align: center;
2630
color: white;
27-
font-size: 1.5rem;
31+
font-size: 1.1rem;
2832
margin: 0;
2933
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
3034
font-weight: 600;
@@ -44,40 +48,43 @@
4448
/* 输入面板 */
4549
.input-panel {
4650
background: #1f2937;
47-
border-radius: 8px;
48-
padding: 0.75rem 1rem;
51+
border-radius: 6px;
52+
padding: 0.3rem 0.5rem;
4953
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
5054
border: 1px solid rgba(255, 255, 255, 0.1);
5155
}
5256

5357
.input-group {
54-
display: grid;
55-
grid-template-columns: 2fr 1fr auto;
56-
gap: 0.5rem;
57-
margin-bottom: 0.5rem;
58-
align-items: end;
58+
display: flex;
59+
gap: 0.4rem;
60+
margin-bottom: 0.25rem;
61+
align-items: center;
5962
}
6063

6164
.input-row {
6265
display: flex;
63-
flex-direction: column;
64-
gap: 0.15rem;
66+
align-items: center;
67+
gap: 0.25rem;
68+
flex: 1;
6569
}
6670

6771
.input-row label {
6872
font-weight: 600;
6973
color: #e0e0e0;
70-
font-size: 14px;
74+
font-size: 12px;
75+
white-space: nowrap;
7176
}
7277

7378
.input-row input {
74-
padding: 0.6rem;
75-
border: 2px solid #374151;
76-
border-radius: 6px;
77-
font-size: 15px;
79+
padding: 0.25rem 0.4rem;
80+
border: 1px solid #374151;
81+
border-radius: 4px;
82+
font-size: 12px;
7883
transition: border-color 0.3s;
7984
background: #111827;
8085
color: #e0e0e0;
86+
flex: 1;
87+
min-width: 0;
8188
}
8289

8390
.input-row input:focus {
@@ -86,16 +93,16 @@
8693
}
8794

8895
.apply-btn {
89-
padding: 0.6rem 1.5rem;
96+
padding: 0.25rem 0.75rem;
9097
background: #f59e0b;
9198
color: #111827;
9299
border: none;
93-
border-radius: 6px;
100+
border-radius: 4px;
94101
font-weight: 600;
95102
cursor: pointer;
96103
transition: background 0.3s;
97104
white-space: nowrap;
98-
font-size: 14px;
105+
font-size: 12px;
99106
}
100107

101108
.apply-btn:hover {
@@ -127,18 +134,18 @@
127134

128135
.preset-buttons {
129136
display: flex;
130-
gap: 0.5rem;
137+
gap: 0.25rem;
131138
flex-wrap: wrap;
132139
}
133140

134141
.preset-btn {
135-
padding: 0.5rem 0.85rem;
142+
padding: 0.2rem 0.5rem;
136143
background: #374151;
137144
border: 1px solid #4b5563;
138-
border-radius: 6px;
145+
border-radius: 4px;
139146
cursor: pointer;
140147
transition: all 0.3s;
141-
font-size: 13px;
148+
font-size: 11px;
142149
font-weight: 500;
143150
color: #e0e0e0;
144151
}
@@ -163,66 +170,69 @@
163170
/* 主内容区域 - 两栏布局 */
164171
.main-content {
165172
display: grid;
166-
grid-template-columns: 1.5fr 1fr;
167-
gap: 0.75rem;
173+
grid-template-columns: 1fr 1fr;
174+
gap: 0.4rem;
168175
flex: 1;
169176
min-height: 0;
177+
overflow: hidden;
170178
}
171179

172180
.left-panel {
173181
display: flex;
174182
flex-direction: column;
175-
gap: 0.75rem;
183+
gap: 0.4rem;
176184
min-height: 0;
185+
overflow: hidden;
177186
}
178187

179188
.right-panel {
180189
display: flex;
181190
flex-direction: column;
182191
min-height: 0;
192+
overflow: hidden;
183193
}
184194

185195
/* 键盘快捷键提示 */
186196
.keyboard-hints {
187197
display: flex;
188198
justify-content: center;
189-
gap: 1rem;
199+
gap: 0.5rem;
190200
flex-wrap: wrap;
191-
padding: 0.75rem;
201+
padding: 0.25rem;
192202
background: rgba(31, 41, 55, 0.5);
193-
border-radius: 8px;
203+
border-radius: 4px;
194204
border: 1px solid rgba(255, 255, 255, 0.1);
195205
}
196206

197207
.hint-item {
198208
display: flex;
199209
align-items: center;
200-
gap: 0.5rem;
201-
font-size: 13px;
210+
gap: 0.25rem;
211+
font-size: 10px;
202212
color: #d1d5db;
203213
}
204214

205215
.hint-item kbd {
206216
background: linear-gradient(135deg, #f59e0b, #ea580c);
207217
color: white;
208-
padding: 4px 10px;
209-
border-radius: 6px;
210-
font-size: 12px;
218+
padding: 1px 5px;
219+
border-radius: 3px;
220+
font-size: 9px;
211221
font-weight: 600;
212-
min-width: 32px;
222+
min-width: 20px;
213223
text-align: center;
214-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
224+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
215225
font-family: inherit;
216226
}
217227

218228
.footer {
219229
background: rgba(0, 0, 0, 0.3);
220230
backdrop-filter: blur(10px);
221-
padding: 0.6rem;
231+
padding: 0.2rem;
222232
text-align: center;
223233
color: #9ca3af;
224234
border-top: 1px solid rgba(255, 255, 255, 0.1);
225-
font-size: 12px;
235+
font-size: 10px;
226236
}
227237

228238
/* 响应式设计 */

src/components/Canvas/Canvas.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.canvas-container {
22
flex: 1;
33
background: #111827;
4-
border-radius: 8px;
4+
border-radius: 6px;
55
position: relative;
66
overflow: hidden;
7-
min-height: 300px;
7+
min-height: 160px;
88
}
99

1010
.algorithm-canvas {
@@ -43,6 +43,6 @@
4343

4444
@media (max-width: 768px) {
4545
.canvas-container {
46-
min-height: 250px;
46+
min-height: 180px;
4747
}
4848
}

0 commit comments

Comments
 (0)