fix: 更新ClassRank组件样式为正确版本

- 使用正确的类名 module-class-rank
- 修复排行榜布局样式
- 添加正确的背景和图标引用
This commit is contained in:
KQL
2025-09-03 10:10:40 +08:00
parent b19c641529
commit 204b02404d

View File

@@ -1,233 +1,221 @@
.class-rank { .module-class-rank {
width: 100%; width: 373px;
height: 100%; height: 100%;
background-color: #fff7f1;
border-radius: 16px;
border: 1px solid #fff;
flex-shrink: 0;
box-sizing: border-box;
padding: 20px; padding: 20px;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
border-radius: 12px;
backdrop-filter: blur(10px);
}
.class-rank-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.class-rank-title {
font-size: 20px;
font-weight: 600;
color: #ffffff;
display: flex;
align-items: center;
gap: 8px;
}
.class-rank-subtitle {
font-size: 14px;
color: rgba(255, 255, 255, 0.6);
}
.class-rank-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px;
}
.class-rank-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.class-rank-item {
display: flex;
align-items: center; align-items: center;
padding: 12px; justify-content: flex-start;
background: rgba(255, 255, 255, 0.05); position: relative;
border-radius: 8px; overflow: hidden;
transition: all 0.3s ease;
cursor: pointer;
}
.class-rank-item:hover { &::after {
background: rgba(255, 255, 255, 0.1); content: "";
transform: translateX(4px); width: 180px;
} height: 110px;
position: absolute;
.class-rank-item.item1 { right: 0;
background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%); top: 0;
border: 1px solid rgba(255, 215, 0, 0.3); background-image: url("@/assets/images/Rank/bg.png");
} background-size: 100% 100%;
.class-rank-item.item2 {
background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.05) 100%);
border: 1px solid rgba(192, 192, 192, 0.3);
}
.class-rank-item.item3 {
background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.05) 100%);
border: 1px solid rgba(205, 127, 50, 0.3);
}
.class-rank-position {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: bold;
color: #ffffff;
margin-right: 12px;
}
.class-rank-position.icon1 {
background: url('../../assets/images/Rank/first_icon.png') no-repeat center;
background-size: contain;
color: transparent;
}
.class-rank-position.icon2 {
background: url('../../assets/images/Rank/second_icon.png') no-repeat center;
background-size: contain;
color: transparent;
}
.class-rank-position.icon3 {
background: url('../../assets/images/Rank/third_icon.png') no-repeat center;
background-size: contain;
color: transparent;
}
.class-rank-avatar {
margin-right: 12px;
}
.class-rank-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
}
.class-rank-name {
font-size: 14px;
font-weight: 500;
color: #ffffff;
}
.class-rank-class {
font-size: 12px;
color: rgba(255, 255, 255, 0.6);
}
.class-rank-score {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 4px;
}
.class-rank-points {
font-size: 18px;
font-weight: bold;
color: #3491fa;
}
.class-rank-label {
font-size: 12px;
color: rgba(255, 255, 255, 0.6);
}
.class-rank-loading {
display: flex;
align-items: center;
justify-content: center;
height: 200px;
}
.class-rank-empty {
display: flex;
align-items: center;
justify-content: center;
height: 200px;
}
/* 动画效果 */
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.class-rank-item {
animation: slideIn 0.5s ease forwards;
}
.class-rank-item:nth-child(1) {
animation-delay: 0.1s;
}
.class-rank-item:nth-child(2) {
animation-delay: 0.2s;
}
.class-rank-item:nth-child(3) {
animation-delay: 0.3s;
}
.class-rank-item:nth-child(4) {
animation-delay: 0.4s;
}
.class-rank-item:nth-child(5) {
animation-delay: 0.5s;
}
/* 响应式设计 */
@media (max-width: 768px) {
.class-rank {
padding: 16px;
} }
.class-rank-title { .module-class-rank-title {
font-size: 18px; height: 30px;
width: 100%;
font-size: 20px;
font-weight: 500;
line-height: 30px;
color: #262626;
position: relative;
box-sizing: border-box;
display: flex;
align-items: center;
.title-icon {
width: 24px;
height: 24px;
margin-right: 10px;
}
} }
.class-rank-item { .module-class-rank-spin,
padding: 10px; .empty-data {
margin: auto;
} }
.class-rank-position { .module-class-rank-podium {
width: 28px; width: 333px;
height: 28px; height: 138px;
font-size: 14px; margin-top: 20px;
} display: flex;
justify-content: space-between;
align-items: flex-end;
.class-rank-points { > li {
font-size: 16px; width: 88px;
} border-radius: 8px;
} position: relative;
background-image: linear-gradient(
/* 暗色主题适配 */ to bottom,
@media (prefers-color-scheme: dark) { rgba(255, 255, 255, 1),
.class-rank { rgba(255, 255, 255, 0)
background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%); );
}
.module-class-rank-podium-avatar {
.class-rank-item { position: absolute;
background: rgba(0, 0, 0, 0.2); left: 50%;
} top: -24px;
transform: translateX(-50%);
.class-rank-item:hover { width: 48px;
background: rgba(0, 0, 0, 0.3); height: 48px;
border: 1px solid;
position: relative;
&::before {
content: "";
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: -10px;
width: 57px;
height: 16px;
background-size: 100% 100%;
}
}
.module-class-rank-podium-name {
color: #1d2129;
font-size: 14px;
position: absolute;
left: 50%;
top: 30px;
transform: translateX(-50%);
z-index: 10;
}
> i {
height: 27px;
background-size: 100% 100%;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
}
}
.module-class-rank-podium-item1 {
height: 98px;
&::after {
content: "";
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -40px;
width: 20px;
height: 20px;
background-image: url("@/assets/images/Rank/first_icon.png");
background-size: 100% 100%;
}
.module-class-rank-podium-avatar {
border-color: #ffc15b;
&::before {
background-image: url("@/assets/images/Rank/icon1.png");
}
}
}
.module-class-rank-podium-item2 {
height: 80px;
&::after {
content: "";
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -40px;
width: 20px;
height: 20px;
background-image: url("@/assets/images/Rank/second_icon.png");
background-size: 100% 100%;
}
.module-class-rank-podium-avatar {
border-color: #9ab9e3;
&::before {
background-image: url("@/assets/images/Rank/icon2.png");
}
}
}
.module-class-rank-podium-item3 {
height: 70px;
&::after {
content: "";
position: absolute;
left: 50%;
transform: translateX(-50%);
top: -40px;
width: 20px;
height: 20px;
background-image: url("@/assets/images/Rank/third_icon.png");
background-size: 100% 100%;
}
.module-class-rank-podium-avatar {
border-color: #d7a770;
&::before {
background-image: url("@/assets/images/Rank/icon3.png");
}
}
}
}
.module-class-rank-list {
width: 333px;
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
.module-class-rank-list-item {
width: 100%;
height: 56px;
margin-top: 5px;
display: flex;
justify-content: flex-start;
align-items: center;
flex-shrink: 0;
background-color: #fff;
border-radius: 8px;
box-sizing: border-box;
padding: 0 10px;
position: relative;
> em {
margin-left: 5px;
color: #86909c;
font-size: 20px;
font-family: "HarmonyOS_Sans_TC_Bold";
}
> p {
font-size: 14px;
height: 22px;
font-weight: 400;
line-height: 22px;
color: #1d2129;
margin-left: 16px;
text-align: left;
}
> span {
font-size: 14px;
font-weight: 400;
color: #86909c;
position: absolute;
right: 20px;
}
}
} }
} }