From 204b02404db8decbf0edd96ab0abc2c11085f974 Mon Sep 17 00:00:00 2001 From: KQL Date: Wed, 3 Sep 2025 10:10:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0ClassRank=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F=E4=B8=BA=E6=AD=A3=E7=A1=AE=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用正确的类名 module-class-rank - 修复排行榜布局样式 - 添加正确的背景和图标引用 --- src/components/ClassRank/index.css | 418 ++++++++++++++--------------- 1 file changed, 203 insertions(+), 215 deletions(-) diff --git a/src/components/ClassRank/index.css b/src/components/ClassRank/index.css index 1381c35..c0f8a5c 100644 --- a/src/components/ClassRank/index.css +++ b/src/components/ClassRank/index.css @@ -1,233 +1,221 @@ -.class-rank { - width: 100%; +.module-class-rank { + width: 373px; height: 100%; + background-color: #fff7f1; + border-radius: 16px; + border: 1px solid #fff; + flex-shrink: 0; + box-sizing: border-box; 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; flex-direction: column; - gap: 16px; -} - -.class-rank-list { - display: flex; - flex-direction: column; - gap: 12px; -} - -.class-rank-item { - display: flex; align-items: center; - padding: 12px; - background: rgba(255, 255, 255, 0.05); - border-radius: 8px; - transition: all 0.3s ease; - cursor: pointer; -} + justify-content: flex-start; + position: relative; + overflow: hidden; -.class-rank-item:hover { - background: rgba(255, 255, 255, 0.1); - transform: translateX(4px); -} - -.class-rank-item.item1 { - background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%); - border: 1px solid rgba(255, 215, 0, 0.3); -} - -.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; + &::after { + content: ""; + width: 180px; + height: 110px; + position: absolute; + right: 0; + top: 0; + background-image: url("@/assets/images/Rank/bg.png"); + background-size: 100% 100%; } - .class-rank-title { - font-size: 18px; + .module-class-rank-title { + 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 { - padding: 10px; + .module-class-rank-spin, + .empty-data { + margin: auto; } - .class-rank-position { - width: 28px; - height: 28px; - font-size: 14px; - } + .module-class-rank-podium { + width: 333px; + height: 138px; + margin-top: 20px; + display: flex; + justify-content: space-between; + align-items: flex-end; - .class-rank-points { - font-size: 16px; - } -} + > li { + width: 88px; + border-radius: 8px; + position: relative; + background-image: linear-gradient( + to bottom, + rgba(255, 255, 255, 1), + rgba(255, 255, 255, 0) + ); -/* 暗色主题适配 */ -@media (prefers-color-scheme: dark) { - .class-rank { - background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%); - } + .module-class-rank-podium-avatar { + position: absolute; + left: 50%; + top: -24px; + transform: translateX(-50%); + width: 48px; + height: 48px; + border: 1px solid; + position: relative; - .class-rank-item { - background: rgba(0, 0, 0, 0.2); - } + &::before { + content: ""; + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: -10px; + width: 57px; + height: 16px; + background-size: 100% 100%; + } + } - .class-rank-item:hover { - background: rgba(0, 0, 0, 0.3); + .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; + } + } } } \ No newline at end of file