🎨 收紧移动端详情弹窗布局

This commit is contained in:
orion committed 2026-08-07 22:26:21 +08:00
1 parent cc93163f59
commit 7a8ff7bff6
5 files changed
+32 -32

No files matched your search

+9 -9
View File
@@ -8,21 +8,21 @@
>
<div class="fixed inset-0 bg-black/50 transition-opacity" aria-hidden="true"></div>
<div class="flex min-h-full items-center justify-center p-4">
<div class="flex min-h-full items-center justify-center p-3 sm:p-4">
<div
ref="modalRef"
role="dialog"
aria-modal="true"
:aria-label="title || t('common.dialog')"
tabindex="-1"
class="relative flex max-h-[calc(100dvh-2rem)] transform flex-col overflow-hidden rounded-[24px] shadow-xl transition-all sm:rounded-[30px]"
class="relative flex max-h-[calc(100dvh-1.5rem)] transform flex-col overflow-hidden rounded-[24px] shadow-xl transition-all sm:max-h-[calc(100dvh-2rem)] sm:rounded-[30px]"
:class="[sizeClasses, isDarkMode ? 'bg-gray-800' : 'bg-white']"
@click.stop
@keydown="handleKeydown"
>
<div
v-if="$slots.header || title"
class="flex shrink-0 items-center justify-between border-b px-4 py-3 sm:px-6 sm:py-4"
class="flex shrink-0 items-center justify-between border-b px-3 py-3 sm:px-6 sm:py-4"
:class="[isDarkMode ? 'border-gray-700' : 'border-gray-200']"
>
<slot name="header">
@@ -33,7 +33,7 @@
<button
v-if="closable"
type="button"
class="flex h-11 w-11 shrink-0 items-center justify-center rounded-lg transition-colors"
class="flex h-11 w-11 shrink-0 items-center justify-center rounded-[30px] transition-colors"
:class="[
isDarkMode
? 'text-gray-300 hover:bg-gray-700 hover:text-white'
@@ -47,13 +47,13 @@
</button>
</div>
<div class="min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6" tabindex="0">
<div class="min-h-0 flex-1 overflow-y-auto px-3 py-3 sm:px-6 sm:py-4" tabindex="0">
<slot></slot>
</div>
<div
v-if="$slots.footer"
class="flex shrink-0 flex-wrap items-center justify-end gap-2 border-t px-4 py-3 sm:px-6 sm:py-4"
class="flex shrink-0 flex-wrap items-center justify-end gap-2 border-t px-3 py-3 sm:px-6 sm:py-4"
:class="[isDarkMode ? 'border-gray-700 bg-gray-900/50' : 'border-gray-200 bg-gray-50']"
>
<slot name="footer"></slot>
@@ -148,11 +148,11 @@ watch(
<style scoped>
.modal-enter-active,
.modal-leave-active {
transition: opacity 0.24s ease;
transition: opacity 0.18s ease;
}
.modal-enter-active .relative,
.modal-leave-active .relative {
transition: transform 0.24s ease, opacity 0.24s ease;
transition: transform 0.18s ease, opacity 0.18s ease;
}
.modal-enter-from,
.modal-leave-to {
@@ -161,7 +161,7 @@ watch(
.modal-enter-from .relative,
.modal-leave-to .relative {
opacity: 0;
transform: scale(0.97) translateY(-10px);
transform: scale(0.985) translateY(-8px);
}
@media (prefers-reduced-motion: reduce) {
.modal-enter-active,
@@ -6,17 +6,17 @@
@click.self="$emit('close')"
>
<div
class="p-6 rounded-2xl max-w-3xl w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg bg-opacity-70 max-h-[85vh] overflow-hidden flex flex-col"
class="flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-[24px] bg-opacity-70 p-4 shadow-2xl transform transition-all duration-200 ease-out backdrop-filter backdrop-blur-lg sm:mx-4 sm:rounded-[30px] sm:p-6"
:class="[isDarkMode ? 'bg-gray-800' : 'bg-white']"
>
<div class="flex justify-between items-center mb-4 flex-shrink-0">
<h3 class="text-2xl font-bold" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
<h3 class="text-xl font-bold sm:text-2xl" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
{{ t('contentPreview.title') }}
</h3>
<div class="flex items-center gap-3">
<button
@click="$emit('copy-content')"
class="px-4 py-1.5 rounded-lg transition duration-300 flex items-center gap-2 text-sm font-medium"
class="inline-flex items-center gap-2 rounded-[30px] px-3 py-1.5 text-sm font-medium transition duration-200 sm:px-4"
:class="[
isDarkMode
? 'bg-gray-700 hover:bg-gray-600 text-gray-300 hover:text-white'
@@ -28,7 +28,7 @@
</button>
<button
@click="$emit('close')"
class="p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10"
class="rounded-[30px] p-1.5 transition duration-200 hover:bg-opacity-10"
:class="[
isDarkMode
? 'text-gray-400 hover:text-white hover:bg-white'
@@ -41,7 +41,7 @@
</div>
<div class="flex-1 overflow-y-auto custom-scrollbar">
<div
class="prose max-w-none p-6 rounded-xl break-words overflow-wrap-anywhere"
class="prose max-w-none rounded-[20px] p-4 break-words overflow-wrap-anywhere sm:rounded-[24px] sm:p-6"
:class="[isDarkMode ? 'prose-invert bg-gray-900 bg-opacity-50' : 'bg-gray-50']"
v-html="renderedContent"
></div>
@@ -75,7 +75,7 @@ const isDarkMode = inject('isDarkMode')
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
transition: opacity 0.2s ease;
}
.fade-enter-from,
+8 -8
View File
@@ -6,16 +6,16 @@
@click.self="$emit('close')"
>
<div
class="p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg overflow-hidden"
class="w-full max-w-md mx-3 overflow-hidden rounded-[24px] shadow-2xl transform transition-all duration-200 ease-out backdrop-filter backdrop-blur-lg sm:mx-4 sm:rounded-[30px]"
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-70' : 'bg-white bg-opacity-95']"
>
<h3
class="text-2xl font-bold mb-6 truncate"
class="mb-4 truncate px-4 pt-4 text-xl font-bold sm:mb-5 sm:px-6 sm:pt-6 sm:text-2xl"
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
>
{{ t('fileDetail.title') }}
</h3>
<div class="space-y-4" v-if="record">
<div class="space-y-3 px-4 sm:space-y-4 sm:px-6" v-if="record">
<div class="flex items-center">
<FileIcon
class="w-6 h-6 mr-3 flex-shrink-0"
@@ -63,7 +63,7 @@
<div v-if="record.filename === 'Text'" class="ml-2">
<button
@click="$emit('preview-content')"
class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"
class="rounded-[30px] bg-indigo-600 px-4 py-2 text-white transition duration-200 hover:bg-indigo-700"
>
{{ t('fileDetail.previewContent') }}
</button>
@@ -73,7 +73,7 @@
:href="getDownloadUrl(record)"
target="_blank"
rel="noopener noreferrer"
class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"
class="rounded-[30px] bg-indigo-600 px-4 py-2 text-white transition duration-200 hover:bg-indigo-700"
>
{{ t('fileDetail.download') }}
</a>
@@ -81,7 +81,7 @@
</div>
</div>
<div class="mt-6 flex flex-col items-center" v-if="record">
<div class="mt-5 flex flex-col items-center px-4 sm:mt-6 sm:px-6" v-if="record">
<h4
class="text-lg font-semibold mb-3"
:class="[isDarkMode ? 'text-white' : 'text-gray-800']"
@@ -98,7 +98,7 @@
<button
@click="$emit('close')"
class="mt-8 w-full bg-gradient-to-r from-indigo-500 to-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105"
class="mt-6 w-full rounded-[30px] bg-gradient-to-r from-indigo-500 to-purple-600 px-5 py-3 font-medium text-white transition duration-200 transform hover:scale-[1.01] hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 sm:mt-8 sm:px-6"
>
{{ t('common.close') }}
</button>
@@ -143,7 +143,7 @@ const getQRCodeValue = (record: ReceivedFileRecord) => {
<style scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
transition: opacity 0.2s ease;
}
.fade-enter-from,
@@ -2,26 +2,26 @@
<transition name="fade">
<div
v-if="record"
class="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-3 sm:p-4 overflow-y-auto"
class="fixed inset-0 z-50 flex items-center justify-center overflow-y-auto bg-black/60 p-3 backdrop-blur-sm sm:p-4"
>
<div
class="w-full max-w-2xl rounded-2xl shadow-2xl transform transition-all duration-300 ease-out overflow-hidden"
class="w-full max-w-2xl overflow-hidden rounded-[24px] shadow-2xl transform transition-all duration-200 ease-out sm:rounded-[30px]"
:class="[isDarkMode ? 'bg-gray-900 bg-opacity-70' : 'bg-white bg-opacity-95']"
>
<div
class="px-4 sm:px-6 py-3 sm:py-4 border-b"
class="border-b px-3 py-3 sm:px-6 sm:py-4"
:class="[isDarkMode ? 'border-gray-800' : 'border-gray-100']"
>
<div class="flex items-center justify-between">
<h3
class="text-lg sm:text-xl font-semibold"
class="text-base font-semibold sm:text-xl"
:class="[isDarkMode ? 'text-white' : 'text-gray-900']"
>
{{ t('send.fileDetails') }}
</h3>
<button
@click="$emit('close')"
class="p-1.5 sm:p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
class="rounded-[30px] p-1.5 transition-colors hover:bg-gray-100 dark:hover:bg-gray-800 sm:p-2"
>
<XIcon
class="w-4 h-4 sm:w-5 sm:h-5"
@@ -31,13 +31,13 @@
</div>
</div>
<div class="p-4 sm:p-6">
<div class="p-3 sm:p-5 lg:p-6">
<div
class="rounded-xl p-3 sm:p-4 mb-4 sm:mb-6"
class="mb-3 rounded-[20px] p-3 sm:mb-5 sm:rounded-[24px] sm:p-4"
:class="[isDarkMode ? 'bg-gray-800 bg-opacity-50' : 'bg-gray-50 bg-opacity-95']"
>
<div class="flex items-center mb-3 sm:mb-4">
<div class="p-2 sm:p-3 rounded-lg" :class="[isDarkMode ? 'bg-gray-800' : 'bg-white']">
<div class="rounded-[20px] p-2 sm:rounded-[24px] sm:p-3" :class="[isDarkMode ? 'bg-gray-800' : 'bg-white']">
<FileIcon
class="w-5 h-5 sm:w-6 sm:h-6"
:class="[isDarkMode ? 'text-indigo-400' : 'text-indigo-600']"