style: 重构标签页UI,点击关闭按钮更方便 (#950)

* style: 重构标签页`UI`,点击关闭按钮更方便

* chore: update
This commit is contained in:
xiaoming 2024-03-01 16:37:15 +08:00 committed by GitHub
parent 2b71e8bd54
commit 19ccd378f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 62 deletions

View File

@ -18,26 +18,6 @@
} }
} }
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes close {
from {
transform: translate(-50%, -50%);
}
to {
transform: translate(0, -50%);
}
}
.tags-view { .tags-view {
position: relative; position: relative;
display: flex; display: flex;
@ -51,41 +31,35 @@
.scroll-item { .scroll-item {
position: relative; position: relative;
display: inline-block; display: inline-block;
height: 28px; height: 34px;
padding: 0 6px; padding-left: 6px;
margin-right: 4px; line-height: 34px;
line-height: 28px;
cursor: pointer; cursor: pointer;
border-radius: 3px 3px 0 0;
box-shadow: 0 0 1px #888;
transition: all 0.4s; transition: all 0.4s;
&:not(:first-child) {
padding-right: 24px;
}
.el-icon-close { .el-icon-close {
position: absolute; position: absolute;
top: 50%; top: 50%;
font-size: 10px; display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
color: var(--el-color-primary); color: var(--el-color-primary);
cursor: pointer; cursor: pointer;
transition: font-size 0.2s; border-radius: 4px;
transform: translate(-50%, -50%); transition:
background-color 0.12s,
color 0.12s;
transform: translate(0, -50%);
&:hover { &:hover {
font-size: 13px; color: rgb(0 0 0 / 88%) !important;
color: #fff; background-color: rgb(0 0 0 / 6%);
background: #b4bccc;
border-radius: 50%;
}
}
&.is-closable:not(:first-child) {
&:hover {
padding-right: 18px;
&:not(.is-active) {
.el-icon-close {
animation: close 200ms ease-in forwards;
}
}
} }
} }
} }
@ -99,7 +73,6 @@
.scroll-container { .scroll-container {
position: relative; position: relative;
flex: 1; flex: 1;
padding: 5px 0;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
@ -114,7 +87,7 @@
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&:nth-child(1) { &:nth-child(1) {
margin-left: 5px; padding: 0 12px;
} }
} }
} }
@ -194,14 +167,7 @@
.scroll-item.is-active { .scroll-item.is-active {
position: relative; position: relative;
color: #fff; color: #fff;
box-shadow: 0 0 0.7px #888;
&:not(:first-child) {
padding-right: 18px;
}
.el-icon-close {
transform: translate(0, -50%);
}
.tag-title { .tag-title {
color: var(--el-color-primary) !important; color: var(--el-color-primary) !important;
@ -212,16 +178,16 @@
.arrow-right, .arrow-right,
.arrow-down { .arrow-down {
position: relative; position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 40px; width: 40px;
height: 38px; height: 34px;
color: var(--el-text-color-primary); color: var(--el-text-color-primary);
svg { svg {
position: absolute;
left: 50%;
width: 20px; width: 20px;
height: 20px; height: 20px;
transform: translate(-50%, 50%);
} }
} }

View File

@ -21,9 +21,9 @@ import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
import ArrowDown from "@iconify-icons/ri/arrow-down-s-line"; import ArrowDown from "@iconify-icons/ri/arrow-down-s-line";
import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line"; import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line";
import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line"; import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line";
import CloseBold from "@iconify-icons/ep/close-bold";
const { const {
Close,
route, route,
router, router,
visible, visible,
@ -156,7 +156,8 @@ const handleWheel = (event: WheelEvent): void => {
}; };
const smoothScroll = (offset: number): void => { const smoothScroll = (offset: number): void => {
const scrollAmount = 20; // //
const scrollAmount = 20;
let remaining = Math.abs(offset); let remaining = Math.abs(offset);
const scrollStep = () => { const scrollStep = () => {
@ -586,7 +587,7 @@ onBeforeUnmount(() => {
class="el-icon-close" class="el-icon-close"
@click.stop="deleteMenu(item)" @click.stop="deleteMenu(item)"
> >
<IconifyIconOffline :icon="CloseBold" /> <IconifyIconOffline :icon="Close" />
</span> </span>
<span <span
v-if="showModel !== 'card'" v-if="showModel !== 'card'"

View File

@ -216,6 +216,7 @@ export function useTags() {
}); });
return { return {
Close,
route, route,
router, router,
visible, visible,

View File

@ -45,6 +45,15 @@ html.dark {
.arrow-right { .arrow-right {
border-left: 1px solid $border-style; border-left: 1px solid $border-style;
} }
.scroll-item {
.el-icon-close {
&:hover {
color: rgb(255 255 255 / 85%) !important;
background-color: rgb(255 255 255 / 12%);
}
}
}
} }
/* 项目配置面板 */ /* 项目配置面板 */