From 8dbd8ff4cf7d36ea1e91e7c3b4bd486e8f0e5e3a Mon Sep 17 00:00:00 2001
From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 4 May 2025 13:52:01 +0900
Subject: enhance(frontend): タイムラインpush時のアニメーションを調整 (#15936)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* fix(frontend): タイムラインpush時のアニメーションを復元

* :art:

* enhance: 消える際のアニメーションも追加

* better support for non-supported browsers

* fix: Skip Note Rendering有効時、TransitionGroupでnoteを追加するときに一瞬がくっとなる問題を修正

* :art:

* fix
---
 .../frontend/src/components/MkNotifications.vue    | 36 +++++++++++++++++-----
 1 file changed, 28 insertions(+), 8 deletions(-)

(limited to 'packages/frontend/src/components/MkNotifications.vue')

diff --git a/packages/frontend/src/components/MkNotifications.vue b/packages/frontend/src/components/MkNotifications.vue
index 177ae0219c..308a077bd9 100644
--- a/packages/frontend/src/components/MkNotifications.vue
+++ b/packages/frontend/src/components/MkNotifications.vue
@@ -103,18 +103,38 @@ defineExpose({
 </script>
 
 <style lang="scss" module>
-.transition_x_move,
-.transition_x_enterActive,
+.transition_x_move {
+	transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
+}
+
+.transition_x_enterActive {
+	transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1);
+
+	&.item,
+	.item {
+		/* Skip Note Rendering有効時、TransitionGroupで通知を追加するときに一瞬がくっとなる問題を抑制する */
+		content-visibility: visible !important;
+	}
+}
+
 .transition_x_leaveActive {
-	transition: opacity 0.3s cubic-bezier(0,.5,.5,1), transform 0.3s cubic-bezier(0,.5,.5,1) !important;
+	transition: height 0.2s cubic-bezier(0,.5,.5,1), opacity 0.2s cubic-bezier(0,.5,.5,1);
 }
-.transition_x_enterFrom,
-.transition_x_leaveTo {
+
+.transition_x_enterFrom {
 	opacity: 0;
-	transform: translateY(-50%);
+	transform: translateY(max(-64px, -100%));
 }
-.transition_x_leaveActive {
-	position: absolute;
+
+@supports (interpolate-size: allow-keywords) {
+	.transition_x_enterFrom {
+		interpolate-size: allow-keywords; // heightのtransitionを動作させるために必要
+		height: 0;
+	}
+}
+
+.transition_x_leaveTo {
+	opacity: 0;
 }
 
 .notifications {
-- 
cgit v1.2.3-freya

