layershift 0.5.1 → 0.6.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/README.md +30 -9
- package/dist/components/layershift.js +28 -28
- package/dist/npm/layershift.es.js +286 -289
- package/dist/types/components/layershift/global.d.ts +3 -1
- package/dist/types/components/layershift/layershift-element.d.ts +0 -1
- package/dist/types/components/layershift/layershift-element.d.ts.map +1 -1
- package/dist/types/components/layershift/lifecycle.d.ts +1 -1
- package/dist/types/components/layershift/portal-element.d.ts +0 -1
- package/dist/types/components/layershift/portal-element.d.ts.map +1 -1
- package/dist/types/components/layershift/types.d.ts +6 -2
- package/dist/types/components/layershift/types.d.ts.map +1 -1
- package/dist/types/depth/precomputed-depth.d.ts +4 -8
- package/dist/types/depth/precomputed-depth.d.ts.map +1 -1
- package/dist/types/shared/filter-config.d.ts +0 -1
- package/dist/types/shared/filter-config.d.ts.map +1 -1
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -14,7 +14,6 @@ Layershift is a growing collection of visual effects that turn flat video into s
|
|
|
14
14
|
<layershift-effect
|
|
15
15
|
src="video.mp4"
|
|
16
16
|
depth-src="depth-data.bin"
|
|
17
|
-
depth-meta="depth-meta.json"
|
|
18
17
|
config="filter-config.json"
|
|
19
18
|
></layershift-effect>
|
|
20
19
|
```
|
|
@@ -26,11 +25,13 @@ Layershift is a growing collection of visual effects that turn flat video into s
|
|
|
26
25
|
The `<layershift-effect>` element supports multiple effect types, all driven by the same depth data:
|
|
27
26
|
|
|
28
27
|
- **Depth Parallax** — per-pixel UV displacement via Parallax Occlusion Mapping
|
|
28
|
+
- **Rack Focus** — animated focus shift between depth layers
|
|
29
29
|
- **Depth Glow** — depth-driven emissive glow
|
|
30
30
|
- **Color Grade** — depth-aware color grading
|
|
31
31
|
- **Fog / Atmosphere** — depth-based atmospheric haze
|
|
32
32
|
- **Tilt Shift** — miniature/diorama lens effect
|
|
33
33
|
- **Pop-Out** — foreground subjects break out of the frame
|
|
34
|
+
- **Freestyle** — custom effect composition with manual channel configuration
|
|
34
35
|
|
|
35
36
|
Effects are configured in the [Layershift Editor](https://layershift.io/editor/) and exported as a `filter-config.json` file.
|
|
36
37
|
|
|
@@ -75,13 +76,15 @@ Use the [Layershift Editor](https://layershift.io/editor/) to:
|
|
|
75
76
|
3. Configure your effect with the visual editor
|
|
76
77
|
4. Export a consumer package with all assets + config
|
|
77
78
|
|
|
78
|
-
The editor produces `depth-data.bin
|
|
79
|
+
The editor produces `depth-data.bin` and `filter-config.json` — everything `<layershift-effect>` needs.
|
|
79
80
|
|
|
80
81
|
## Development
|
|
81
82
|
|
|
82
83
|
```bash
|
|
83
84
|
npm install
|
|
84
|
-
npm run dev
|
|
85
|
+
npm run dev # Landing page dev server (port 5173)
|
|
86
|
+
npm run dev:editor # Editor dev server (port 5175)
|
|
87
|
+
npm run docs:dev # Documentation dev server (VitePress)
|
|
85
88
|
```
|
|
86
89
|
|
|
87
90
|
## Build
|
|
@@ -95,6 +98,12 @@ npm run build:component
|
|
|
95
98
|
|
|
96
99
|
# Build the npm package (ESM + IIFE + types)
|
|
97
100
|
npm run build:package
|
|
101
|
+
|
|
102
|
+
# Build the editor
|
|
103
|
+
npm run build:editor
|
|
104
|
+
|
|
105
|
+
# Build documentation
|
|
106
|
+
npm run build:docs
|
|
98
107
|
```
|
|
99
108
|
|
|
100
109
|
## Component Library
|
|
@@ -104,7 +113,8 @@ Browse all site UI components with interactive controls and documentation.
|
|
|
104
113
|
**[View Component Library →](https://layershift.io/storybook/)**
|
|
105
114
|
|
|
106
115
|
```bash
|
|
107
|
-
npm run storybook
|
|
116
|
+
npm run storybook # Dev server (port 6006)
|
|
117
|
+
npm run build:storybook # Static build
|
|
108
118
|
```
|
|
109
119
|
|
|
110
120
|
Components follow atomic design (Atoms → Molecules → Organisms → Templates). Each component includes a story with controls and a colocated test.
|
|
@@ -118,15 +128,20 @@ Components follow atomic design (Atoms → Molecules → Organisms → Templates
|
|
|
118
128
|
| Attribute | Type | Default | Description |
|
|
119
129
|
|-----------|------|---------|-------------|
|
|
120
130
|
| `src` | string | — | Video or image URL (required) |
|
|
121
|
-
| `depth-src` | string | — | Depth binary URL (required) |
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
131
|
+
| `depth-src` | string | — | Depth binary URL (required unless `depth-model` is set) |
|
|
132
|
+
| `config` | string | — | Filter config JSON URL (authored in the editor) |
|
|
133
|
+
| `depth-width` | number | 512 | Width of depth map frames (pixels) |
|
|
134
|
+
| `depth-height` | number | 512 | Height of depth map frames (pixels) |
|
|
135
|
+
| `depth-fps` | number | 5 | Frame rate of precomputed depth data |
|
|
136
|
+
| `depth-model` | string | — | ONNX model URL for browser-side depth estimation |
|
|
137
|
+
| `source-type` | string | video | Source type: `video`, `image`, `camera` (experimental) |
|
|
138
|
+
| `quality` | string | auto | Quality tier: `auto`, `high`, `medium`, `low` |
|
|
139
|
+
| `gpu-backend` | string | auto | GPU backend: `auto`, `webgpu`, `webgl2` |
|
|
124
140
|
| `parallax-x` | number | 0.4 | Horizontal parallax intensity |
|
|
125
141
|
| `parallax-y` | number | 1.0 | Vertical parallax intensity |
|
|
126
142
|
| `parallax-max` | number | 30 | Max pixel offset for nearest layer |
|
|
143
|
+
| `layers` | number | 5 | Number of parallax layers |
|
|
127
144
|
| `overscan` | number | 0.05 | Extra padding ratio |
|
|
128
|
-
| `quality` | string | auto | Quality tier: `auto`, `high`, `medium`, `low` |
|
|
129
|
-
| `source-type` | string | video | Source type: `video`, `image`, `camera` |
|
|
130
145
|
| `autoplay` | boolean | true | Auto-play on mount |
|
|
131
146
|
| `loop` | boolean | true | Loop playback |
|
|
132
147
|
| `muted` | boolean | true | Muted (required for autoplay) |
|
|
@@ -257,6 +272,12 @@ Each `<layershift-effect>` instance creates 1 WebGL renderer, 1 Web Worker, 1 hi
|
|
|
257
272
|
# Unit tests (Vitest)
|
|
258
273
|
npm test
|
|
259
274
|
|
|
275
|
+
# Unit tests in watch mode
|
|
276
|
+
npm run test:watch
|
|
277
|
+
|
|
278
|
+
# Storybook component tests
|
|
279
|
+
npm run test:storybook
|
|
280
|
+
|
|
260
281
|
# E2E tests (Playwright, requires build first)
|
|
261
282
|
npm run build && npm run build:component && npm run test:e2e
|
|
262
283
|
|