先日 @vfx-js/transitions を公開しました。
HTML-in-Canvasでページ遷移時のWebGLトランジション ができるライブラリです。
I published VFX-JS Transitions v0.1.0.
— 𝘼𝙈𝘼𝙂𝙄 (@amagitakayosi) November 7, 2026
You can add next-level page transitions to your website, with just a few lines.#VFXJS #WebGL #HTMLinCanvas pic.twitter.com/7MZrMSSIjb
正確には、既存のVFX-JSに @vfx-js/transitions というpackageを追加した、という形。
HTML-in-Canvas
HTML-in-Canvas は最近 Google Chrome に実装された機能。
<canvas> 要素の中にHTMLを入れることで、HTMLの一部をWebGLのテクスチャとして利用できるようになる。
これにより、3D表現の中にHTML要素を入れたり、3DゲームのUIとして <input> が使えるようになったりする。
このAPIはChrome 157でshipされたばかり。 先日のフロントエンドカンファレンス関西でICS mediaの池田さんが解説されていました。
HTML-in-Canvasで作る未来のWeb UI表現 - Speaker Deck
VFX-JS transitions
VFX-JS transitions は、HTML-in-Canvasを利用して、ページ遷移アニメーションを行うライブラリです。 Next.jsやAstro, SvelteKit等のフレームワーク用にバインディングが用意されているので、数行のコードを追加するだけでページトランジションを実現できます。
Next.jsの場合
layoutでページを囲むwrapperを追加して、ページ内で <TransitionIn> を呼ぶだけでOK。
以下の例では、Aboutページを開くときは0.5秒のZoomアニメーションが、それ以外の場合はSwipeアニメーションが行われることになる。
// app/layout.tsx import { VFXTransition } from "@vfx-js/react/next"; export default function Layout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <body> <VFXTransition transition={Swipe} duration={1.0}>{children}</VFXTransition> </body> </html> ); }
// app/about/page.tsx import { TransitionIn } from "@vfx-js/react"; import { Zoom } from "@vfx-js/transitions"; export default function About() { return ( <> <TransitionIn transition={Zoom} duration={0.5} /> <h1>About</h1> </> ); }
Astroの場合
AstroではClientRouterを使うことになる。
---
import { ClientRouter } from "astro:transitions";
import { VFXTransition } from "@vfx-js/astro";
---
<!-- The shader is the animation, so turn off the view transition. -->
<html lang="en" transition:animate="none">
<head><ClientRouter /></head>
<body>
<VFXTransition transition="crossfade" duration={0.8}>
<slot />
</VFXTransition>
</body>
</html>
Page側はこう
---
import { TransitionIn } from "@vfx-js/astro";
import Layout from "../layouts/Layout.astro";
---
<Layout>
<TransitionIn transition="glitch" />
<h1>About</h1>
</Layout>
AIでトランジションを作ってみる
VFX-JSはllms.txtやSKILL.mdを公開しています。これを使ってトランジションを作ってみよう。
Claudeに以下のプロンプトを入力 (Opus 5.5):
https://amagi.dev/vfx-js/llms-full.txt を読んで、VFX-JSで以下のようなトランジションを作って下さい。 ページ遷移前の画面を100x100くらいのタイルに分割 画面左上から右下に向かって、タイルが順番にめくれていく タイルがめくれた下から、ページ遷移先の画面がフェードインしてくる トランジションを試すための簡単なデモも作って。
3分後……
↓↓↓
イイネ
方向やタイルの照り返しも追加してみよう
- アニメーションの方向は上下左右および中心(同心円状に広がる)から選べるようにして - タイルがめくれるとき、光を反射して白くなるようにして
2分後……
↓↓↓
簡単ですね! 皆さんも好きなトランジションを作ってみましょう!
Claude のセッションは以下に置いておきます:
https://claude.ai/share/3d74ba12-4a03-493e-afba-e85fb258371a https://claude.ai/artifact/7ubmDCgtYSPDL6hhUpavrJ
というわけで、ご利用 / PR / issueお待ちしています 🙏


