fix: smooth post title and card morph

This commit is contained in:
lezi-fun committed 2026-08-11 15:32:26 +08:00
1 parent 608e6b2522
commit ae2d5e82ca
3 files changed
+26 -25

No files matched your search

+1
View File
@@ -31,6 +31,7 @@ export async function GET(req) {
p.*,
u.username,
u.avatar_url,
u.signature,
(SELECT COUNT(*) FROM replies WHERE post_id = p.id) as reply_count
FROM posts p
JOIN users u ON p.user_id = u.id
+23 -11
View File
@@ -920,6 +920,13 @@ html.home-view-transition.returning-home #pagePost .post-page-header h2 {
view-transition-name: post-heading;
}
html.post-view-transition .post-card .post-title,
html.home-view-transition.returning-home .post-card .post-title {
display: block;
width: max-content;
max-width: 100%;
}
html.post-view-transition::view-transition,
html.home-view-transition::view-transition {
background: linear-gradient(145deg, var(--bg-start) 0%, var(--bg-end) 100%);
@@ -930,12 +937,16 @@ html.post-view-transition::view-transition-group(post-expand) {
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
html.post-view-transition::view-transition-group(post-sidebar),
html.post-view-transition::view-transition-group(post-heading) {
html.post-view-transition::view-transition-group(post-sidebar) {
animation-duration: 0.72s;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
html.post-view-transition::view-transition-group(post-heading) {
animation-duration: 0.64s;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
html.post-view-transition::view-transition-group(post-time) {
animation-duration: 1.05s;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
@@ -968,11 +979,11 @@ html.post-view-transition::view-transition-new(post-expand) {
}
html.post-view-transition::view-transition-old(post-heading) {
animation: sharedTitleOut 0.14s 0.48s ease-out both;
animation: sharedTitleMorphOut 0.64s ease-out both;
}
html.post-view-transition::view-transition-new(post-heading) {
animation: sharedTitleIn 0.14s 0.82s ease-out both;
animation: sharedTitleMorphIn 0.64s ease-out both;
}
html.post-view-transition::view-transition-old(post-time) {
@@ -1028,11 +1039,11 @@ html.home-view-transition.returning-home::view-transition-new(post-expand) {
}
html.home-view-transition.returning-home::view-transition-old(post-heading) {
animation: sharedTitleOut 0.12s 0.22s ease-out both;
animation: sharedTitleMorphOut 0.42s ease-out both;
}
html.home-view-transition.returning-home::view-transition-new(post-heading) {
animation: sharedTitleIn 0.12s 0.36s ease-out both;
animation: sharedTitleMorphIn 0.42s ease-out both;
}
html.home-view-transition.returning-home::view-transition-old(post-time),
@@ -1082,13 +1093,14 @@ html.home-view-transition.returning-home::view-transition-new(post-sidebar) {
to { opacity: 1; }
}
@keyframes sharedTitleOut {
to { opacity: 0; }
@keyframes sharedTitleMorphOut {
0%, 68% { opacity: 1; }
100% { opacity: 0; }
}
@keyframes sharedTitleIn {
from { opacity: 0; }
to { opacity: 1; }
@keyframes sharedTitleMorphIn {
0%, 62% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes sharedTimeOut {