feat:修改星榜的样式

This commit is contained in:
zheng020 2026-06-11 13:31:53 +08:00
parent 37fbcb42c6
commit c441388fd0

View File

@ -413,34 +413,26 @@ onUnmounted(() => {
.content-scroll { .content-scroll {
flex: 1; flex: 1;
min-height: 0; /* flex 子项需要 min-height: 0 才能正确伸缩 */ min-height: 0;
overflow: hidden; overflow: hidden;
} }
/* Tab 栏 —— 与 Figma Rectangle 90 (83:268) 一一对应 */
.ranking-tabs { .ranking-tabs {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 16rpx; padding: 0 16rpx;
position: relative; position: relative;
/* left:50% + transform:translate(-50%)
transform 会创建独立 stacking context把子元素active tab锁在父级层级里
导致即使给 .active z-index:999 也浮不到 .items-grid 之上
改用 margin:0 auto 水平居中父级就不再创建 stacking context */
top: 16rpx; top: 16rpx;
margin: 0 auto; margin: 0 auto;
/* z-index transform/opacity inactive tab
低于 .items-gridgrid 2 这样 grid 就能遮住 top 栏被覆盖的部分 */
width: 480rpx; width: 480rpx;
height: 96rpx; height: 96rpx;
clip-path: inset(-200rpx 0 16rpx 0);
&::before { &::before {
content: ""; content: "";
position: absolute; position: absolute;
inset: 0; inset: 0;
background: linear-gradient(184deg, #ff5a5d -36.55%, #c2ebff 121.2%); background: linear-gradient(184deg, #ff5a5d -36.55%, #c2ebff 121.2%);
opacity: 0.8; opacity: 0.8;
backdrop-filter: blur(5.85px); backdrop-filter: blur(5.85px);
border-top-left-radius: 14px; border-top-left-radius: 14px;
@ -453,23 +445,17 @@ onUnmounted(() => {
.ranking-tab-item { .ranking-tab-item {
height: 80rpx; height: 80rpx;
width: 88rpx; width: 88rpx;
border-radius: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
transition: all 0.25s ease; transition: all 0.25s ease;
/* position: relative .ranking-tab-icon position: absolute
注意不能写 position: absolute否则 4 tab 会从 flex 流中抽离并全部堆在 left:0 重叠 */
position: relative; position: relative;
} }
.ranking-tab-item.active { .ranking-tab-item.active {
/* Figma active tab 尺寸 48x85px → 96x170rpx */
width: 96rpx; width: 96rpx;
height: 170rpx; height: 160rpx;
top: 40rpx; top: 40rpx;
/* z-index:3 + position:relative .items-gridz-index:2
前提是 .ranking-tabs 不能创建 stacking context已通过去掉 transform 保证 */
z-index: 1; z-index: 1;
&::before { &::before {
content: ""; content: "";
@ -482,6 +468,7 @@ onUnmounted(() => {
); );
opacity: 0.5; opacity: 0.5;
backdrop-filter: blur(0.9px); backdrop-filter: blur(0.9px);
border-radius: 20rpx;
} }
} }
@ -510,7 +497,7 @@ onUnmounted(() => {
/* 骨架屏 */ /* 骨架屏 */
.grid-skeleton { .grid-skeleton {
display: flex; display: flex;
flex-direction: column; /* 与 items-grid 保持一致:纵向 */ flex-direction: column;
position: relative; position: relative;
z-index: 2; z-index: 2;
border-radius: 12px; border-radius: 12px;
@ -570,27 +557,21 @@ onUnmounted(() => {
/* 内容网格 */ /* 内容网格 */
.items-grid { .items-grid {
display: flex; display: flex;
flex-direction: column; /* 改为纵向排列,每张卡片独占一行 */ flex-direction: column;
position: relative; position: relative;
z-index: 2; /* top top z-index grid inactive tab z-index: 2;
但比 .ranking-tab-item.active z-index:3 所以选中的红色渐变仍能浮出来 */
/* 背景与 Figma node 80-259 一致 */
background: linear-gradient( background: linear-gradient(
145.83deg, 145.83deg,
rgba(255, 90, 93, 0.2) 16.63%, rgba(255, 90, 93, 0.2) 16.63%,
rgba(76, 237, 255, 0.2) 48.19%, rgba(76, 237, 255, 0.2) 48.19%,
rgba(255, 122, 124, 0.2) 83.71% rgba(255, 122, 124, 0.2) 83.71%
); );
backdrop-filter: blur(4.65px); /* Figma 是 4.65px,不是 9.3px */ backdrop-filter: blur(4.65px);
border-top-left-radius: 13px; /* Figma: 左上 13px其余 12px */ border-top-left-radius: 13px;
border-top-right-radius: 12px; border-top-right-radius: 12px;
border-bottom-right-radius: 12px; border-bottom-right-radius: 12px;
border-bottom-left-radius: 12px; border-bottom-left-radius: 12px;
opacity: 0.8; /* 与 Figma 一致 */ opacity: 0.8;
/* padding: 40rpx 20rpx 0; */
/* 80rpx Task 2 .hot-category-wrapper height ,
重新加上 32rpx 底部 padding 保证最后一行卡片不会紧贴 scroll-view 底边
避免与 BottomNav fixed 区域视觉重叠 */
padding: 40rpx 20rpx 32rpx; padding: 40rpx 20rpx 32rpx;
overflow: hidden; overflow: hidden;
} }
@ -672,14 +653,13 @@ onUnmounted(() => {
.grid-card-top-5 { .grid-card-top-5 {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
// [3] bj.png opacity
&::before { &::before {
content: ""; content: "";
position: absolute; position: absolute;
inset: 0; inset: 0;
background: url("/static/square/galaxy/TOP4.png") center no-repeat; background: url("/static/square/galaxy/TOP4.png") center no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
opacity: 0.8; // 0=1= opacity: 0.8;
pointer-events: none; pointer-events: none;
z-index: 0; z-index: 0;
} }