Aperveil for Vue
Vue 3.3+ and Nuxt: the same components, with props, events and a fallback slot.
Install
Vue 3.3 or newer, Nuxt included. Download a shader's Export Kit from its editor first; the packages it needs are inside, and its vue folder holds the component.
Download and extract an Export Kit first, then run this command from its root. The required Aperveil packages are included; public npm and CLI releases are coming soon.
Add a shader
Copy the component from the kit's vue folder, import it and give it a size. The canvas fills the box you give it. In the editor, Install writes these lines for any shader, with the values you tuned.
Props, events and the fallback
Every control in the editor is a prop: in a template write it in kebab-case (dot-color="#7af0ff") and bind numbers, booleans and arrays with : (:density="72"). Leave one out and the shader keeps its own value; change one and the running shader updates without restarting. paused holds the frame.
The component emits ready after its first frame and error if rendering fails. Put content in its #fallback slot for browsers without WebGPU: it shows in place of the canvas.
Video and images
Thermal Vision, Riso Print, Stipple Relief and Reeded Waveform play a video or an image through the shader. Give it the URL as src: an MP4, WebM, MOV, JPG, PNG or WebP.
| Prop | Type | What it does |
|---|---|---|
| src | string | The video or image it plays. A URL to an MP4, WebM, MOV, JPG, PNG or WebP, on your own site or on a server that allows it (CORS). Left out, it plays its own clip; an empty string shows its own scene. |
| mediaFocus | readonly [number, number] | Where the subject sits. Its place in the picture, from the top left, kept in view when the picture is cropped to fill. |
| mediaKind | "video" | "image" | Video or image. Only needed when the URL does not end in a file extension. |
Without one, Thermal Vision and Riso Print play their own sample clip from the Aperveil CDN (use your own in production), and Stipple Relief and Reeded Waveform show their own scene. The clip plays muted, looped and inline, and holds still while the shader is paused, scrolled out of view or under reduced motion. A clip on your own site always plays; one on another server must allow it (CORS). A short clip of 5 to 15 seconds with one clear subject loops best.
Glass Reel shows a gallery: up to 8 pictures and clips (2 of them clips) on its film. Pass them as gallery, an array of { src, type, alt }. Dew Glass sits on a picture: give its URL as backgroundImage. Without them, Glass Reel shows its own sample pictures and Dew Glass its own scene.
| Prop | Type | What it does |
|---|---|---|
| gallery | readonly { src: string; type?: "image" | "video"; alt?: string; focal?: readonly [number, number] }[] | The pictures and clips on the reel. URLs of JPG, PNG or WebP pictures and MP4 or WebM clips, on your own site or on a server that allows it (CORS). Left out, it shows its own sample pictures. |
| backgroundImage | string | The picture behind the glass. A URL to a JPG, PNG or WebP up to 10 MB, on your own site or on a server that allows it (CORS). It is shown as soon as it loads (backgroundMode switches to image unless you set it); left out, the shader shows its own scene. |
Chromatic Vapor, Cymatic Dust, Dew Glass, Glass Medusae, Glass Reel, Prismatic Caustics and Watercolor run a simulation or draw a mesh, in several passes. Their components carry those passes, so they install like any other shader.
Nuxt
WebGPU exists only in the browser, so render a shader component inside <ClientOnly>:
Blocks need no wrapper: they render on the server and start their shader in the browser.
Blocks
Shape a block on its page with Customize, then open Install, choose Vue and download it. Copy its folder into your project, for example to components/aperveil/signature-hero, run the install line from its README and render it:
Every prop is optional: content, design and shader override the copy, the colours and typefaces, and the shader's values; on a form block onSubmit makes the form live.
Troubleshooting
- Nothing appears.
- Give the surface a width and a height: the canvas fills its box, and a box without a height is zero pixels tall.
- The fallback shows instead.
- The browser has no WebGPU, or no usable GPU adapter, or the page is not served over HTTPS (localhost is fine). Keep important content in HTML, outside the shader.
- A value is ignored.
- An invalid value (a mistyped colour, an unknown option, a number out of range) keeps the default and logs one warning in the console. Numbers outside their range are clamped.
- The video does not play.
- A clip on another server must allow it (CORS). A clip on your own site always does.
Color Looks, browser support, performance and access are the same on every platform: see the overview.