优化 FileBrowser 和 TransferHistoryView 组件的高度计算逻辑,调整 Footer 组件的动态按钮样式和动画效果

This commit is contained in:
jxxghp
2025-04-21 08:38:21 +08:00
parent 93005518d2
commit 71437a2122
4 changed files with 92 additions and 56 deletions
+2 -2
View File
@@ -181,14 +181,14 @@ function fileListUpdated(items: FileItem[]) {
// 外层DIV大小控制 // 外层DIV大小控制
const scrollStyle = computed(() => { const scrollStyle = computed(() => {
return appMode return appMode
? 'height: calc(100vh - 10rem - env(safe-area-inset-bottom) - 6rem)' ? 'height: calc(100vh - 10rem - env(safe-area-inset-bottom) - 7rem)'
: 'height: calc(100vh - 10rem - env(safe-area-inset-bottom)' : 'height: calc(100vh - 10rem - env(safe-area-inset-bottom)'
}) })
// 文件列表大小限制 // 文件列表大小限制
const fileListStyle = computed(() => { const fileListStyle = computed(() => {
return appMode return appMode
? 'height: calc(100vh - 14rem - env(safe-area-inset-bottom) - 6rem)' ? 'height: calc(100vh - 14rem - env(safe-area-inset-bottom) - 7rem)'
: 'height: calc(100vh - 14rem - env(safe-area-inset-bottom)' : 'height: calc(100vh - 14rem - env(safe-area-inset-bottom)'
}) })
</script> </script>
+83 -50
View File
@@ -89,7 +89,7 @@ const showDynamicButton = computed(() => {
<template> <template>
<Teleport v-if="appMode" to="body"> <Teleport v-if="appMode" to="body">
<div class="footer-nav-container"> <div class="footer-nav-container">
<VCard class="footer-nav-card border" rounded="pill"> <VCard class="footer-nav-card border" rounded="pill" :class="{ 'shift-left': showDynamicButton }">
<VCardText class="footer-card-content"> <VCardText class="footer-card-content">
<!-- 添加指示器 --> <!-- 添加指示器 -->
<div ref="indicator" class="nav-indicator"></div> <div ref="indicator" class="nav-indicator"></div>
@@ -132,14 +132,23 @@ const showDynamicButton = computed(() => {
</VBtnToggle> </VBtnToggle>
</VCardText> </VCardText>
</VCard> </VCard>
<VCard v-if="showDynamicButton" class="footer-nav-card dynamic-btn-card border" rounded="pill"> <Transition name="fade-slide">
<VCardText class="footer-card-content"> <VCard v-if="showDynamicButton" class="footer-nav-card dynamic-btn-card border" rounded="pill">
<!-- 各页面的动态按钮 --> <VCardText class="footer-card-content">
<VBtn icon variant="text" :ripple="false" @click="dynamicButton?.action()" rounded="pill" class="footer-nav-btn"> <!-- 各页面的动态按钮 -->
<VIcon color="secondary" :icon="dynamicButton?.icon || 'mdi-plus'" size="24"></VIcon> <VBtn
</VBtn> icon
</VCardText> variant="text"
</VCard> :ripple="false"
@click="dynamicButton?.action()"
rounded="pill"
class="footer-nav-btn"
>
<VIcon color="secondary" :icon="dynamicButton?.icon || 'mdi-plus'" size="24"></VIcon>
</VBtn>
</VCardText>
</VCard>
</Transition>
</div> </div>
</Teleport> </Teleport>
</template> </template>
@@ -147,76 +156,54 @@ const showDynamicButton = computed(() => {
<style lang="scss"> <style lang="scss">
.footer-nav-container { .footer-nav-container {
position: fixed; position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1999; z-index: 1999;
padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
justify-content: center;
inset-block-end: 0;
inset-inline: 0;
padding-block-end: calc(6px + env(safe-area-inset-bottom, 0px));
pointer-events: none; pointer-events: none;
// 按钮卡片之间的间距 // 按钮卡片之间的间距
> .v-card + .v-card { > .v-card + .v-card {
margin-left: 4px; margin-inline-start: 2px; // 减少间距
} }
} }
.footer-nav-card { .footer-nav-card {
pointer-events: auto;
overflow: hidden;
background-color: rgba(var(--v-theme-surface), 0.8);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
position: relative; position: relative;
} overflow: hidden;
backdrop-filter: blur(12px);
background-color: rgba(var(--v-theme-surface), 0.8);
pointer-events: auto;
transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
// 动态按钮卡片样式 &.shift-left {
.dynamic-btn-card { transform: translateX(0);
min-height: 0;
height: auto;
width: auto;
.footer-card-content {
padding: 3px;
}
.footer-nav-btn {
min-width: 40px;
width: 40px;
height: 40px;
padding: 0;
.btn-content {
margin: 0;
}
.v-icon {
margin-bottom: 0;
}
} }
} }
.footer-card-content { .footer-card-content {
padding: 6px 8px;
position: relative; position: relative;
padding-block: 6px;
padding-inline: 8px;
} }
.footer-btn-group { .footer-btn-group {
width: 100%; position: relative;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
background-color: transparent;
border: none; border: none;
position: relative; background-color: transparent;
inline-size: 100%;
} }
.footer-nav-btn { .footer-nav-btn {
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 0; flex-grow: 0;
position: relative;
background-color: transparent; background-color: transparent;
&.v-btn--active { &.v-btn--active {
@@ -232,11 +219,57 @@ const showDynamicButton = computed(() => {
} }
} }
@keyframes fadeIn { // 动态按钮卡片样式
.dynamic-btn-card {
block-size: auto;
inline-size: auto;
min-block-size: 0;
.footer-card-content {
padding: 3px;
}
.footer-nav-btn {
padding: 0;
block-size: 36px;
inline-size: 36px;
min-inline-size: 36px;
.btn-content {
margin: 0;
}
.v-icon {
margin-block-end: 0;
}
}
}
// 淡入滑动动画
.fade-slide-enter-active {
transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.fade-slide-leave-active {
transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.fade-slide-enter-from {
opacity: 0;
transform: translateX(20px);
}
.fade-slide-leave-to {
opacity: 0;
transform: translateX(20px);
}
@keyframes fade-in {
from { from {
opacity: 0; opacity: 0;
transform: translateX(-50%) translateY(10px); transform: translateX(-50%) translateY(10px);
} }
to { to {
opacity: 1; opacity: 1;
transform: translateX(-50%) translateY(0); transform: translateX(-50%) translateY(0);
+6 -3
View File
@@ -273,8 +273,10 @@ html.v-overlay-scroll-blocked {
} }
} }
.v-list-item:hover { .v-menu {
background-color: rgba(var(--v-theme-on-surface), 0.04) !important; .v-list-item:hover {
background-color: rgba(var(--v-theme-on-surface), 0.04) !important;
}
} }
.v-btn.v-btn--icon { .v-btn.v-btn--icon {
@@ -343,10 +345,11 @@ html.v-overlay-scroll-blocked {
background-color: rgba(var(--v-theme-surface), 0.3); background-color: rgba(var(--v-theme-surface), 0.3);
.v-list { .v-list {
background-color: transparent;
backdrop-filter: none; backdrop-filter: none;
background-color: transparent;
} }
} }
// 工具栏 // 工具栏
.v-toolbar { .v-toolbar {
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
+1 -1
View File
@@ -189,7 +189,7 @@ const TransferDict: { [key: string]: string } = {
const tableStyle = computed(() => { const tableStyle = computed(() => {
return appMode return appMode
? 'height: calc(100vh - 14rem - env(safe-area-inset-bottom) - 6rem)' ? 'height: calc(100vh - 14rem - env(safe-area-inset-bottom) - 7.5rem)'
: 'height: calc(100vh - 14rem - env(safe-area-inset-bottom)' : 'height: calc(100vh - 14rem - env(safe-area-inset-bottom)'
}) })