Skip to content

feat: Replace requestAnimationFrame with GSAP in moveto animation#196

Open
Copilot wants to merge 2 commits intomainfrom
copilot/change-animation-logic-to-gasp
Open

feat: Replace requestAnimationFrame with GSAP in moveto animation#196
Copilot wants to merge 2 commits intomainfrom
copilot/change-animation-logic-to-gasp

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

The moveto tag used a manual requestAnimationFrame loop with linear interpolation, limiting visual expressiveness. This replaces it with GSAP for richer, easing-based animation.

Changes

  • package.json: Added gsap@3.14.2 as a production dependency
  • src/core/drawer.ts: Rewrote moveTo() to use gsap.to() with power2.out easing

Before → After

// Before: manual rAF loop, linear only
const move = (currentTime: any) => {
  const progress = Math.min((currentTime - startTime) / 1000 / durning, 1)
  target.pos.x = startPos.x + (dest.x - startPos.x) * progress
  target.pos.y = startPos.y + (dest.y - startPos.y) * progress
  this.show(displayedImages)
  if (progress < 1) window.requestAnimationFrame(move)
  else resolve(null)
}
window.requestAnimationFrame(move)

// After: GSAP with easing
gsap.to(target.pos, {
  x: dest.x,
  y: dest.y,
  duration: durning,
  ease: 'power2.out',
  onUpdate: () => this.show(displayedImages),
  onComplete: () => resolve(null),
})

The Promise-based API and relative-offset coordinate semantics are preserved, so no changes are required in callers.

Original prompt

This section details on the original issue you should resolve

<issue_title>movetoタグのアニメーションロジックをGASPに変更する。</issue_title>
<issue_description>演出強化を目的に、アニメーションロジックを変更する</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webtalekit-demo Error Error Mar 17, 2026 1:54pm

Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com>
Copilot AI changed the title [WIP] Update animation logic to GASP for enhanced effects feat: Replace requestAnimationFrame with GSAP in moveto animation Mar 17, 2026
Copilot AI requested a review from EndoHizumi March 17, 2026 13:55
@EndoHizumi EndoHizumi marked this pull request as ready for review March 20, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

movetoタグのアニメーションロジックをGASPに変更する。

2 participants