Sand AISand AI MAGI-2MAGI-2 が SandBase に登場しました: ネイティブ音声付き 1080p 動画今すぐ試す

Magnetic lattice hero

An interactive hero section whose canvas grid bends toward the pointer and ripples on every click.

例

English site
新しいタブで開く

English site

この例はサンドボックス化されたフレームで実行され、このページにはアクセスできません。

オンラインで実行

無料

SandBase sandbox で Magnetic lattice hero のサンプルを実行し、結果をここで確認できます。

得られるもの

Bring the headline, supporting copy and calls to action for your hero. The Skill returns a single HTML section with two themes, a theme toggle and reduced-motion handling; no dependencies.

仕組み

  1. 01

    Write the hero copy

    Magnetic Lattice Hero needs only the badge, headline, supporting copy and calls to action for one hero section. The Agent collects what the hero must say and where each button goes, picks en or zh-CN, and copies assets/template.html to work/src.html. Every text block marked REPLACE and every link pointing at # gets real content.

  2. 02

    Tune the lattice if asked

    The engine, both themes and the pointer handling are already written. Small changes go through two constants: SETTINGS for grid spacing, pull radius and strength, easing, ripple speed and ripple size, and THEMES for the backdrop, strand, accent and ring colours of the midnight and mono themes. No images are added; anything extra is inline SVG or CSS.

  3. 03

    Build and test the interaction

    On Node 18 or newer, node scripts/inline-assets.mjs work/src.html work/index.html produces the file and node scripts/validate.mjs work/index.html --mode site --site-lang en must exit 0. Add --browser --screenshot work/shots for a local Chrome or Edge pass, then move the pointer and click in a browser yourself to confirm the grid bends and ripples.

FAQ

What does Magnetic Lattice Hero do?

Magnetic Lattice Hero renders a canvas grid of faint strands and junction dots that bends toward the pointer and sends a ripple through the lattice on each click. It glows violet in the midnight theme or white in the mono theme, only where the visitor interacts, under centred hero copy. It is one section, not a whole site.

Does Magnetic Lattice Hero respect reduced motion?

Yes. Magnetic Lattice Hero ships with reduced-motion handling built in, alongside its two themes and a theme toggle. Keep that handling when you tune SETTINGS, and check the result with reduced motion switched on as well as off.

Does Magnetic Lattice Hero have dependencies?

No. Magnetic Lattice Hero is a single-file engine with no libraries and no external assets, and its build and validate scripts have zero dependencies. No key is needed and no model is called, so producing the hero brings no SandBase charge. Node runs the scripts.

Can Magnetic Lattice Hero use my brand colour?

Yes. Magnetic Lattice Hero keeps its colours in the THEMES constant, where each theme has a backdrop, strand, accent and ring value. Put your brand colour in the accent. Never link a font from another site, because the page must stay self-contained.

What output does Magnetic Lattice Hero give?

Magnetic Lattice Hero gives a single HTML file containing the hero section, written to work/index.html after inlining. In a framework project it serves as a visual and behavioural reference, because the validator only checks standalone HTML files.