Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

Cover loop GIF

A finished newsletter or blog cover where only the one element you name moves — a beam sweeping a lighthouse lamp, a route line drawing itself on — the loop rotated so frame 1 is already the finished picture, then shipped as a silent GIF plus MP4 preview.

範例 · 2

線上執行

免費

在 SandBase sandbox 中執行 Cover loop GIF 的範例,並在此立即查看結果。

運作方式

  1. 01

    Write the sheet

    Write one sheet.json with the still cover as draw ops (rect, circle, line, poly, text, ring and tick) and one motion entry naming the element that moves and how: beam, pulse, draw, drift, glow, cycle, blink, spin or scan. Set loop.offset so that the first frame is already the finished picture. make-sheet.mjs writes the two bundled examples.

  2. 02

    Build the page

    Run npm install, then node scripts/build.mjs build/sheets/demo-1.json --out build/demo-1. The build validates the sheet and compiles it into a HyperFrames page. The bundled covers are 896×640 at 20 fps with a 9-second loop, which is 180 frames. The Skill calls no model, needs no API key and makes no network requests.

  3. 03

    Render and measure the loop

    node scripts/render.mjs renders a silent preview MP4, and node scripts/gif.mjs --out cover.gif encodes the looping GIF without dithering and measures the seam between the last and first frames. Keep the seam between 0.0 and 0.3 and the excursion between about 0.7 and 2.8; if not, shrink the motion instead of lengthening the loop.

常見問題

What does Cover loop GIF make?

Cover loop GIF makes a newsletter or blog cover that loops: a finished still picture in which only the one element you name moves. The loop is rotated so that frame one is the finished cover, and the seam between the last and first frames is measured. One JSON sheet produces a silent looping GIF and an optional MP4.

Why does only one element move in Cover loop GIF?

Cover loop GIF moves one element by design: the rest of the cover is a still, and the named element is redrawn each frame by its own ops. Inboxes and link previews often show only the first frame, so the loop is shifted with loop.offset until frame one already looks finished on its own.

Which motions does Cover loop GIF support?

Cover loop GIF supports nine motion kinds: beam sweeps a light wedge around a point, pulse scales an element, draw draws lines on and eases them off, drift moves an element on a slow orbit, glow breathes a halo, cycle steps a property through values, blink drops alpha, spin rotates once per loop and scan sweeps a line across a band.

How big is a Cover loop GIF file?

A Cover loop GIF file typically lands between 0.6 and 2.3 MB. The bundled covers are 896×640, a 7:5 shape, at 20 fps with a 9-second loop. Keep covers to that size or the same shape and to about 9 seconds or less; a cover is not a film, so long loops only make the file bigger.

Is Cover loop GIF output deterministic?

Yes. Cover loop GIF draws each frame with paint(t), a pure function of time with no clocks, no Math.random and no DOM beyond one canvas. The same sheet renders the same MP4 and GIF every time, so the seam measurement stays valid after you re-render an unchanged sheet.

Can Cover loop GIF use photos or video?

No. Cover loop GIF draws covers from vector ops, so photoreal or video-derived covers are out of scope, and it has no audio. English sheets use the bundled Newsreader, Caveat and JetBrains Mono faces; Chinese sheets switch to LXGW WenKai. All fonts and GSAP ship with their licences.