Commit 957fb045 by liimin

style(ToolBox): 优化组件样式和动画效果

- 使用玻璃拟态效果增强现代感
- 改进按钮和列表的过渡动画
- 调整圆角大小和阴影效果
- 优化列表项的交互反馈
- 添加选中状态指示器
1 parent 2660af3f
...@@ -112,20 +112,28 @@ export default { ...@@ -112,20 +112,28 @@ export default {
top: calc(5% + #{toRpx(140)}); top: calc(5% + #{toRpx(140)});
z-index: 998; z-index: 998;
width: toRpx(120); width: toRpx(120);
/* 基础变量定义 */
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
.btn { .btn {
width: 100%; width: 100%;
height: toRpx(120); height: toRpx(120);
background-image: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%); background: #ffffff;
/* 玻璃拟态背景,增加现代感 */
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
border: toRpx(2) solid #ffffff; border: toRpx(2) solid #ffffff;
box-shadow: 0 toRpx(8) toRpx(24) 0 #00000033; box-shadow: 0 toRpx(8) toRpx(24) 0 rgba(0, 0, 0, 0.12);
border-radius: toRpx(16); border-radius: toRpx(24); /* 更圆润的角 */
font-size: toRpx(24); font-size: toRpx(24);
color: #292d33; color: #292d33;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1); transition: all 0.4s var(--ease-out);
opacity: 1; opacity: 1;
transform: scale(1); transform: scale(1);
overflow: hidden; overflow: hidden;
...@@ -136,101 +144,146 @@ export default { ...@@ -136,101 +144,146 @@ export default {
width: toRpx(60); width: toRpx(60);
height: toRpx(60); height: toRpx(60);
margin-bottom: toRpx(8); margin-bottom: toRpx(8);
transition: all 0.2s; transition: transform 0.3s ease;
}
&:active {
transform: scale(0.96);
} }
} }
.hideIcon { .hideIcon {
opacity: 0; opacity: 0;
transform: translateY(toRpx(10)) scale(0.95); transform: scale(0.8);
pointer-events: none; pointer-events: none;
transition: all 0.3s ease;
} }
.list { .list {
width: 100%; width: 100%;
/* 手风琴效果核心:通过 max-height 进行高度动画 */
max-height: 0;
border: toRpx(2) solid #ffffff; border: toRpx(2) solid #ffffff;
box-shadow: 0 toRpx(8) toRpx(22) 0 #0000001a; box-shadow: 0 toRpx(12) toRpx(32) 0 rgba(0, 0, 0, 0.15);
border-radius: toRpx(16); border-radius: toRpx(24);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
overflow: hidden; overflow: hidden;
opacity: 0;
/* 定位与初始状态 */
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
background: rgba(255, 255, 255, 0.95); background: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(10px); backdrop-filter: blur(20px);
opacity: 0;
visibility: hidden; visibility: hidden;
max-height: toRpx(120); /* Same as button height initially */
transform: scale(0.98);
transform-origin: top center;
z-index: 1; z-index: 1;
/* 干净利落的快速展开 */
transition:
opacity 0.2s ease,
visibility 0.2s ease,
max-height 0.3s cubic-bezier(0.19, 1, 0.22, 1); /* Expo Out: 极快冲刺,迅速到位 */
.title { .title {
width: 100%; width: 100%;
height: toRpx(56); height: toRpx(72);
background: #f8f9fb; background: rgba(248, 249, 251, 0.8);
border-bottom: toRpx(1) solid rgba(0,0,0,0.05); border-bottom: toRpx(1) solid rgba(0,0,0,0.03);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: toRpx(24); font-size: toRpx(26);
font-weight: 500; font-weight: 600;
color: #333; color: #333;
flex-shrink: 0; flex-shrink: 0;
&:active {
background: rgba(0,0,0,0.02);
}
} }
.list-body { .list-body {
width: 100%; width: 100%;
max-height: 60vh; /* 移除 max-height 限制,由父容器 max-height 控制 */
/* max-height: 60vh; */
overflow-y: auto; overflow-y: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-bottom: toRpx(10); padding-bottom: toRpx(16);
/* 滚动条隐藏但可滚动 */
&::-webkit-scrollbar {
width: 0;
height: 0;
background-color: transparent;
} }
}
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: toRpx(20); font-size: toRpx(22);
color: #666666; color: #555;
width: 100%; width: 100%;
padding-top: toRpx(16); padding-top: toRpx(20);
padding-bottom: toRpx(8); padding-bottom: toRpx(12);
position: relative;
/* Animation Setup */ /* 列表项快速复位 */
opacity: 0; opacity: 0;
transform: translateY(toRpx(-20)); transform: translateY(5rpx); /* 减少位移距离,更紧凑 */
transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth ease-out, no bounce */ transition: all 0.2s ease;
.icon { .icon {
width: toRpx(60); width: toRpx(64);
height: toRpx(60); height: toRpx(64);
margin-bottom: toRpx(8); margin-bottom: toRpx(8);
transition: transform 0.2s;
} }
&:active { &:active {
transform: scale(0.95) !important; .icon {
transition: transform 0.1s; transform: scale(0.9);
} }
} }
.active {
/* 选中态指示器 */
&.active {
color: #2c66f7; color: #2c66f7;
font-weight: 500;
&::after {
content: '';
position: absolute;
right: toRpx(10);
top: 50%;
width: toRpx(6);
height: toRpx(6);
background: #2c66f7;
border-radius: 50%;
}
} }
} }
}
.showList { .showList {
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
max-height: 80vh; max-height: toRpx(1000);
transform: scale(1);
z-index: 3; z-index: 3;
padding-bottom: toRpx(16);
.item { .item {
opacity: 1; opacity: 1;
transform: translateY(0); transform: translateY(0);
transition-delay: calc(0.02s + var(--i) * 0.025s); /* Staggered delay */ /* 极微小的延迟,保持整体性,减少拖沓感 */
transition-delay: calc(0.05s + var(--i) * 0.02s);
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!