style(欢迎页): 调整欢迎页组件样式和布局
- 将轨道布局改为水平布局,使用 flex 实现 - 缩小入口图标尺寸和标题字体大小 - 简化动画实现,移除基于优先级的定位类 - 调整内边距,优化整体间距
Showing
2 changed files
with
30 additions
and
33 deletions
| 1 | +<!-- | ||
| 2 | + * @Date: 2026-01-28 17:24:46 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2026-01-28 17:25:09 | ||
| 5 | + * @FilePath: /mlaj/src/components/welcome/WelcomeContent.vue | ||
| 6 | + * @Description: 欢迎页内容组件 | ||
| 7 | +--> | ||
| 1 | <template> | 8 | <template> |
| 2 | <div class="welcome-content"> | 9 | <div class="welcome-content"> |
| 3 | - <!-- 功能入口区域 - 轨道布局 --> | 10 | + <!-- 功能入口区域 - 水平布局 --> |
| 4 | <div class="entry-orbit"> | 11 | <div class="entry-orbit"> |
| 5 | - <!-- 3个功能入口 - 轨道布局 --> | ||
| 6 | <div class="orbit-entries"> | 12 | <div class="orbit-entries"> |
| 7 | <WelcomeEntryItem | 13 | <WelcomeEntryItem |
| 8 | v-for="entry in entries" | 14 | v-for="entry in entries" |
| 9 | :key="entry.id" | 15 | :key="entry.id" |
| 10 | :entry="entry" | 16 | :entry="entry" |
| 11 | class="orbit-entry" | 17 | class="orbit-entry" |
| 12 | - :class="`orbit-entry-${entry.priority}`" | ||
| 13 | @click="handleEntryClick" | 18 | @click="handleEntryClick" |
| 14 | /> | 19 | /> |
| 15 | </div> | 20 | </div> |
| ... | @@ -49,47 +54,39 @@ const handleEntryClick = (entry) => { | ... | @@ -49,47 +54,39 @@ const handleEntryClick = (entry) => { |
| 49 | flex-direction: column; | 54 | flex-direction: column; |
| 50 | align-items: center; | 55 | align-items: center; |
| 51 | justify-content: flex-end; | 56 | justify-content: flex-end; |
| 52 | - padding: 2rem; | 57 | + padding-left: 2rem; |
| 53 | - padding-bottom: 8rem; | 58 | + padding-right: 2rem; |
| 59 | + padding-bottom: 3rem; | ||
| 54 | z-index: 1; | 60 | z-index: 1; |
| 55 | } | 61 | } |
| 56 | 62 | ||
| 57 | .entry-orbit { | 63 | .entry-orbit { |
| 58 | position: relative; | 64 | position: relative; |
| 59 | width: 100%; | 65 | width: 100%; |
| 60 | - max-width: 20rem; | 66 | + max-width: 36rem; |
| 61 | - aspect-ratio: 1; | ||
| 62 | 67 | ||
| 63 | .orbit-entries { | 68 | .orbit-entries { |
| 64 | - position: relative; | 69 | + display: flex; |
| 65 | - width: 100%; | 70 | + flex-direction: row; |
| 66 | - height: 100%; | 71 | + justify-content: space-between; |
| 72 | + align-items: center; | ||
| 73 | + gap: 0; | ||
| 67 | 74 | ||
| 68 | .orbit-entry { | 75 | .orbit-entry { |
| 69 | - position: absolute; | 76 | + flex: 1; |
| 70 | - top: 50%; | 77 | + display: flex; |
| 71 | - left: 50%; | 78 | + justify-content: center; |
| 72 | - transform: translate(-50%, -50%); | ||
| 73 | animation: float 3s ease-in-out infinite; | 79 | animation: float 3s ease-in-out infinite; |
| 74 | 80 | ||
| 75 | - &.orbit-entry-1 { | 81 | + &:nth-child(1) { |
| 76 | - // 课程中心 - 顶部偏左 | ||
| 77 | - top: 5%; | ||
| 78 | - left: 40%; | ||
| 79 | animation-delay: 0s; | 82 | animation-delay: 0s; |
| 80 | } | 83 | } |
| 81 | 84 | ||
| 82 | - &.orbit-entry-2 { | 85 | + &:nth-child(2) { |
| 83 | - // 活动中心 - 右下 | ||
| 84 | - top: 75%; | ||
| 85 | - left: 80%; | ||
| 86 | animation-delay: 0.5s; | 86 | animation-delay: 0.5s; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | - &.orbit-entry-3 { | 89 | + &:nth-child(3) { |
| 90 | - // 个人中心 - 左下 | ||
| 91 | - top: 70%; | ||
| 92 | - left: 20%; | ||
| 93 | animation-delay: 1s; | 90 | animation-delay: 1s; |
| 94 | } | 91 | } |
| 95 | } | 92 | } |
| ... | @@ -99,10 +96,10 @@ const handleEntryClick = (entry) => { | ... | @@ -99,10 +96,10 @@ const handleEntryClick = (entry) => { |
| 99 | // 动画定义 | 96 | // 动画定义 |
| 100 | @keyframes float { | 97 | @keyframes float { |
| 101 | 0%, 100% { | 98 | 0%, 100% { |
| 102 | - transform: translate(-50%, -50%) translateY(0); | 99 | + transform: translateY(0); |
| 103 | } | 100 | } |
| 104 | 50% { | 101 | 50% { |
| 105 | - transform: translate(-50%, -50%) translateY(-10px); | 102 | + transform: translateY(-10px); |
| 106 | } | 103 | } |
| 107 | } | 104 | } |
| 108 | </style> | 105 | </style> | ... | ... |
| ... | @@ -61,22 +61,22 @@ const handleClick = () => { | ... | @@ -61,22 +61,22 @@ const handleClick = () => { |
| 61 | 61 | ||
| 62 | .entry-icon-wrapper { | 62 | .entry-icon-wrapper { |
| 63 | position: relative; | 63 | position: relative; |
| 64 | - width: 6rem; | 64 | + width: 5rem; |
| 65 | - height: 6rem; | 65 | + height: 5rem; |
| 66 | border-radius: 50%; | 66 | border-radius: 50%; |
| 67 | display: flex; | 67 | display: flex; |
| 68 | align-items: center; | 68 | align-items: center; |
| 69 | justify-content: center; | 69 | justify-content: center; |
| 70 | 70 | ||
| 71 | .entry-icon { | 71 | .entry-icon { |
| 72 | - width: 6rem; | 72 | + width: 5rem; |
| 73 | - height: 6rem; | 73 | + height: 5rem; |
| 74 | object-fit: contain; | 74 | object-fit: contain; |
| 75 | } | 75 | } |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | .entry-title { | 78 | .entry-title { |
| 79 | - font-size: 1rem; | 79 | + font-size: 0.95rem; |
| 80 | font-weight: 500; | 80 | font-weight: 500; |
| 81 | color: #ffffff; | 81 | color: #ffffff; |
| 82 | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); | 82 | text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); | ... | ... |
-
Please register or login to post a comment