fix: refine user post transitions
This commit is contained in:
1 parent
352f1d57e6
commit
68b58851e8
6 files changed
+300
-35
No files matched your search
+2
-2
@@ -18,7 +18,7 @@ import Modals from '@/components/Modals';
|
||||
import LoadingScreen from '@/components/LoadingScreen';
|
||||
|
||||
function HomeInner() {
|
||||
const { view, currentPostId, currentPostPreview, currentUsername, currentUserPreview, currentPageName, ready, forumName, forumNameLoaded } = useApp();
|
||||
const { view, currentPostId, currentPostPreview, currentUsername, currentUserPreview, currentUserPostsPreview, currentPageName, ready, forumName, forumNameLoaded } = useApp();
|
||||
const [modal, setModal] = useState(null); // null | login | register | report
|
||||
const [reportPostId, setReportPostId] = useState(null);
|
||||
|
||||
@@ -42,7 +42,7 @@ function HomeInner() {
|
||||
{/* 独立页面 */}
|
||||
<div style={{ display: view !== 'feed' ? 'block' : 'none' }}>
|
||||
{view === 'post' && currentPostId && <PostDetail postId={currentPostId} initialPost={currentPostPreview} />}
|
||||
{view === 'user' && currentUsername && <UserProfile username={currentUsername} initialUser={currentUserPreview} />}
|
||||
{view === 'user' && currentUsername && <UserProfile username={currentUsername} initialUser={currentUserPreview} initialPosts={currentUserPostsPreview} />}
|
||||
{view === 'custom' && currentPageName && <CustomPage pageName={currentPageName} />}
|
||||
{view === 'new' && <NewPost />}
|
||||
{view === 'admin' && <AdminPage />}
|
||||
|
||||
+30
-10
@@ -1237,16 +1237,16 @@ html.post-view-transition::view-transition-group(post-sidebar) {
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-group(post-heading) {
|
||||
animation-duration: 0.64s;
|
||||
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
animation-duration: 0.8s;
|
||||
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-group(post-avatar),
|
||||
html.post-view-transition::view-transition-group(post-author),
|
||||
html.post-view-transition::view-transition-group(post-pin-state),
|
||||
html.post-view-transition::view-transition-group(post-edited-label) {
|
||||
animation-duration: 0.68s;
|
||||
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
animation-duration: 0.8s;
|
||||
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-group(post-body) {
|
||||
@@ -1260,8 +1260,8 @@ html.home-view-transition.returning-home::view-transition-image-pair(post-body)
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-group(post-time) {
|
||||
animation-duration: 1.05s;
|
||||
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
animation-duration: 0.8s;
|
||||
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-group(persistent-navbar),
|
||||
@@ -1300,11 +1300,11 @@ html.post-view-transition::view-transition-new(post-expand) {
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-old(post-heading) {
|
||||
animation: sharedTitleMorphOut 0.64s ease-out both;
|
||||
animation: sharedTitleMorphOut 0.8s cubic-bezier(0.42, 0, 0.58, 1) both;
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-new(post-heading) {
|
||||
animation: sharedTitleMorphIn 0.64s ease-out both;
|
||||
animation: sharedTitleMorphIn 0.8s cubic-bezier(0.42, 0, 0.58, 1) both;
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-old(post-time) {
|
||||
@@ -1319,14 +1319,14 @@ html.post-view-transition::view-transition-old(post-avatar),
|
||||
html.post-view-transition::view-transition-old(post-author),
|
||||
html.post-view-transition::view-transition-old(post-pin-state),
|
||||
html.post-view-transition::view-transition-old(post-edited-label) {
|
||||
animation: sharedPartMorphOut 0.68s ease-out both;
|
||||
animation: sharedPartMorphOut 0.8s cubic-bezier(0.42, 0, 0.58, 1) both;
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-new(post-avatar),
|
||||
html.post-view-transition::view-transition-new(post-author),
|
||||
html.post-view-transition::view-transition-new(post-pin-state),
|
||||
html.post-view-transition::view-transition-new(post-edited-label) {
|
||||
animation: sharedPartMorphIn 0.68s ease-out both;
|
||||
animation: sharedPartMorphIn 0.8s cubic-bezier(0.42, 0, 0.58, 1) both;
|
||||
}
|
||||
|
||||
html.post-view-transition::view-transition-group(post-edited-detail),
|
||||
@@ -2610,6 +2610,26 @@ html.home-view-transition.returning-home::view-transition-new(post-body) {
|
||||
box-shadow: var(--glass-shadow-hover) !important;
|
||||
}
|
||||
|
||||
#userProfileContent .user-post-preview {
|
||||
position: relative;
|
||||
max-height: 8.5em;
|
||||
overflow: hidden;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
#userProfileContent .user-post-preview.has-fade {
|
||||
-webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
|
||||
mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
|
||||
}
|
||||
|
||||
#userProfileContent .user-post-preview > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#userProfileContent .user-post-preview > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 亮色模式下稍微实一点,避免太透 */
|
||||
[data-theme="light"] #userProfileContent > div:first-child {
|
||||
background: rgba(255, 255, 255, 0.5) !important;
|
||||
|
||||
Reference in new issue
Block a user