@snailicid3/gbt-scope 0.0.1
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 +7 -0
- package/README.md +23 -0
- package/dist/index.cjs +702 -0
- package/dist/index.d.cts +308 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +308 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +669 -0
- package/dist/index.js.map +1 -0
- package/package.json +119 -0
- package/types/components/GbtScopeFlatViewer.d.ts +30 -0
- package/types/components/GbtScopeFlatViewer.d.ts.map +1 -0
- package/types/components/GbtScopeMaterial.d.ts +28 -0
- package/types/components/GbtScopeMaterial.d.ts.map +1 -0
- package/types/components/GbtScopeMeshViewer.d.ts +30 -0
- package/types/components/GbtScopeMeshViewer.d.ts.map +1 -0
- package/types/helpers.d.ts +34 -0
- package/types/helpers.d.ts.map +1 -0
- package/types/index.d.ts +18 -0
- package/types/index.d.ts.map +1 -0
- package/types/materials/shader-radial-symmetry.d.ts +5 -0
- package/types/materials/shader-radial-symmetry.d.ts.map +1 -0
- package/types/motion/animator.d.ts +42 -0
- package/types/motion/animator.d.ts.map +1 -0
- package/types/motion/curve.d.ts +18 -0
- package/types/motion/curve.d.ts.map +1 -0
- package/types/motion/driver.d.ts +28 -0
- package/types/motion/driver.d.ts.map +1 -0
- package/types/motion/pointer.d.ts +24 -0
- package/types/motion/pointer.d.ts.map +1 -0
- package/types/motion/scroll.d.ts +25 -0
- package/types/motion/scroll.d.ts.map +1 -0
- package/types/types.d.ts +84 -0
- package/types/types.d.ts.map +1 -0
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type Dimensions } from './helpers.ts';
|
|
2
|
+
import { type GbtScopeAnimator, type GbtScopeInputOverrides } from './motion/animator.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Curve parameters controlling how an input value (eg. pointer distance from center, scroll velocity) maps to an effect
|
|
5
|
+
* amount. Replaces the old `[min, max]` tuple form of `mouse_curve` with a richer, named shape.
|
|
6
|
+
*
|
|
7
|
+
* @see applyCurve in ./motion/curve.ts
|
|
8
|
+
*/
|
|
9
|
+
export type GbtScopeCurve = {
|
|
10
|
+
/** Input magnitude below this is treated as 0. Default 0. */
|
|
11
|
+
deadzone?: number;
|
|
12
|
+
/** Shaping exponent (1 = linear, >1 = ease-in). Default 1. */
|
|
13
|
+
exponent?: number;
|
|
14
|
+
/** Negate the result. Default false. */
|
|
15
|
+
invert?: boolean;
|
|
16
|
+
/** Upper clamp applied after curving. Default 1. */
|
|
17
|
+
max?: number;
|
|
18
|
+
/** Lower clamp applied after curving. Default 0. */
|
|
19
|
+
min?: number;
|
|
20
|
+
/** Linear gain applied before the exponent. Default 1. */
|
|
21
|
+
multiplier?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Shared, serializable material props for all GbtScope viewers (flat + 3D mesh). camelCase only — animation is
|
|
25
|
+
* data-driven via {@link GbtScopeAnimator}, not speed fields. `rotation`/`offset`/`scaleFactor`/`opacity` are the
|
|
26
|
+
* resting (base) values the animators build on.
|
|
27
|
+
*/
|
|
28
|
+
export type GbtScopeMaterialProps = {
|
|
29
|
+
/** Pre-resolved texture dimensions; viewers derive this from `resolution`. */
|
|
30
|
+
dimensions?: Dimensions;
|
|
31
|
+
imageAspect?: number;
|
|
32
|
+
offset?: [number, number];
|
|
33
|
+
/** Multiplier on the offset uniform (`uOffsetAmount`). */
|
|
34
|
+
offsetScale?: number;
|
|
35
|
+
opacity?: number;
|
|
36
|
+
rotation?: number;
|
|
37
|
+
/** Multiplier on the rotation uniform (`uRotationAmount`). */
|
|
38
|
+
rotationScale?: number;
|
|
39
|
+
scaleFactor?: number;
|
|
40
|
+
segments?: number;
|
|
41
|
+
src: string;
|
|
42
|
+
tileMode?: GbtScopeTileMode;
|
|
43
|
+
tiling?: number;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Tiling strategy applied to the kaleidoscope pattern after the radial fold.
|
|
47
|
+
*
|
|
48
|
+
* - `none` — no wrapping; the pattern is sampled directly.
|
|
49
|
+
* - `repeat` — `fract(uv * tiling)` square repeats (the historical behavior).
|
|
50
|
+
* - `mirror` — mirrored repeats for seamless edges.
|
|
51
|
+
*/
|
|
52
|
+
export type GbtScopeTileMode = 'mirror' | 'none' | 'repeat';
|
|
53
|
+
/**
|
|
54
|
+
* Canonical default values for {@link GbtScopeMaterialProps}. `src` is required and has no default. Imported by
|
|
55
|
+
* component defaults and Storybook args so the defaults live in a single place.
|
|
56
|
+
*/
|
|
57
|
+
export declare const defaultGbtScopeMaterialProps: {
|
|
58
|
+
imageAspect: number;
|
|
59
|
+
offset: [number, number];
|
|
60
|
+
offsetScale: number;
|
|
61
|
+
opacity: number;
|
|
62
|
+
rotation: number;
|
|
63
|
+
rotationScale: number;
|
|
64
|
+
scaleFactor: number;
|
|
65
|
+
segments: number;
|
|
66
|
+
tileMode: GbtScopeTileMode;
|
|
67
|
+
tiling: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Viewer-level props shared by both the flat and mesh viewers. Camera config is viewer-specific and declared on each
|
|
71
|
+
* component. Material props are forwarded down to {@link GbtScopeMaterialProps}.
|
|
72
|
+
*/
|
|
73
|
+
export type GbtScopeViewerBaseProps = {
|
|
74
|
+
/** Declarative motion rules applied each frame. */
|
|
75
|
+
animators?: Array<GbtScopeAnimator>;
|
|
76
|
+
/** Aspect ratio of the host canvas. */
|
|
77
|
+
aspect_ratio?: 'parent' | number;
|
|
78
|
+
bg_color?: string;
|
|
79
|
+
/** Fixed values replacing the live pointer/scroll inputs (mock/testing). */
|
|
80
|
+
inputOverrides?: GbtScopeInputOverrides;
|
|
81
|
+
/** Canvas background; `'screen'` resolution matches the viewport. */
|
|
82
|
+
resolution?: 'screen' | Dimensions | null;
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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