From b781a8d2fe69bd064a450d656829e894f8ee878a Mon Sep 17 00:00:00 2001 From: qing <1776177662@qq.com> Date: Thu, 6 Aug 2026 17:49:15 +0000 Subject: [PATCH] =?UTF-8?q?fix(static):=20=E4=BF=AE=E5=A4=8D=E7=89=B9?= =?UTF-8?q?=E6=95=88=E8=8A=82=E7=82=B9=E5=85=A8=E5=B1=8F=20iframe=20?= =?UTF-8?q?=E8=A2=AB=E5=8D=A1=E7=89=87=20transform=20=E5=9B=B0=E4=BD=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 卡片入场动画的 translateY 使卡片成为 position:fixed 后代的包含块, 全屏特效 iframe 被限制在卡片内渲染,表现为部分特效不自动启动 (in-node 特效为 relative 定位不受影响)。卡片入场改为纯 opacity 淡入; 带位移的 rise-in 仅用于无 fixed 后代的骨架元素,并排除依赖 transform 垂直居中的 .minimap。 --- static/public/css/dnfs.css | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/static/public/css/dnfs.css b/static/public/css/dnfs.css index e402198..ca367a1 100644 --- a/static/public/css/dnfs.css +++ b/static/public/css/dnfs.css @@ -31,13 +31,22 @@ body::after { pointer-events: none; } -/* ===== 节点卡片入场:逐张上浮(JS 动态插入时播放) ===== */ +/* ===== 节点卡片入场:逐张淡入(JS 动态插入时播放) ===== + * 注意:此处只能动画 opacity,不能带 transform——特效节点的全屏 iframe 是 + * position:fixed,祖先 transform 会成为 fixed 后代的包含块,把全屏特效困在卡片内 + *(in-node 特效是 relative 定位不受影响,故障表现为"部分特效不自动启动") */ @keyframes card-in { + from { opacity: 0; } + to { opacity: 1; } +} +/* 带位移的入场仅用于不含 fixed 后代的骨架元素; + * 不含 .minimap——它自身依赖 transform: translateY(-50%) 垂直居中,动画会覆盖 */ +@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } } @media (prefers-reduced-motion: no-preference) { - .recommend-list .card { animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; } + .recommend-list .card { animation: card-in 0.45s ease both; } .recommend-list .card:nth-of-type(2) { animation-delay: 0.05s; } .recommend-list .card:nth-of-type(3) { animation-delay: 0.1s; } .recommend-list .card:nth-of-type(4) { animation-delay: 0.15s; } @@ -47,8 +56,9 @@ body::after { .recommend-list .card:nth-of-type(n+8) { animation-delay: 0.35s; } /* 首屏骨架元素入场 */ - .searchbox, .userpanel, .minimap, .node-form { animation: card-in 0.4s ease both; } + .searchbox, .node-form { animation: rise-in 0.4s ease both; } .node-form { animation-delay: 0.1s; } + .userpanel, .minimap { animation: card-in 0.4s ease both; } } /* ===== 搜索框:hover 升温(focus 高亮由 theme.css 提供) ===== */