style(theme): 更新各主题logo及顶部栏样式,统一白底阴影效果
- 所有主题的 avue-logo 背景改为白色,并添加 0 2px 8px rgba(0,0,0,0.06) 阴影效果 - 各主题顶部栏背景及文字颜色调整,提升整体对比度与视觉统一性 - 统一调整下拉菜单、面包屑、图标等元素颜色为 rgba(0,0,0,0.85) 或 0.65,增强易读性 - 修正部分输入框和色彩选择器的边框及背景颜色,增强一致性 - index.html 添加 favicon.ico 作为页面图标 - 新增图标悬停显示浅灰圆形背景效果示例页面 icon-hover-demo.html - icon-hover-demo.html 包含核心 CSS 代码和 Element Plus 的示例用法,方便复用和参考
This commit is contained in:
@@ -86,3 +86,12 @@
|
|||||||
|
|
||||||
- 按用户提供的两张截图(T 恤默认图标 / 铃铛带圆形背景图标),实现了一个悬停时显示浅灰圆形背景的图标按钮效果。
|
- 按用户提供的两张截图(T 恤默认图标 / 铃铛带圆形背景图标),实现了一个悬停时显示浅灰圆形背景的图标按钮效果。
|
||||||
- 产物: `/Users/gxwebsoft/VUE/tms-erp-web-ws/icon-hover-demo.html`(含 CSS 核心代码与 Element Plus 用法示例)。
|
- 产物: `/Users/gxwebsoft/VUE/tms-erp-web-ws/icon-hover-demo.html`(含 CSS 核心代码与 Element Plus 用法示例)。
|
||||||
|
|
||||||
|
## 顶栏 T 恤图标悬停效果落地
|
||||||
|
|
||||||
|
- 用户要求把悬停圆形背景效果运用到顶部状态栏的 T 恤图标(实际指向主题图标位置 `<i class="icon-zhuti">`)。
|
||||||
|
- 改动文件: `src/page/index/top/top-theme.vue`
|
||||||
|
- 模板:将 `<i class="icon-zhuti" @click="open">` 替换为内联 SVG T 恤(保留 `@click="open"` 打开主题选择弹窗)。
|
||||||
|
- 样式:新增 scoped `.top-theme-icon`,`::before` 浅灰圆形背景 `#f2f3f5`,默认 `scale(0.6) opacity(0)`,hover/focus 弹性放大到 `scale(1)`,图标 `z-index:1` 压在上层。
|
||||||
|
- 调整:用户反馈 T 恤图标在顶栏中上下不居中,把 `.top-theme-icon` 由 `display:flex; height:100%` 改为 `display:inline-flex; vertical-align:middle; width:32px; height:32px`,使其与右侧头像/用户名在同一水平中线。
|
||||||
|
- 注意:该组件受 `website.setting.theme` 控制(之前曾设为 false 隐藏),若顶栏未显示主题图标,需确认 website.js 中 `setting.theme` 为 true。
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<top-logs></top-logs>
|
<top-logs></top-logs>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-user">
|
<div class="top-user">
|
||||||
<img class="top-bar__img" :src="userInfo.avatar" />
|
<img class="top-bar__img" :src="userInfo.avatar" alt=""/>
|
||||||
<el-dropdown :hide-on-click="false">
|
<el-dropdown :hide-on-click="false">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
{{ userInfo.real_name }}
|
{{ userInfo.real_name }}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<span>
|
<span class="top-theme-icon" @click="open">
|
||||||
<i class="icon-zhuti" @click="open"></i>
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M7 3l3 3h4l3-3 4 4-3 2v11a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V9L3 7l4-4z" />
|
||||||
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -116,4 +118,44 @@ export default {
|
|||||||
.list {
|
.list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.top-theme-icon {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
vertical-align: middle;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #f2f3f5;
|
||||||
|
transform: scale(0.6);
|
||||||
|
opacity: 0;
|
||||||
|
transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover::before,
|
||||||
|
&:focus-visible::before {
|
||||||
|
transform: scale(1);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.avue-main {
|
.avue-main {
|
||||||
//padding: 0 5px;
|
padding: 0 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avue-tags {
|
.avue-tags {
|
||||||
|
|||||||
@@ -81,7 +81,6 @@
|
|||||||
.top-bar__right {
|
.top-bar__right {
|
||||||
height: variables.$top_height;
|
height: variables.$top_height;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-top: 2px;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
@@ -121,6 +120,7 @@
|
|||||||
height: variables.$top_height;
|
height: variables.$top_height;
|
||||||
margin: 0 7px;
|
margin: 0 7px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
top: -2px;
|
||||||
|
|
||||||
.el-badge__content.is-fixed {
|
.el-badge__content.is-fixed {
|
||||||
top: 12px;
|
top: 12px;
|
||||||
|
|||||||
Reference in New Issue
Block a user