Feature(custom): update styles for improved UI in Plugin and UploaderConfig pages

This commit is contained in:
Kuingsmile
2025-04-09 16:43:23 +08:00
parent a06b7e8b03
commit 11c694d2c5
2 changed files with 206 additions and 108 deletions
+1 -1
View File
@@ -523,7 +523,7 @@ $infoColor = #909399
$textColor = #FFFFFF $textColor = #FFFFFF
$subtextColor = #E8EAED $subtextColor = #E8EAED
$disabledColor = #A0A0A0 $disabledColor = #A0A0A0
$cardBg = rgba(55, 60, 70, 0.85) $cardBg = rgba(55, 60, 70, 0.55)
$headerBg = rgba(35, 40, 50, 0.9) $headerBg = rgba(35, 40, 50, 0.9)
$hoverBg = rgba(65, 70, 85, 0.9) $hoverBg = rgba(65, 70, 85, 0.9)
$borderRadius = 8px $borderRadius = 8px
+205 -107
View File
@@ -3,60 +3,61 @@
<div class="view-title"> <div class="view-title">
{{ $T('SETTINGS') }} {{ $T('SETTINGS') }}
</div> </div>
<el-row :gutter="15" justify="space-between" align="middle" type="flex" class="config-list"> <div class="config-list-container">
<el-col <el-row :gutter="20" justify="start" class="config-list">
v-for="item in curConfigList" <el-col
:key="item._id" v-for="item in curConfigList"
class="config-item-col" :key="item._id"
:xs="24" class="config-item-col"
:sm="curConfigList.length === 1 ? 24 : 12" :xs="24"
:md="curConfigList.length === 1 ? 24 : 12" :sm="curConfigList.length === 1 ? 24 : 12"
:lg="curConfigList.length === 1 ? 12 : 6" :md="curConfigList.length === 1 ? 24 : 12"
:xl="curConfigList.length === 1 ? 12 : 3" :lg="curConfigList.length === 1 ? 12 : 8"
> :xl="curConfigList.length === 1 ? 12 : 6"
<div
:class="`config-item ${defaultConfigId === item._id ? 'selected' : ''}`"
@click="() => selectItem(item._id)"
> >
<div class="config-name"> <div
{{ item._configName }} :class="`config-card ${defaultConfigId === item._id ? 'selected' : ''}`"
@click="() => selectItem(item._id)"
>
<div class="config-card-content">
<div class="config-name">{{ item._configName }}</div>
<div class="config-update-time">{{ formatTime(item._updatedAt) }}</div>
</div>
<div v-if="defaultConfigId === item._id" class="default-badge">
{{ $T('SELECTED_SETTING_HINT') }}
</div>
<div class="config-card-actions">
<el-button class="action-btn edit-btn" circle type="primary" @click.stop="openEditPage(item._id)">
<el-icon><Edit /></el-icon>
</el-button>
<el-button
class="action-btn delete-btn"
circle
type="danger"
:disabled="curConfigList.length <= 1"
@click.stop="() => deleteConfig(item._id)"
>
<el-icon><Delete /></el-icon>
</el-button>
</div>
</div> </div>
<div class="config-update-time"> </el-col>
{{ formatTime(item._updatedAt) }} <el-col
class="config-item-col"
:xs="24"
:sm="curConfigList.length === 1 ? 24 : 12"
:md="curConfigList.length === 1 ? 24 : 12"
:lg="curConfigList.length === 1 ? 12 : 8"
:xl="curConfigList.length === 1 ? 12 : 6"
>
<div class="config-card add-card" @click="addNewConfig">
<el-icon class="add-icon"><Plus /></el-icon>
<span class="add-text">{{ $T('SETTINGS') }}</span>
</div> </div>
<div v-if="defaultConfigId === item._id" class="default-text"> </el-col>
{{ $T('SELECTED_SETTING_HINT') }} </el-row>
</div> </div>
<div class="operation-container"> <div class="set-default-container">
<el-icon class="el-icon-edit" @click="openEditPage(item._id)">
<Edit />
</el-icon>
<el-icon
class="el-icon-delete"
:class="curConfigList.length <= 1 ? 'disabled' : ''"
@click.stop="() => deleteConfig(item._id)"
>
<Delete />
</el-icon>
</div>
</div>
</el-col>
<el-col
class="config-item-col"
:xs="24"
:sm="curConfigList.length === 1 ? 24 : 12"
:md="curConfigList.length === 1 ? 24 : 12"
:lg="curConfigList.length === 1 ? 12 : 6"
:xl="curConfigList.length === 1 ? 12 : 3"
>
<div class="config-item config-item-add" @click="addNewConfig">
<el-icon class="el-icon-plus">
<Plus />
</el-icon>
</div>
</el-col>
</el-row>
<el-row type="flex" justify="center" :span="24" class="set-default-container">
<el-button <el-button
class="set-default-btn" class="set-default-btn"
type="success" type="success"
@@ -66,7 +67,7 @@
> >
{{ $T('SETTINGS_SET_DEFAULT_PICBED') }} {{ $T('SETTINGS_SET_DEFAULT_PICBED') }}
</el-button> </el-button>
</el-row> </div>
</div> </div>
</template> </template>
@@ -180,6 +181,15 @@ export default {
} }
</script> </script>
<style lang="stylus"> <style lang="stylus">
$transitionDefault = all 0.25s cubic-bezier(0.4, 0, 0.2, 1)
$borderRadius = 8px
$cardBg = rgba(55, 60, 70, 0.55)
$hoverBg = rgba(50, 54, 62, 0.7)
$selectedBorder = #409EFF
$cardShadow = 0 3px 8px rgba(0, 0, 0, 0.25)
$cardShadowHover = 0 5px 15px rgba(0, 0, 0, 0.35)
$normalBorder = rgba(150, 150, 150, 0.25)
#config-list-view #config-list-view
position absolute position absolute
min-height 100% min-height 100%
@@ -187,72 +197,160 @@ export default {
right 0 right 0
overflow-x hidden overflow-x hidden
overflow-y auto overflow-y auto
padding-bottom 50px padding 0 20px 90px
box-sizing border-box box-sizing border-box
display flex
flex-direction column
.view-title
color #eee
font-size 24px
font-weight 500
margin 20px 0
text-align center
letter-spacing 0.5px
.config-list-container
flex 1
width 100%
box-sizing border-box
.config-list .config-list
flex-wrap wrap margin 0
width: 98% width 100%
.config-item
height 85px .config-item-col
margin-bottom 20px margin-bottom 20px
border-radius 4px
cursor pointer .config-card
box-sizing border-box position relative
padding 8px height 110px
background rgba(130, 130, 130, .2) border-radius $borderRadius
border 1px solid transparent background $cardBg
box-shadow 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04) backdrop-filter blur(5px)
box-shadow $cardShadow
transition $transitionDefault
cursor pointer
overflow hidden
display flex
align-items center
justify-content space-between
padding 0 15px 0 20px
border 1px solid $normalBorder
&:hover
transform translateY(-3px)
box-shadow $cardShadowHover
background $hoverBg
&.selected
border 1px solid $selectedBorder
background rgba(64, 158, 255, 0.15) // Slightly more visible selected state
.default-badge
position absolute
right 0
top 0
font-size 11px
font-weight 600
padding 4px 10px
background $selectedBorder
color #fff
z-index 5
border-bottom-left-radius $borderRadius
.config-card-content
flex-grow 1
padding 15px 0
overflow hidden
position relative position relative
.config-name .config-name
color #eee color #fff
font-size 16px font-size 16px
font-weight 500
margin-bottom 10px
white-space nowrap
overflow hidden
text-overflow ellipsis
.config-update-time .config-update-time
color #aaa color #aaa
font-size 14px font-size 14px
margin-top 10px
.default-text .config-card-actions
color #67C23A display flex
font-size 12px flex-direction row
margin-top 5px gap 10px
.operation-container align-items center
position absolute
right 5px .action-btn
top 8px transition $transitionDefault
left 0 border none
font-size 18pxc width 32px
word-break break-all height 32px
display flex display flex
align-items center align-items center
color #eee justify-content center
.el-icon-edit
right 20px &.edit-btn
position absolute &:hover
top 2px transform scale(1.1)
margin-right 10px
cursor pointer &.delete-btn
.el-icon-delete &:hover:not(:disabled)
position absolute transform scale(1.1)
top 2px
margin-right 10px &:disabled
right 0 opacity 0.5
cursor pointer cursor not-allowed
.el-icon-edit
margin-right 10px .add-card
.disabled display flex
cursor not-allowed flex-direction column
color #aaa align-items center
.config-item-add justify-content center
display: flex background rgba(50, 54, 62, 0.4)
justify-content: center border 1px dashed rgba(255, 255, 255, 0.4)
align-items: center
color: #eee &:hover
font-size: 28px border-color rgba(255, 255, 255, 0.8)
.selected background rgba(64, 158, 255, 0.15)
border 1px solid #409EFF
.add-icon
transform rotate(90deg)
.add-icon
font-size 32px
color #eee
margin-bottom 8px
transition $transitionDefault
.add-text
color #eee
font-size 14px
.set-default-container .set-default-container
position absolute position fixed
bottom 10px bottom 0
width 100% left 162px
right 0
display flex
justify-content center
align-items center
padding 15px 0
height 70px
background linear-gradient(to top, rgba(30, 34, 42, 0.95) 0%, rgba(30, 34, 42, 0.8) 60%, rgba(30, 34, 42, 0) 100%)
z-index 10
.set-default-btn .set-default-btn
width 250px width 250px
height 40px
font-weight 500
transition $transitionDefault
margin-bottom 0
&:not(:disabled):hover
transform translateY(-2px)
box-shadow 0 4px 12px rgba(0, 0, 0, 0.3)
</style> </style>