1. Scene を設定
scene width=1280 height=720 fps=60 のようにキャンバスサイズと FPS を指定します。省略時は 1280x720 / 60fps です。
Fluxion Text DSL
Fluxion は短い宣言的な Text DSL を .fluxion.json に変換し、SVG ランタイムでその場で再生します。
Python や任意コードをブラウザで実行せず、図形の配置・表示タイミング・プロパティアニメーションを安全に試せます。
まず scene を宣言し、node を配置し、timeline に show / animate を追加します。左のエディタに貼り付けて Compile または Live compile で確認できます。
scene width=1280 height=720 fps=60 のようにキャンバスサイズと FPS を指定します。省略時は 1280x720 / 60fps です。
circle、rect、line、text に一意な id を付け、at x,y や fill で見た目を指定します。
show id で表示し、animate id.x from 0 to 100 duration=1s のようにプロパティを動かします。
このサンプルはタイトルと円を表示し、円の x 座標を 1.5 秒で移動させます。
scene width=1280 height=720 fps=60
text title "Fluxion MVP" at 640,110 size=32 fill="#e2e8f0"
circle c1 r=48 at 220,360 fill="#38bdf8" stroke="#0f172a" strokeWidth=4
at 0s:
show title
show c1
animate c1.x from 220 to 640 duration=1.5s easing=easeInOut
DSL を編集するとブラウザ内で Fluxion IR にコンパイルされ、右側の SVG プレビューと JSON 出力が更新されます。
Text DSL は現在サポートしている小さな構文に絞っています。より詳しい仕様は正本の site/src/content/docs/reference/text-dsl.md を参照してください。
scene width=<number> height=<number> fps=<number>circle <id> r=<number> at x,yrect <id> w=<number> h=<number> at x,yline <id> x1=<number> y1=<number> x2=<number> y2=<number>text <id> "label" at x,y size=<number>math <id> "e^{i\\pi}+1=0" renderer=katex|mathjax size=<number>at 1.5s: で block 内の開始時刻を指定show <id> で node を作成animate <id>.<property> from <value> to <value> duration=1sx, y, scale, rotation, opacity, fill, stroke, strokeWidth, geometry fieldslinear, smooth, easeInOut, easeIn, easeOut