Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Animations a script creates before the runtime loads land up to a frame off, differently each load

未关闭
#4,559 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@cooleryu 已经在做这个了。

开始于 2026年10月4日。

  • #5017 来自 @cooleryu —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

Start in packages/core/src/runtime/adapters/waapi.ts, focusing on ensureBaseline and how it records an animation's currentTime. Run the supplied headless Chrome reproduction with window.__player.seek(2) across several page loads, then verify the computed transform consistently reads translateX(50px) for the pre-runtime animation.

由索引模型根据 Issue 内容生成。

描述

What happens

An animation a composition's script creates with el.animate() before the runtime loads lands up to a frame off after a seek, differently on each page load. A 4 s linear 100 px slide seeked to 2 s reads 50 to 51.25 px instead of 50.

The WAAPI adapter records a baseline for each animation the first time it sees it, including the animation's own currentTime at that moment (ensureBaseline in packages/core/src/runtime/adapters/waapi.ts). An animation created before the runtime has already been running on the wall clock for however long loading took, so every later seek is offset by that amount. Animations created after the runtime loads go through the adapter's Element.prototype.animate hook and are anchored where they are created.

Repro

Headless Chrome, the runtime built from main, window.__player.seek(2), then read the computed transform. Load the page several times.

<div data-composition-id="main" data-root="true" data-start="0" data-duration="10" data-width="640" data-height="360">
  <div id="el" class="clip" data-start="0" data-duration="10">el</div>
</div>
<script>
  document.getElementById("el").animate(
    [{ transform: "translateX(0)" }, { transform: "translateX(100px)" }],
    { duration: 4000, easing: "linear", fill: "both" },
  );
</script>
<!-- then the runtime script -->

Expected: translateX(50px) on every load.
Observed: 50 to 51.25 px, varying by load.

Notes

  • Same family as #4555 (CSS animations in shadow roots and on pseudo-elements), which anchors CSS animations at their clip's start. Script-created animations need their own decision about where they start, so they are kept separate.
主要语言
TypeScript
星标
54.1k
派生
4.9k
平均合并
9 小时 3 分钟
30 天内合并 PR
670

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

heygen-com/hyperframes 的其他 Issue

查看 heygen-com/hyperframes 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。