@pixerate/flair 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +16 -9
- package/dist/catalog/index.d.ts +30 -4
- package/dist/catalog/index.js +4 -1
- package/dist/chunk-F754SFRY.js +4973 -0
- package/dist/chunk-F754SFRY.js.map +1 -0
- package/dist/chunk-OHW7UG6D.js +336 -0
- package/dist/chunk-OHW7UG6D.js.map +1 -0
- package/dist/chunk-P5TSANZY.js +1 -0
- package/dist/{chunk-YAAVMNHN.js → chunk-TDMD5XAU.js} +29 -3
- package/dist/chunk-TDMD5XAU.js.map +1 -0
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +4 -3
- package/dist/editor/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/{motion-BwIlugh1.d.ts → motion-Ce0lmzm3.d.ts} +28 -2
- package/dist/{types-CfIFlnMY.d.ts → types-CgHG5JLv.d.ts} +8 -2
- package/dist/vector/index.d.ts +30 -3
- package/dist/vector/index.js +14 -4
- package/package.json +1 -1
- package/dist/chunk-CFCLT2XL.js +0 -1
- package/dist/chunk-J2WIWT4J.js +0 -2275
- package/dist/chunk-J2WIWT4J.js.map +0 -1
- package/dist/chunk-YAAVMNHN.js.map +0 -1
- /package/dist/{chunk-CFCLT2XL.js.map → chunk-P5TSANZY.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @pixerate/flair
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- bf62436: Morphs: `morphPaths` / `morphSequence` and 13 new effects.
|
|
8
|
+
|
|
9
|
+
- `morphPaths(from, to)` and `morphSequence(paths)` in `/vector` turn any SVG paths (curves, arcs, relative commands, several pieces) into paths with one structure, so an `attrs` change on `d` blends them. Pieces pair by position and size; one without a partner grows from or shrinks to a point.
|
|
10
|
+
- **morph** (new category): feature morph (two photos, five matching points), silhouette morph (any silhouettes, logos or `textImage` words), and vector shape morph, icon toggle (play/pause, menu/close, plus/check, sun/moon, heart), morph sequence, gooey morph, particle morph and digit morph.
|
|
11
|
+
- **transition**: liquid morph, displacement, luma fade, particle swap and ink bleed.
|
|
12
|
+
- `SAMPLE_IMAGES` gains `portrait2`, `logo` and `heart`.
|
|
13
|
+
|
|
14
|
+
## 0.8.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- a03bc70: Catalog: 35 new effects and two new categories.
|
|
19
|
+
|
|
20
|
+
- **overlay** (new category): rain on glass, snowfall, lens flare, vignette & grain, scanline sweep, spotlight, embers, shine sweep and frost creep shaders, plus a viewfinder vector effect. Overlay shaders have `transparent: true` (a new `ShaderEffect` field): render them with `{ alpha: true }` to lay them over other content.
|
|
21
|
+
- **image**: Ken Burns, ASCII art, shatter, melt, risograph, thermal / night vision, edge glow, tilt-shift, slit-scan, mosaic flip, chromatic lens and oil paint.
|
|
22
|
+
- **text** (new category): typewriter, scramble text, kinetic stagger, neon sign, stroke draw text, split reveal, highlighter, word cycle, liquid fill, glitch text and extruded text vector effects, and a `shader-text` shader that fills letters with plasma, fire, caustics or chrome. Drip text moves here from `icon`.
|
|
23
|
+
- `textImage(text, options)` in `/catalog`: any Unicode text as a transparent SVG `data:` URL, for image controls such as `shader-text`'s.
|
|
24
|
+
- Vector motion: `SvgAnimation.write` writes text letter by letter, with `scramble` (unwritten letters cycle through random characters) and `caret`; `writtenText` and `SCRAMBLE_MS` are exported from `/vector`.
|
|
25
|
+
|
|
3
26
|
## 0.7.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -19,13 +19,13 @@ Flair gives products a library of good-looking, configurable visual effects (her
|
|
|
19
19
|
|
|
20
20
|
### Core Capabilities
|
|
21
21
|
|
|
22
|
-
- 🎨 **Effect catalog (`@pixerate/flair/catalog`)**:
|
|
22
|
+
- 🎨 **Effect catalog (`@pixerate/flair/catalog`)**: 111 effects, each with controls and presets. There are 75 WebGL2 shaders (gradients, organic textures, patterns, light, space, retro, image treatments, transparent overlays, text fills, image morphs, transitions) and 36 animated SVG effects (loaders, status icons, animated titles, shape morphs, charts, counters, node graphs). [Browse them live](https://pixerate.github.io/flair/).
|
|
23
23
|
- ⚡ **Shader engine**:
|
|
24
24
|
- Shadertoy-style GLSL ES 3.00 fragment shaders, with controls declared in the source (`// @control`), including image inputs.
|
|
25
25
|
- Compile errors come back with line numbers that match the source.
|
|
26
26
|
- Live previews (`ShaderRenderer`, with optional `{ alpha: true }` for transparent overlays) and many animated or hover-activated thumbnails on one context (`ThumbnailPool`).
|
|
27
27
|
- Frames at exact times (`ShaderFrames`), looping GIFs, and standalone HTML pages.
|
|
28
|
-
- ✒️ **Vector motion (`@pixerate/flair/vector`)**: animated SVG described as data. Catalog vector effects declare their controls in the picture (`{{name: type …}}`), text included. It covers attribute tweens, draw-on strokes, motion along paths, counters (`animateCount` / `formatCount` for DOM elements too) and view zooms. Every frame is a pure function of time (`svgFrame`), and `SvgPlayer` plays it (with `scrollTrigger`, `hideWhenPaused`, and `reset()`).
|
|
28
|
+
- ✒️ **Vector motion (`@pixerate/flair/vector`)**: animated SVG described as data. Catalog vector effects declare their controls in the picture (`{{name: type …}}`), text included. It covers attribute tweens, draw-on strokes, motion along paths, counters (`animateCount` / `formatCount` for DOM elements too), text written letter by letter (`write`, with `scramble` and `caret`), shape morphs between any paths (`morphPaths`, `morphSequence`) and view zooms. Every frame is a pure function of time (`svgFrame`), and `SvgPlayer` plays it (with `scrollTrigger`, `hideWhenPaused`, and `reset()`).
|
|
29
29
|
- 🎛️ **Effect editor (`@pixerate/flair/editor`)**:
|
|
30
30
|
- A headless editor for an effect's source, values, keyframes, presets and timeline.
|
|
31
31
|
- Built on [`@pixerate/editor`](https://github.com/Pixerate/editor)'s undo history and command registry, with no UI framework assumed.
|
|
@@ -41,8 +41,8 @@ Flair gives products a library of good-looking, configurable visual effects (her
|
|
|
41
41
|
| Import | What it provides | Runtime dependencies |
|
|
42
42
|
| :--- | :--- | :--- |
|
|
43
43
|
| `@pixerate/flair` | Shader engine, vector motion, time and easing, colour, blending, transitions, scenes, interchange exporters | None (browser-safe) |
|
|
44
|
-
| `@pixerate/flair/catalog` | `EFFECTS`, `getEffect`, `findEffects`, `effectDefaults`, `renderVectorEffect`, `vectorControls`, GLSL helpers, sample images | None |
|
|
45
|
-
| `@pixerate/flair/vector` | `SvgMotion`, `svgFrame`, `svgView`, `SvgPlayer`, `animateCount`, `formatCount`, `svgMotionIssues` | None |
|
|
44
|
+
| `@pixerate/flair/catalog` | `EFFECTS`, `getEffect`, `findEffects`, `effectDefaults`, `renderVectorEffect`, `vectorControls`, GLSL helpers, sample images, `textImage` | None |
|
|
45
|
+
| `@pixerate/flair/vector` | `SvgMotion`, `svgFrame`, `svgView`, `SvgPlayer`, `animateCount`, `formatCount`, `morphPaths`, `morphSequence`, `svgMotionIssues` | None |
|
|
46
46
|
| `@pixerate/flair/editor` | `EffectEditor`, effect documents, keyframe tracks, renderer bindings, parameter-panel binding, agent tools and instructions | `@pixerate/editor` ≥ 0.29 (optional peer; only its dependency-free `/history`, `/commands`, `/tools`, `/animation` and `/parameters` subpaths) |
|
|
47
47
|
| `@pixerate/flair/node` | `exportMotionGraphic`: renders a shader to GIF/MP4 through headless Chrome and ffmpeg | Node.js |
|
|
48
48
|
|
|
@@ -55,7 +55,7 @@ The `flair` CLI inspects shaders, writes standalone pages and directs scenes (se
|
|
|
55
55
|
```mermaid
|
|
56
56
|
graph TD
|
|
57
57
|
subgraph Effects["Effects (no dependencies)"]
|
|
58
|
-
Catalog["catalog:
|
|
58
|
+
Catalog["catalog: 111 effects + presets"]
|
|
59
59
|
Shader["shader engine: controls, compile, render, GIF, HTML"]
|
|
60
60
|
Vector["vector motion: SvgMotion, SvgPlayer"]
|
|
61
61
|
Time["time: clocks, easing, keyframes, noise"]
|
|
@@ -100,7 +100,7 @@ npm install @pixerate/editor-react
|
|
|
100
100
|
import { ShaderRenderer, SvgPlayer, ThumbnailPool, animateCount } from "@pixerate/flair";
|
|
101
101
|
import { getEffect, effectDefaults, renderVectorEffect } from "@pixerate/flair/catalog";
|
|
102
102
|
|
|
103
|
-
// A shader background (
|
|
103
|
+
// A shader background (overlay effects have `transparent: true`: render them with { alpha: true })
|
|
104
104
|
const aurora = getEffect("aurora")!;
|
|
105
105
|
if (aurora.kind === "shader") {
|
|
106
106
|
const preview = new ShaderRenderer(document.querySelector("#hero")!);
|
|
@@ -131,6 +131,10 @@ animateCount({
|
|
|
131
131
|
|
|
132
132
|
Find effects with `findEffects({ text: "glow", category: "light", kind: "shader" })`. Each effect has an `id`, `name`, `description`, `category`, `tags` and optional `presets`. Image effects default to built-in sample pictures, so they look right before you set `uImage` to your own URL.
|
|
133
133
|
|
|
134
|
+
Overlay shaders (`category: "overlay"`) have `transparent: true`: they write coverage to `fragColor.a` and draw nothing elsewhere, so render them with `new ShaderRenderer(host, { alpha: true })` (or `new ThumbnailPool({ alpha: true })`) and lay the canvas over a picture, video or page. To morph between any two SVG shapes, `morphPaths(from, to)` (from `@pixerate/flair/vector`) returns two paths with one structure, so `attrs: { d: [a, b] }` blends them point by point: curves and arcs are read, pieces are paired by position and size, and a piece with no partner grows from or shrinks to a point (draw them with `fill-rule="evenodd"`). `morphSequence` does the same for three or more shapes. `feature-morph` morphs two photos from five matching points, and `silhouette-morph` morphs any two silhouettes or logos (or words, through `textImage`).
|
|
135
|
+
|
|
136
|
+
`shader-text` fills letters from a text image: set its `uText` control to `textImage("Your title", { weight: 900 })`, a transparent SVG `data:` URL of any Unicode text.
|
|
137
|
+
|
|
134
138
|
A vector effect declares its controls in its picture, the way a shader declares its uniforms: the first `{{name: type …}}` declares a control (`float`, `int`, `bool`, `color` or `text`, with `@control`'s attributes; quote values with spaces in single quotes), and every `{{name}}` is filled with its value. Declarations can sit in an XML comment, which is dropped when the picture is filled in, and text is escaped, so any words are safe:
|
|
135
139
|
|
|
136
140
|
```ts
|
|
@@ -265,9 +269,12 @@ The exporters carry the camera too:
|
|
|
265
269
|
| pattern | dot wave, Truchet flow, hex pulse, living cells, moiré rings, kaleidoscope, stripes, neon circuit |
|
|
266
270
|
| light / space | bokeh, god rays, sparkles, neon ripple, light ribbons, warp starfield, nebula, event horizon |
|
|
267
271
|
| retro | synthwave, digital rain, dithered gradient, TV static |
|
|
268
|
-
| image | ripple, glitch, duotone, halftone, pixel reveal, CRT screen, film look |
|
|
269
|
-
|
|
|
270
|
-
|
|
|
272
|
+
| image | ripple, glitch, duotone, halftone, pixel reveal, Ken Burns, ASCII art, shatter, melt, risograph, thermal, edge glow, tilt-shift, slit-scan, mosaic flip, chromatic lens, oil paint, CRT screen, film look |
|
|
273
|
+
| overlay | rain on glass, snowfall, lens flare, vignette & grain, scanline sweep, spotlight, embers, shine sweep, frost creep, viewfinder |
|
|
274
|
+
| text | shader text, drip text, typewriter, scramble text, kinetic stagger, neon sign, stroke draw text, split reveal, highlighter, word cycle, liquid fill, glitch text, extruded text |
|
|
275
|
+
| morph | feature morph, silhouette morph, shape morph, icon toggle, morph sequence, gooey morph, particle morph, digit morph |
|
|
276
|
+
| transition | liquid morph, displacement, luma fade, particle swap, ink bleed, wipe, iris, block dissolve, grid wipe, glass wipe, twister, light leak, cross zoom |
|
|
277
|
+
| loader / icon / data | spinner, bouncing dots, pulse ping, equalizer, progress ring, bar chart, line chart, stat counter, route, timeline track, success check, error cross, heartbeat, signature, confetti, flow network |
|
|
271
278
|
|
|
272
279
|
Every shader is self-contained and compiles on WebGL2. Open [`#check`](https://pixerate.github.io/flair/#check) on the demo to compile the catalog on your own GPU.
|
|
273
280
|
|
package/dist/catalog/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as ControlDef, C as ControlValue } from '../controls-Syr6drzO.js';
|
|
2
|
-
import { E as EffectDefinition, a as EffectCategory, S as ShaderEffect } from '../types-
|
|
3
|
-
export { b as EFFECT_CATEGORIES, c as EffectPreset, V as VECTOR_CONTROL_TYPES, d as VectorControl, e as VectorEffect, f as colorControl, n as numberControl, r as renderVectorEffect, v as vectorControlDef, g as vectorControlIssues, h as vectorControls, i as vectorEffectControls } from '../types-
|
|
4
|
-
import '../motion-
|
|
2
|
+
import { E as EffectDefinition, a as EffectCategory, S as ShaderEffect } from '../types-CgHG5JLv.js';
|
|
3
|
+
export { b as EFFECT_CATEGORIES, c as EffectPreset, V as VECTOR_CONTROL_TYPES, d as VectorControl, e as VectorEffect, f as colorControl, n as numberControl, r as renderVectorEffect, v as vectorControlDef, g as vectorControlIssues, h as vectorControls, i as vectorEffectControls } from '../types-CgHG5JLv.js';
|
|
4
|
+
import '../motion-Ce0lmzm3.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Sample pictures for the catalog's image effects: small SVGs as `data:` URLs,
|
|
@@ -14,7 +14,33 @@ declare const SAMPLE_IMAGES: {
|
|
|
14
14
|
readonly landscape: string;
|
|
15
15
|
readonly city: string;
|
|
16
16
|
readonly portrait: string;
|
|
17
|
+
/** Another face, larger and to the right: morph it with `portrait`. */
|
|
18
|
+
readonly portrait2: string;
|
|
19
|
+
/** A ring-and-dot mark, indigo on transparent. */
|
|
20
|
+
readonly logo: string;
|
|
21
|
+
/** A heart, rose on transparent. */
|
|
22
|
+
readonly heart: string;
|
|
17
23
|
};
|
|
24
|
+
interface TextImageOptions {
|
|
25
|
+
/** CSS font family (default a heavy system sans-serif). */
|
|
26
|
+
font?: string;
|
|
27
|
+
/** Font weight (default 900). */
|
|
28
|
+
weight?: number | string;
|
|
29
|
+
/** Font size in the picture's units; by default as large as fits. */
|
|
30
|
+
size?: number;
|
|
31
|
+
/** The picture's size (default 1024 × 256). */
|
|
32
|
+
width?: number;
|
|
33
|
+
height?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A line of text, white on transparent, as an SVG `data:` URL for an image
|
|
37
|
+
* control (the shader text effects use its alpha as a letter mask). The text
|
|
38
|
+
* is centred and fitted to the picture (1024 × 256 by default): the font
|
|
39
|
+
* size comes from its length, and `textLength` stretches it to the width
|
|
40
|
+
* that size predicts, so any text fills about the same box in any font.
|
|
41
|
+
* Takes any Unicode text.
|
|
42
|
+
*/
|
|
43
|
+
declare function textImage(text: string, options?: TextImageOptions): string;
|
|
18
44
|
|
|
19
45
|
/**
|
|
20
46
|
* GLSL helpers the catalog's shaders are built from. Each effect's source
|
|
@@ -72,4 +98,4 @@ declare function effectDefaults(effect: EffectDefinition, options?: {
|
|
|
72
98
|
values?: Record<string, ControlValue>;
|
|
73
99
|
}): Record<string, ControlValue>;
|
|
74
100
|
|
|
75
|
-
export { EFFECTS, EffectCategory, EffectDefinition, type EffectQuery, FBM, HASH, NOISE, OKLAB_MIX, PALETTE, ROTATE, SAMPLE_IMAGES, SHADER_EFFECTS, ShaderEffect, effectControls, effectDefaults, findEffects, getEffect, glsl, svgDataUrl };
|
|
101
|
+
export { EFFECTS, EffectCategory, EffectDefinition, type EffectQuery, FBM, HASH, NOISE, OKLAB_MIX, PALETTE, ROTATE, SAMPLE_IMAGES, SHADER_EFFECTS, ShaderEffect, effectControls, effectDefaults, findEffects, getEffect, glsl, svgDataUrl, textImage };
|
package/dist/catalog/index.js
CHANGED
|
@@ -19,11 +19,13 @@ import {
|
|
|
19
19
|
numberControl,
|
|
20
20
|
renderVectorEffect,
|
|
21
21
|
svgDataUrl,
|
|
22
|
+
textImage,
|
|
22
23
|
vectorControlDef,
|
|
23
24
|
vectorControlIssues,
|
|
24
25
|
vectorControls,
|
|
25
26
|
vectorEffectControls
|
|
26
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-F754SFRY.js";
|
|
28
|
+
import "../chunk-OHW7UG6D.js";
|
|
27
29
|
import "../chunk-EHDJ3CPJ.js";
|
|
28
30
|
import "../chunk-WC3VADZC.js";
|
|
29
31
|
export {
|
|
@@ -47,6 +49,7 @@ export {
|
|
|
47
49
|
numberControl,
|
|
48
50
|
renderVectorEffect,
|
|
49
51
|
svgDataUrl,
|
|
52
|
+
textImage,
|
|
50
53
|
vectorControlDef,
|
|
51
54
|
vectorControlIssues,
|
|
52
55
|
vectorControls,
|