Skip to content

Commit 25b303c

Browse files
gusibigusibi
authored andcommitted
update ui Transition
1 parent 97e9435 commit 25b303c

File tree

2 files changed

+293
-71
lines changed

2 files changed

+293
-71
lines changed

src/renderer/src/assets/styles/components/task-manager.css

Lines changed: 233 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
/* 主要内容区域样式 */
1414
.task-manager-main-content {
15-
@apply flex-1 flex flex-col overflow-hidden relative bg-background m-2 rounded-lg shadow-lg;
15+
@apply flex flex-col overflow-hidden relative bg-background m-2 rounded-lg shadow-lg;
16+
/* 使用 calc 计算固定宽度,减去侧边栏宽度和 margin */
17+
width: calc(100% - 280px - 16px);
1618
height: calc(100vh - 16px); /* 减去margin */
1719
min-height: 0; /* 重要:允许flex子元素收缩 */
1820
}
@@ -190,18 +192,12 @@
190192
@apply flex-1 min-w-0 transition-all duration-300 ease-in-out;
191193
}
192194

193-
.task-list-container.with-panel {
194-
flex: 0 0 calc(100% - 384px);
195-
}
196195

197-
.edit-panel-container {
198-
@apply bg-muted-foreground overflow-y-auto shadow-lg border-l border-border;
199-
@apply w-full max-w-md max-h-full overflow-hidden;
200-
}
201196

202-
/* 任务视图容器的 flex 布局(仅用于列表视图) */
197+
/* 任务视图容器 - 列表视图使用 flex 布局实现左锚定右收缩 */
203198
.task-manager-views-flex {
204199
display: flex !important;
200+
flex-direction: row;
205201
}
206202

207203
/* 看板视图包装器 */
@@ -257,14 +253,236 @@
257253
transform: translateX(0);
258254
}
259255

260-
/* 响应式设计 */
261-
@media (max-width: 768px) {
262-
.task-list-container.with-panel {
263-
flex: 0 0 calc(100% - 100vw);
256+
/* ========================================
257+
视图切换过渡动画
258+
======================================== */
259+
260+
/* 视图淡入淡出动画 */
261+
.view-fade-enter-active {
262+
animation: view-fade-in 0.25s ease-out;
263+
}
264+
265+
.view-fade-leave-active {
266+
animation: view-fade-out 0.2s ease-in;
267+
}
268+
269+
@keyframes view-fade-in {
270+
from {
271+
opacity: 0;
272+
transform: translateY(8px) scale(0.98);
273+
}
274+
to {
275+
opacity: 1;
276+
transform: translateY(0) scale(1);
264277
}
265-
278+
}
279+
280+
@keyframes view-fade-out {
281+
from {
282+
opacity: 1;
283+
transform: translateY(0) scale(1);
284+
}
285+
to {
286+
opacity: 0;
287+
transform: translateY(-8px) scale(0.98);
288+
}
289+
}
290+
291+
/* ========================================
292+
编辑面板滑入滑出动画
293+
======================================== */
294+
295+
/* 列表视图的右侧编辑面板 - 宽度展开动画(左锚定右收缩) */
296+
.edit-panel-slide-enter-active {
297+
animation: edit-panel-expand 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
298+
}
299+
300+
.edit-panel-slide-leave-active {
301+
animation: edit-panel-collapse 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
302+
}
303+
304+
@keyframes edit-panel-expand {
305+
from {
306+
flex-basis: 0;
307+
max-width: 0;
308+
opacity: 0;
309+
}
310+
to {
311+
flex-basis: 400px;
312+
max-width: 400px;
313+
opacity: 1;
314+
}
315+
}
316+
317+
@keyframes edit-panel-collapse {
318+
from {
319+
flex-basis: 400px;
320+
max-width: 400px;
321+
opacity: 1;
322+
}
323+
to {
324+
flex-basis: 0;
325+
max-width: 0;
326+
opacity: 0;
327+
}
328+
}
329+
330+
/* 列表容器 - flex 子元素,自动填充剩余空间 */
331+
.task-list-container {
332+
@apply h-full overflow-auto;
333+
flex: 1 1 auto;
334+
min-width: 0; /* 允许收缩到内容以下 */
335+
transition: flex 0.3s cubic-bezier(0.16, 1, 0.3, 1);
336+
}
337+
338+
.task-list-container.with-edit-panel {
339+
/* 有编辑面板时,列表仍然自动填充剩余空间 */
340+
}
341+
342+
/* 列表视图的右侧编辑面板 - flex 子元素,固定宽度 */
343+
.edit-panel-container {
344+
@apply h-full z-40;
345+
@apply bg-background shadow-2xl border-l border-border;
346+
flex: 0 0 400px; /* 固定宽度 400px,不伸缩 */
347+
max-width: 400px;
348+
overflow: hidden;
349+
}
350+
351+
/* ========================================
352+
看板编辑面板动画优化
353+
======================================== */
354+
355+
/* 看板编辑面板背景淡入 */
356+
.kanban-edit-panel-enter-active .kanban-edit-panel-backdrop {
357+
animation: backdrop-fade-in 0.2s ease-out;
358+
}
359+
360+
.kanban-edit-panel-leave-active .kanban-edit-panel-backdrop {
361+
animation: backdrop-fade-out 0.2s ease-in;
362+
}
363+
364+
@keyframes backdrop-fade-in {
365+
from { opacity: 0; }
366+
to { opacity: 1; }
367+
}
368+
369+
@keyframes backdrop-fade-out {
370+
from { opacity: 1; }
371+
to { opacity: 0; }
372+
}
373+
374+
/* 看板编辑面板容器滑入 */
375+
.kanban-edit-panel-enter-active .kanban-edit-panel-container {
376+
animation: kanban-panel-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
377+
}
378+
379+
.kanban-edit-panel-leave-active .kanban-edit-panel-container {
380+
animation: kanban-panel-slide-out 0.25s cubic-bezier(0.4, 0, 0.2, 1);
381+
}
382+
383+
@keyframes kanban-panel-slide-in {
384+
from {
385+
opacity: 0;
386+
transform: translateX(100%);
387+
}
388+
to {
389+
opacity: 1;
390+
transform: translateX(0);
391+
}
392+
}
393+
394+
@keyframes kanban-panel-slide-out {
395+
from {
396+
opacity: 1;
397+
transform: translateX(0);
398+
}
399+
to {
400+
opacity: 0;
401+
transform: translateX(100%);
402+
}
403+
}
404+
405+
/* ========================================
406+
搜索框展开收起动画
407+
======================================== */
408+
409+
.task-manager-inline-search {
410+
animation: search-expand 0.25s cubic-bezier(0.16, 1, 0.3, 1);
411+
}
412+
413+
@keyframes search-expand {
414+
from {
415+
opacity: 0;
416+
width: 36px;
417+
transform: scaleX(0.5);
418+
}
419+
to {
420+
opacity: 1;
421+
width: 200px;
422+
transform: scaleX(1);
423+
}
424+
}
425+
426+
/* ========================================
427+
按钮状态切换动画
428+
======================================== */
429+
430+
.task-manager-action-btn {
431+
@apply w-9 h-9 flex items-center justify-center rounded-lg border border-border bg-background text-muted-foreground;
432+
transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
433+
}
434+
435+
.task-manager-action-btn:hover {
436+
@apply text-foreground bg-accent;
437+
transform: translateY(-1px);
438+
}
439+
440+
.task-manager-action-btn:active {
441+
transform: translateY(0) scale(0.95);
442+
}
443+
444+
.task-manager-action-btn.active {
445+
@apply bg-primary/10 text-primary border-primary/20;
446+
}
447+
448+
.task-manager-action-btn.active:hover {
449+
@apply bg-primary/20 border-primary/30;
450+
}
451+
452+
/* ========================================
453+
响应式设计
454+
======================================== */
455+
456+
@media (max-width: 768px) {
266457
.edit-panel-container {
267-
flex: 0 0 100vw;
458+
flex: 0 0 100%;
459+
max-width: 100%;
460+
}
461+
462+
@keyframes edit-panel-expand {
463+
from {
464+
flex-basis: 0;
465+
max-width: 0;
466+
opacity: 0;
467+
}
468+
to {
469+
flex-basis: 100%;
470+
max-width: 100%;
471+
opacity: 1;
472+
}
473+
}
474+
475+
@keyframes edit-panel-collapse {
476+
from {
477+
flex-basis: 100%;
478+
max-width: 100%;
479+
opacity: 1;
480+
}
481+
to {
482+
flex-basis: 0;
483+
max-width: 0;
484+
opacity: 0;
485+
}
268486
}
269487

270488
.kanban-edit-panel-container {

0 commit comments

Comments
 (0)