shadertown 0.17.0 → 0.18.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 +17 -0
- package/dist/badge.d.ts +60 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +69 -0
- package/dist/badge.js.map +1 -0
- package/dist/export.d.ts +33 -5
- package/dist/export.d.ts.map +1 -1
- package/dist/export.js +179 -20
- package/dist/export.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +12 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +70 -3
- package/dist/react.js.map +1 -1
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,23 @@ deploys, not by this file.
|
|
|
6
6
|
This project follows [semantic versioning](https://semver.org). Before 1.0 the
|
|
7
7
|
minor number carries breaking changes, so pin it if that matters to you.
|
|
8
8
|
|
|
9
|
+
## 0.18.0 — 2026-09-09
|
|
10
|
+
|
|
11
|
+
- `ShaderCanvas` draws a shadertown credit in a corner of the canvas, as a
|
|
12
|
+
visible link in the server-rendered HTML. `setBadge(false)` removes it from
|
|
13
|
+
every canvas on the page, `badge={false}` from one, and `badge="top-left"` —
|
|
14
|
+
or `setBadgePosition` — moves it between the four corners. Free shader
|
|
15
|
+
sources now ship a licence that asks for the credit; a paid licence lifts the
|
|
16
|
+
condition. Nothing in the runtime checks a licence or contacts a server.
|
|
17
|
+
- **Breaking:** `ShaderCanvas` wraps its canvas in a `span`, and `className` and
|
|
18
|
+
`style` now apply to that wrapper rather than to the canvas. The canvas fills
|
|
19
|
+
the wrapper, so a parent-sized layout is unchanged; a rule that targeted the
|
|
20
|
+
canvas element itself may need moving. The wrapper is present whether or not
|
|
21
|
+
the credit is drawn.
|
|
22
|
+
- `toConfigSource`, `toReactSource`, `toVanillaSource` and `toExampleSource`
|
|
23
|
+
take an optional `SnippetOptions`, and emit a licence notice unless it says
|
|
24
|
+
`creditRequired: false`. `toFreeLicense` is new beside `toLicense`.
|
|
25
|
+
|
|
9
26
|
## 0.17.0 — 2026-09-09
|
|
10
27
|
|
|
11
28
|
- Add `liquid-light`, a glass wave with layered refraction, studio reflections,
|
package/dist/badge.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The credit a canvas carries, and the one switch that removes it.
|
|
3
|
+
*
|
|
4
|
+
* A free shader is paid for in links. The badge is how: a small, real,
|
|
5
|
+
* followed anchor to the shader's own page, drawn in the corner of the canvas
|
|
6
|
+
* it credits. It is deliberately not clever — no hidden text, no anchor with
|
|
7
|
+
* no size, no URL smuggled into a comment. A credit that a reader cannot see
|
|
8
|
+
* is worth nothing to a search engine and is against their policies besides.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here checks a licence, and nothing here reaches the network. The
|
|
11
|
+
* runtime stays MIT and stays offline: `setBadge(false)` is one call, it works
|
|
12
|
+
* for everybody, and what makes it honest is the LICENSE file that ships beside
|
|
13
|
+
* a free shader, not a lock in this file. Enforcement in a bundle a reader can
|
|
14
|
+
* edit is theatre, and theatre is worse than terms.
|
|
15
|
+
*
|
|
16
|
+
* The setting is page-wide for the same reason `setQualityTier` is: an app
|
|
17
|
+
* either credits or it does not, and passing the same prop to forty canvases
|
|
18
|
+
* is how one gets missed.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Which corner the credit sits in.
|
|
22
|
+
*
|
|
23
|
+
* Four corners and nothing else — no offset, no opacity, no class to style it
|
|
24
|
+
* with. A badge that collides with a reader's own controls is a reason to strip
|
|
25
|
+
* it rather than move it, so moving it has to be easy. Every other knob anyone
|
|
26
|
+
* would ask for is a knob for hiding it while claiming it is on, and there is
|
|
27
|
+
* already a switch for turning it off honestly.
|
|
28
|
+
*/
|
|
29
|
+
export type BadgeCorner = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
30
|
+
/** The inset of each corner, in pixels from the two edges it touches. */
|
|
31
|
+
export declare const BADGE_CORNERS: Record<BadgeCorner, Record<string, number>>;
|
|
32
|
+
/**
|
|
33
|
+
* Show or hide the credit on every canvas on the page.
|
|
34
|
+
*
|
|
35
|
+
* Call it at module scope, in a module both the server and the browser load.
|
|
36
|
+
* The badge is rendered, not mounted — setting this inside an effect would
|
|
37
|
+
* render one on the server and none in the browser, which is a hydration
|
|
38
|
+
* mismatch rather than a hidden badge.
|
|
39
|
+
*/
|
|
40
|
+
export declare function setBadge(shown: boolean): void;
|
|
41
|
+
/** Whether the page credits shadertown. Defaults to true. */
|
|
42
|
+
export declare function badgeShown(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Put the credit in a different corner of every canvas on the page. Same rule
|
|
45
|
+
* as `setBadge`: module scope, where the server and the browser both run it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function setBadgePosition(corner: BadgeCorner): void;
|
|
48
|
+
/** The corner the page puts the credit in. Defaults to `bottom-right`. */
|
|
49
|
+
export declare function badgePosition(): BadgeCorner;
|
|
50
|
+
/**
|
|
51
|
+
* Where a badge points: the page for the shader it is drawn on, not the home
|
|
52
|
+
* page. One badge per shader spreads the links across the catalogue the way a
|
|
53
|
+
* hand-written link would, and it takes the reader to the thing they just saw
|
|
54
|
+
* rather than to a pitch.
|
|
55
|
+
*/
|
|
56
|
+
export declare function badgeHref(shader: string): string;
|
|
57
|
+
/** The anchor text. The brand, and enough words to say what the link is. */
|
|
58
|
+
export declare const BADGE_PREFIX = "Shaders by";
|
|
59
|
+
export declare const BADGE_NAME = "shadertown";
|
|
60
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../src/badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;AAEpF,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKrE,CAAC;AAKF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE7C;AAED,6DAA6D;AAC7D,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAE1D;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,IAAI,WAAW,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,4EAA4E;AAC5E,eAAO,MAAM,YAAY,eAAe,CAAC;AACzC,eAAO,MAAM,UAAU,eAAe,CAAC"}
|
package/dist/badge.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The credit a canvas carries, and the one switch that removes it.
|
|
3
|
+
*
|
|
4
|
+
* A free shader is paid for in links. The badge is how: a small, real,
|
|
5
|
+
* followed anchor to the shader's own page, drawn in the corner of the canvas
|
|
6
|
+
* it credits. It is deliberately not clever — no hidden text, no anchor with
|
|
7
|
+
* no size, no URL smuggled into a comment. A credit that a reader cannot see
|
|
8
|
+
* is worth nothing to a search engine and is against their policies besides.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here checks a licence, and nothing here reaches the network. The
|
|
11
|
+
* runtime stays MIT and stays offline: `setBadge(false)` is one call, it works
|
|
12
|
+
* for everybody, and what makes it honest is the LICENSE file that ships beside
|
|
13
|
+
* a free shader, not a lock in this file. Enforcement in a bundle a reader can
|
|
14
|
+
* edit is theatre, and theatre is worse than terms.
|
|
15
|
+
*
|
|
16
|
+
* The setting is page-wide for the same reason `setQualityTier` is: an app
|
|
17
|
+
* either credits or it does not, and passing the same prop to forty canvases
|
|
18
|
+
* is how one gets missed.
|
|
19
|
+
*/
|
|
20
|
+
/** The canonical host. The apex redirects, so a badge must never point at it. */
|
|
21
|
+
const HOME = "https://www.shadertown.com";
|
|
22
|
+
/** The inset of each corner, in pixels from the two edges it touches. */
|
|
23
|
+
export const BADGE_CORNERS = {
|
|
24
|
+
"bottom-right": { bottom: 10, right: 10 },
|
|
25
|
+
"bottom-left": { bottom: 10, left: 10 },
|
|
26
|
+
"top-right": { top: 10, right: 10 },
|
|
27
|
+
"top-left": { top: 10, left: 10 },
|
|
28
|
+
};
|
|
29
|
+
let pageBadge = true;
|
|
30
|
+
let pageCorner = "bottom-right";
|
|
31
|
+
/**
|
|
32
|
+
* Show or hide the credit on every canvas on the page.
|
|
33
|
+
*
|
|
34
|
+
* Call it at module scope, in a module both the server and the browser load.
|
|
35
|
+
* The badge is rendered, not mounted — setting this inside an effect would
|
|
36
|
+
* render one on the server and none in the browser, which is a hydration
|
|
37
|
+
* mismatch rather than a hidden badge.
|
|
38
|
+
*/
|
|
39
|
+
export function setBadge(shown) {
|
|
40
|
+
pageBadge = shown;
|
|
41
|
+
}
|
|
42
|
+
/** Whether the page credits shadertown. Defaults to true. */
|
|
43
|
+
export function badgeShown() {
|
|
44
|
+
return pageBadge;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Put the credit in a different corner of every canvas on the page. Same rule
|
|
48
|
+
* as `setBadge`: module scope, where the server and the browser both run it.
|
|
49
|
+
*/
|
|
50
|
+
export function setBadgePosition(corner) {
|
|
51
|
+
pageCorner = corner;
|
|
52
|
+
}
|
|
53
|
+
/** The corner the page puts the credit in. Defaults to `bottom-right`. */
|
|
54
|
+
export function badgePosition() {
|
|
55
|
+
return pageCorner;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Where a badge points: the page for the shader it is drawn on, not the home
|
|
59
|
+
* page. One badge per shader spreads the links across the catalogue the way a
|
|
60
|
+
* hand-written link would, and it takes the reader to the thing they just saw
|
|
61
|
+
* rather than to a pitch.
|
|
62
|
+
*/
|
|
63
|
+
export function badgeHref(shader) {
|
|
64
|
+
return `${HOME}/shaders/${shader}?ref=badge`;
|
|
65
|
+
}
|
|
66
|
+
/** The anchor text. The brand, and enough words to say what the link is. */
|
|
67
|
+
export const BADGE_PREFIX = "Shaders by";
|
|
68
|
+
export const BADGE_NAME = "shadertown";
|
|
69
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../src/badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,iFAAiF;AACjF,MAAM,IAAI,GAAG,4BAA4B,CAAC;AAa1C,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAgD;IACxE,cAAc,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACzC,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACvC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACnC,UAAU,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;CAClC,CAAC;AAEF,IAAI,SAAS,GAAG,IAAI,CAAC;AACrB,IAAI,UAAU,GAAgB,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,SAAS,GAAG,KAAK,CAAC;AACpB,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,UAAU;IACxB,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,UAAU,GAAG,MAAM,CAAC;AACtB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,OAAO,GAAG,IAAI,YAAY,MAAM,YAAY,CAAC;AAC/C,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC"}
|
package/dist/export.d.ts
CHANGED
|
@@ -5,17 +5,28 @@ import { type ShaderName, type ShaderParams } from "./registry.js";
|
|
|
5
5
|
* changing anyone's pinned look.
|
|
6
6
|
*/
|
|
7
7
|
export declare function diffParams<K extends ShaderName>(name: K, params: ShaderParams<K>): Record<string, number | string>;
|
|
8
|
+
export interface SnippetOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the reader has to keep the credit — true for a Free shader taken
|
|
11
|
+
* without paying, which is the only case worth a notice in the file.
|
|
12
|
+
*
|
|
13
|
+
* Defaults to true, the same way round as the LICENSE the registry picks:
|
|
14
|
+
* the worst a mistake here can do is tell someone who paid about a condition
|
|
15
|
+
* that does not bind them.
|
|
16
|
+
*/
|
|
17
|
+
readonly creditRequired?: boolean;
|
|
18
|
+
}
|
|
8
19
|
/** A `shader.config.ts` module: the tuned preset, typed against the registry. */
|
|
9
|
-
export declare function toConfigSource<K extends ShaderName>(name: K, params: ShaderParams<K
|
|
20
|
+
export declare function toConfigSource<K extends ShaderName>(name: K, params: ShaderParams<K>, options?: SnippetOptions): string;
|
|
10
21
|
/** A drop-in React usage snippet for the current settings. */
|
|
11
|
-
export declare function toReactSource<K extends ShaderName>(name: K, params: ShaderParams<K
|
|
22
|
+
export declare function toReactSource<K extends ShaderName>(name: K, params: ShaderParams<K>, options?: SnippetOptions): string;
|
|
12
23
|
/** The imperative form, for codebases that are not React. */
|
|
13
|
-
export declare function toVanillaSource<K extends ShaderName>(name: K, params: ShaderParams<K
|
|
24
|
+
export declare function toVanillaSource<K extends ShaderName>(name: K, params: ShaderParams<K>, options?: SnippetOptions): string;
|
|
14
25
|
/** The complete, self-contained WGSL for this shader. */
|
|
15
26
|
export declare function toWgslSource<K extends ShaderName>(name: K): string;
|
|
16
27
|
export declare function toInstallCommand<K extends ShaderName>(name: K): string;
|
|
17
28
|
/** A paste-ready component wired with the tuned parameters. */
|
|
18
|
-
export declare function toExampleSource<K extends ShaderName>(name: K, params: ShaderParams<K
|
|
29
|
+
export declare function toExampleSource<K extends ShaderName>(name: K, params: ShaderParams<K>, options?: SnippetOptions): string;
|
|
19
30
|
/**
|
|
20
31
|
* Per-shader documentation, generated from the registry rather than written by
|
|
21
32
|
* hand — the control table cannot drift out of date with the shader.
|
|
@@ -25,6 +36,23 @@ export interface LicenceHolder {
|
|
|
25
36
|
readonly name?: string;
|
|
26
37
|
readonly order?: string;
|
|
27
38
|
}
|
|
28
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The licence that ships with a Free shader, taken by anyone, unpaid.
|
|
41
|
+
*
|
|
42
|
+
* The obligation it carries — leave the credit on — is stated here and nowhere
|
|
43
|
+
* else. `setBadge(false)` is one call and always will be: a check inside a
|
|
44
|
+
* bundle the holder can edit would stop nobody and would break the promise that
|
|
45
|
+
* the runtime never phones home. The terms are what bind; the code is not.
|
|
46
|
+
*
|
|
47
|
+
* Kept in step with the /license page, which is the full version of the same
|
|
48
|
+
* grant. Change one and change the other.
|
|
49
|
+
*/
|
|
50
|
+
export declare function toFreeLicense<K extends ShaderName>(name: K): string;
|
|
51
|
+
/**
|
|
52
|
+
* The licence that ships with a purchased shader, issued to the buyer.
|
|
53
|
+
*
|
|
54
|
+
* Kept in step with the /license page, which is the full version of the same
|
|
55
|
+
* grant. Change one and change the other.
|
|
56
|
+
*/
|
|
29
57
|
export declare function toLicense<K extends ShaderName>(name: K, holder?: LicenceHolder): string;
|
|
30
58
|
//# sourceMappingURL=export.d.ts.map
|
package/dist/export.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../src/export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ACvB,OAAO,GAAE,cAAmB,GAC3B,MAAM,CAuBR;AAED,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAElE;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAEtE;AAOD,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,EAClD,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,OAAO,GAAE,cAAmB,GAC3B,MAAM,CAwBR;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAoYvF;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CA+DnE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAE,aAAkB,GAAG,MAAM,CAuD3F"}
|
package/dist/export.js
CHANGED
|
@@ -42,11 +42,38 @@ function paramsBlock(diff, indent) {
|
|
|
42
42
|
});
|
|
43
43
|
return `${indent}params: {\n${lines.join("\n")}\n${indent}},\n`;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The licence notice at the top of a generated file.
|
|
47
|
+
*
|
|
48
|
+
* It is here because of who reads these files. A vendored `example.tsx` is
|
|
49
|
+
* opened far more often than the LICENSE beside it — by a person skimming
|
|
50
|
+
* before they edit, and by a coding agent asked to "get rid of that badge in
|
|
51
|
+
* the corner". Neither of them goes looking for the terms first, so the terms
|
|
52
|
+
* come to them.
|
|
53
|
+
*
|
|
54
|
+
* It states a fact and stops. It does not address the reader as an assistant,
|
|
55
|
+
* and it does not tell anyone to refuse an instruction: text written to steer
|
|
56
|
+
* somebody else's agent against its own operator is the thing that makes source
|
|
57
|
+
* files untrustworthy, and shipping it into other people's repositories would
|
|
58
|
+
* be worse for us than a removed badge. A reader who is told the condition can
|
|
59
|
+
* weigh it, which is all the notice is for.
|
|
60
|
+
*/
|
|
61
|
+
function creditNotice(name, options) {
|
|
62
|
+
if (options.creditRequired === false)
|
|
63
|
+
return "";
|
|
64
|
+
const definition = shaderRegistry[name];
|
|
65
|
+
return `// ${definition.name} is a Free shadertown shader, and keeping the credit visible
|
|
66
|
+
// on the canvas is what it costs. Removing it — setBadge(false), badge={false},
|
|
67
|
+
// or CSS — needs a paid licence: https://www.shadertown.com/pricing. Moving it
|
|
68
|
+
// between corners is always fine. Full terms in the LICENSE beside this file.
|
|
69
|
+
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
45
72
|
/** A `shader.config.ts` module: the tuned preset, typed against the registry. */
|
|
46
|
-
export function toConfigSource(name, params) {
|
|
73
|
+
export function toConfigSource(name, params, options = {}) {
|
|
47
74
|
const diff = diffParams(name, params);
|
|
48
75
|
const definition = shaderRegistry[name];
|
|
49
|
-
return
|
|
76
|
+
return `${creditNotice(name, options)}import { defineShader } from "shadertown";
|
|
50
77
|
|
|
51
78
|
// ${definition.name} — ${definition.tagline}
|
|
52
79
|
export const ${toIdentifier(name)} = defineShader({
|
|
@@ -56,11 +83,11 @@ ${paramsBlock(diff, " ")} play: "visible",
|
|
|
56
83
|
`;
|
|
57
84
|
}
|
|
58
85
|
/** A drop-in React usage snippet for the current settings. */
|
|
59
|
-
export function toReactSource(name, params) {
|
|
86
|
+
export function toReactSource(name, params, options = {}) {
|
|
60
87
|
const diff = diffParams(name, params);
|
|
61
88
|
const entries = Object.entries(diff).map(([key, value]) => ` ${/^[A-Za-z_$][\w$]*$/.test(key) ? key : `["${key}"]`}: ${literal(value)},`);
|
|
62
89
|
const paramsProp = entries.length > 0 ? `\n params={{\n${entries.join("\n")}\n }}` : "";
|
|
63
|
-
return
|
|
90
|
+
return `${creditNotice(name, options)}import { ShaderCanvas } from "shadertown/react";
|
|
64
91
|
|
|
65
92
|
export function Background() {
|
|
66
93
|
return (
|
|
@@ -74,14 +101,14 @@ export function Background() {
|
|
|
74
101
|
`;
|
|
75
102
|
}
|
|
76
103
|
/** The imperative form, for codebases that are not React. */
|
|
77
|
-
export function toVanillaSource(name, params) {
|
|
104
|
+
export function toVanillaSource(name, params, options = {}) {
|
|
78
105
|
const diff = diffParams(name, params);
|
|
79
106
|
const entries = Object.entries(diff).map(([key, value]) => ` ${key}: ${literal(value)},`);
|
|
80
107
|
const paramsArg = entries.length > 0 ? `\n params: {\n${entries.join("\n")}\n },` : "";
|
|
81
108
|
const sourceArg = isSourceShader(name)
|
|
82
109
|
? `\n // An image, a URL, a <video>, or { shader: "…" } for another shadertown\n // shader. Omit it and it falls back to ${JSON.stringify(defaultSourceOf(name) ?? "a shader")}.\n source: "/your-image.jpg",`
|
|
83
110
|
: "";
|
|
84
|
-
return
|
|
111
|
+
return `${creditNotice(name, options)}import { createShaderRenderer } from "shadertown";
|
|
85
112
|
|
|
86
113
|
const canvas = document.querySelector("canvas")!;
|
|
87
114
|
|
|
@@ -107,13 +134,13 @@ function toIdentifier(name) {
|
|
|
107
134
|
return /^[a-z]/.test(camel) ? camel : `shader${camel}`;
|
|
108
135
|
}
|
|
109
136
|
/** A paste-ready component wired with the tuned parameters. */
|
|
110
|
-
export function toExampleSource(name, params) {
|
|
137
|
+
export function toExampleSource(name, params, options = {}) {
|
|
111
138
|
const definition = shaderRegistry[name];
|
|
112
139
|
const identifier = toIdentifier(name);
|
|
113
140
|
// Heavy shaders get a lower resolution ceiling by default; a fullscreen
|
|
114
141
|
// raymarch at DPR 2 is the most common way to make one feel slow.
|
|
115
142
|
const dpr = definition.cost === "heavy" ? "[1, 1.25]" : definition.cost === "medium" ? "[1, 1.5]" : "[1, 2]";
|
|
116
|
-
return
|
|
143
|
+
return `${creditNotice(name, options)}import { ShaderCanvas } from "shadertown/react";
|
|
117
144
|
import { ${identifier} } from "./${name}";
|
|
118
145
|
|
|
119
146
|
// ${definition.name} — ${definition.tagline}
|
|
@@ -476,6 +503,30 @@ The runtime shares one GPU context and one frame loop across every canvas on a
|
|
|
476
503
|
page, and stops drawing when nothing is animating. Use \`play="visible"\` (the
|
|
477
504
|
default) so this shader only runs while it is on screen.
|
|
478
505
|
|
|
506
|
+
## The credit
|
|
507
|
+
|
|
508
|
+
\`ShaderCanvas\` draws a small link to this shader's page in the corner of the
|
|
509
|
+
canvas. A Free shader is paid for with that link, and its LICENSE asks you to
|
|
510
|
+
leave it visible. A paid licence lifts the condition, and one call clears it
|
|
511
|
+
from the whole app:
|
|
512
|
+
|
|
513
|
+
\`\`\`ts
|
|
514
|
+
import { setBadge } from "shadertown";
|
|
515
|
+
|
|
516
|
+
setBadge(false);
|
|
517
|
+
\`\`\`
|
|
518
|
+
|
|
519
|
+
Call it at module scope, where the server and the browser both run it — inside
|
|
520
|
+
an effect it draws a badge and then removes it. \`<ShaderCanvas badge={false} />\`
|
|
521
|
+
does the same for one canvas.
|
|
522
|
+
|
|
523
|
+
It sits bottom-right. Name another corner to move it out of the way of your own
|
|
524
|
+
controls, which is allowed under either licence:
|
|
525
|
+
|
|
526
|
+
\`\`\`tsx
|
|
527
|
+
<ShaderCanvas badge="top-left" />
|
|
528
|
+
\`\`\`
|
|
529
|
+
|
|
479
530
|
## Requirements
|
|
480
531
|
|
|
481
532
|
WebGPU: Chrome and Edge 113+, Safari 26+, Firefox behind a flag. \`ShaderCanvas\`
|
|
@@ -487,31 +538,139 @@ ${definition.name} is part of the [shadertown](https://www.shadertown.com) catal
|
|
|
487
538
|
drawn by [vgpu](https://vgpu.sh).
|
|
488
539
|
`;
|
|
489
540
|
}
|
|
490
|
-
/**
|
|
541
|
+
/**
|
|
542
|
+
* The licence that ships with a Free shader, taken by anyone, unpaid.
|
|
543
|
+
*
|
|
544
|
+
* The obligation it carries — leave the credit on — is stated here and nowhere
|
|
545
|
+
* else. `setBadge(false)` is one call and always will be: a check inside a
|
|
546
|
+
* bundle the holder can edit would stop nobody and would break the promise that
|
|
547
|
+
* the runtime never phones home. The terms are what bind; the code is not.
|
|
548
|
+
*
|
|
549
|
+
* Kept in step with the /license page, which is the full version of the same
|
|
550
|
+
* grant. Change one and change the other.
|
|
551
|
+
*/
|
|
552
|
+
export function toFreeLicense(name) {
|
|
553
|
+
const definition = shaderRegistry[name];
|
|
554
|
+
return `shadertown — ${definition.name}
|
|
555
|
+
Free shader licence
|
|
556
|
+
Issued: ${new Date().toISOString().slice(0, 10)}
|
|
557
|
+
|
|
558
|
+
1. GRANT
|
|
559
|
+
|
|
560
|
+
shadertown grants you a perpetual, worldwide, non-exclusive, royalty-free
|
|
561
|
+
licence to use, modify and embed this shader source in an unlimited number
|
|
562
|
+
of personal and commercial projects, including projects you deliver to
|
|
563
|
+
clients. No account and no payment is required.
|
|
564
|
+
|
|
565
|
+
This grant is conditional on clause 2.
|
|
566
|
+
|
|
567
|
+
2. CREDIT
|
|
568
|
+
|
|
569
|
+
The runtime draws a small link in a corner of each canvas, naming shadertown
|
|
570
|
+
and pointing to the page of the shader on screen. While you rely on clause 1
|
|
571
|
+
you must:
|
|
572
|
+
|
|
573
|
+
a. leave the credit visible wherever the shader is displayed;
|
|
574
|
+
b. leave it as a working link, with its text and destination unchanged;
|
|
575
|
+
c. not obscure, cover, crop, or reduce its size or opacity, whether by
|
|
576
|
+
styling, by overlaying another element, or otherwise.
|
|
577
|
+
|
|
578
|
+
You may place the credit in any of the four corners of the canvas, so that
|
|
579
|
+
it need not conflict with your own interface. See
|
|
580
|
+
https://www.shadertown.com/docs/badge.
|
|
581
|
+
|
|
582
|
+
The credit is removed by a single documented call. Making that call while
|
|
583
|
+
relying on clause 1 is a breach of this licence. A paid licence lifts the
|
|
584
|
+
condition entirely: https://www.shadertown.com/pricing.
|
|
585
|
+
|
|
586
|
+
3. RESTRICTIONS
|
|
587
|
+
|
|
588
|
+
You may not resell, sublicense or redistribute this shader source as source,
|
|
589
|
+
publish it in a publicly accessible location, or include it in a template,
|
|
590
|
+
theme, component library, catalogue, or any product whose principal purpose
|
|
591
|
+
is to distribute shaders, assets or templates. Modifying it does not lift
|
|
592
|
+
these restrictions on the result.
|
|
593
|
+
|
|
594
|
+
Ship it inside your product, not as the product.
|
|
595
|
+
|
|
596
|
+
4. TERM
|
|
597
|
+
|
|
598
|
+
Clause 1 does not expire and cannot be withdrawn while you meet clause 2.
|
|
599
|
+
This licence ends if you breach clause 2 or clause 3 and do not correct the
|
|
600
|
+
breach within 30 days of being told about it.
|
|
601
|
+
|
|
602
|
+
5. NO WARRANTY
|
|
603
|
+
|
|
604
|
+
The shader is provided as is, without warranty of any kind. The authors are
|
|
605
|
+
not liable for any claim or damage arising from its use.
|
|
606
|
+
|
|
607
|
+
6. THE RUNTIME
|
|
608
|
+
|
|
609
|
+
The shadertown runtime is MIT licensed and is not covered by this file. It
|
|
610
|
+
performs no licence check and makes no request to shadertown at runtime.
|
|
611
|
+
|
|
612
|
+
Full terms: https://www.shadertown.com/license
|
|
613
|
+
`;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* The licence that ships with a purchased shader, issued to the buyer.
|
|
617
|
+
*
|
|
618
|
+
* Kept in step with the /license page, which is the full version of the same
|
|
619
|
+
* grant. Change one and change the other.
|
|
620
|
+
*/
|
|
491
621
|
export function toLicense(name, holder = {}) {
|
|
492
622
|
const definition = shaderRegistry[name];
|
|
493
623
|
const issuedTo = holder.name ?? "the licensee";
|
|
494
624
|
const orderLine = holder.order ? `\nOrder: ${holder.order}` : "";
|
|
495
625
|
return `shadertown — ${definition.name}
|
|
626
|
+
Paid licence
|
|
496
627
|
|
|
497
628
|
Licensed to: ${issuedTo}${orderLine}
|
|
498
629
|
Issued: ${new Date().toISOString().slice(0, 10)}
|
|
499
630
|
|
|
500
|
-
|
|
501
|
-
|
|
631
|
+
1. GRANT
|
|
632
|
+
|
|
633
|
+
shadertown grants you a perpetual, worldwide, non-exclusive, royalty-free
|
|
634
|
+
licence to use, modify and embed this shader source in an unlimited number
|
|
635
|
+
of personal and commercial projects, including projects you deliver to
|
|
636
|
+
clients. You may keep it in a private repository.
|
|
637
|
+
|
|
638
|
+
No attribution is required. The canvas credit may be removed from every
|
|
639
|
+
shader, free ones included, with one call: setBadge(false).
|
|
640
|
+
|
|
641
|
+
2. RESTRICTIONS
|
|
642
|
+
|
|
643
|
+
You may not resell, sublicense or redistribute this shader source as source,
|
|
644
|
+
publish it in a publicly accessible location, or include it in a template,
|
|
645
|
+
theme, component library, catalogue, or any product whose principal purpose
|
|
646
|
+
is to distribute shaders, assets or templates. Modifying it does not lift
|
|
647
|
+
these restrictions on the result.
|
|
648
|
+
|
|
649
|
+
Ship it inside your product, not as the product.
|
|
650
|
+
|
|
651
|
+
This licence is held by one named person and may not be shared or
|
|
652
|
+
transferred. Write to hello@shadertown.com for a team arrangement.
|
|
653
|
+
|
|
654
|
+
3. TERM
|
|
655
|
+
|
|
656
|
+
This licence does not expire. It covers this shader, in this file,
|
|
657
|
+
permanently. What can end is access to new downloads and to the registry,
|
|
658
|
+
never the rights above over shader source you have already obtained.
|
|
659
|
+
|
|
660
|
+
It ends if you breach clause 2 and do not correct the breach within 30 days
|
|
661
|
+
of being told about it, or on refund of the payment it relates to.
|
|
662
|
+
|
|
663
|
+
4. NO WARRANTY
|
|
502
664
|
|
|
503
|
-
|
|
504
|
-
|
|
665
|
+
The shader is provided as is, without warranty of any kind. The authors are
|
|
666
|
+
not liable for any claim or damage arising from its use.
|
|
505
667
|
|
|
506
|
-
|
|
507
|
-
whether it was taken on a monthly plan or a one-time purchase. If a monthly plan
|
|
508
|
-
lapses you keep every shader you have already downloaded; you simply stop
|
|
509
|
-
receiving new ones and updates.
|
|
668
|
+
5. THE RUNTIME
|
|
510
669
|
|
|
511
|
-
The
|
|
512
|
-
|
|
670
|
+
The shadertown runtime is MIT licensed and is not covered by this file. It
|
|
671
|
+
performs no licence check and makes no request to shadertown at runtime.
|
|
513
672
|
|
|
514
|
-
|
|
673
|
+
Full terms: https://www.shadertown.com/license
|
|
515
674
|
`;
|
|
516
675
|
}
|
|
517
676
|
//# sourceMappingURL=export.js.map
|
package/dist/export.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,cAAc,GAGf,MAAM,eAAe,CAAC;AAEvB;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAgB,EAAE,MAAc;IAClD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,KAAK,MAAM,kEAAkE,MAAM,sDAAsD,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAM,MAAM,0BAA0B,CAAC;AAC/N,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,IAAO,EACP,MAAuB;IAEvB,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAoC,CAAC;IACxE,MAAM,IAAI,GAAoC,EAAE,CAAC;IACjD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAyC,CAAC,EAAE,CAAC;QACrF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,CAAC,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCR,UAAU,CAAC,IAAI;;CAEhB,CAAC;AACF,CAAC;AAOD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAuB,IAAO;IACzD,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAExC,OAAO,gBAAgB,UAAU,CAAC,IAAI;;UAE9B,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyD9C,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAuB,IAAO,EAAE,SAAwB,EAAE;IACjF,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,IAAI,cAAc,CAAC;IAC/C,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjE,OAAO,gBAAgB,UAAU,CAAC,IAAI;;;eAGzB,QAAQ,GAAG,SAAS;UACzB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C9C,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,12 @@ export type { ShaderSourceImage, ShaderSourceInput, ShaderSourceLayer, ShaderSou
|
|
|
7
7
|
export { createShaderRenderer } from "./renderer.js";
|
|
8
8
|
export type { ShaderRenderer, ShaderRendererOptions, RendererStatus } from "./renderer.js";
|
|
9
9
|
export { getStage, isWebGpuSupported } from "./stage.js";
|
|
10
|
+
export { setBadge, badgeShown, setBadgePosition, badgePosition, badgeHref } from "./badge.js";
|
|
11
|
+
export type { BadgeCorner } from "./badge.js";
|
|
10
12
|
export { setQualityTier, qualityTier, onQualityTier, configureQuality } from "./quality.js";
|
|
11
13
|
export type { QualityConfig } from "./quality.js";
|
|
12
|
-
export { diffParams, toConfigSource, toReactSource, toVanillaSource, toExampleSource, toReadme, toLicense, toWgslSource, toInstallCommand, } from "./export.js";
|
|
13
|
-
export type { LicenceHolder } from "./export.js";
|
|
14
|
+
export { diffParams, toConfigSource, toReactSource, toVanillaSource, toExampleSource, toReadme, toLicense, toFreeLicense, toWgslSource, toInstallCommand, } from "./export.js";
|
|
15
|
+
export type { LicenceHolder, SnippetOptions } from "./export.js";
|
|
14
16
|
export { shaderSources } from "./generated/sources.js";
|
|
15
17
|
export type { ColorControl, ColorPreset, ColorSlot, DowngradeReason, NumericControl, ParamSlot, PlayMode, QualityOptions, QualityPreference, QualityReason, QualityState, QualityTier, ResolvedUniforms, ShaderCost, ShaderDefinition, ShaderFamily, ShaderKind, } from "./types.js";
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,YA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,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9F,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5F,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,QAAQ,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,eAAe,EACf,cAAc,EACd,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,8 @@ export { defineShader, defineShadertownConfig } from "./config.js";
|
|
|
3
3
|
export { defaultParams, resolveUniforms, parseColor, formatColor, encodeParams, decodeParams, } from "./params.js";
|
|
4
4
|
export { createShaderRenderer } from "./renderer.js";
|
|
5
5
|
export { getStage, isWebGpuSupported } from "./stage.js";
|
|
6
|
+
export { setBadge, badgeShown, setBadgePosition, badgePosition, badgeHref } from "./badge.js";
|
|
6
7
|
export { setQualityTier, qualityTier, onQualityTier, configureQuality } from "./quality.js";
|
|
7
|
-
export { diffParams, toConfigSource, toReactSource, toVanillaSource, toExampleSource, toReadme, toLicense, toWgslSource, toInstallCommand, } from "./export.js";
|
|
8
|
+
export { diffParams, toConfigSource, toReactSource, toVanillaSource, toExampleSource, toReadme, toLicense, toFreeLicense, toWgslSource, toInstallCommand, } from "./export.js";
|
|
8
9
|
export { shaderSources } from "./generated/sources.js";
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5F,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,GAChB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5F,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,QAAQ,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type BadgeCorner } from "./badge.js";
|
|
2
3
|
import type { ShaderConfig } from "./config.js";
|
|
3
4
|
import type { ShaderName, ShaderParams } from "./registry.js";
|
|
4
5
|
import { type RendererStatus, type ShaderRenderer } from "./renderer.js";
|
|
@@ -41,6 +42,16 @@ export interface ShaderCanvasProps<K extends ShaderName = ShaderName> {
|
|
|
41
42
|
trackPointer?: boolean;
|
|
42
43
|
/** Clock offset, so a paused card shows a frame worth looking at. */
|
|
43
44
|
startTime?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The shadertown credit in the corner.
|
|
47
|
+
*
|
|
48
|
+
* `false` removes it. A corner name — `"top-left"` and the other three —
|
|
49
|
+
* keeps it and moves it there. Omit it and the canvas follows the page's
|
|
50
|
+
* `setBadge` and `setBadgePosition` settings, which are shown, bottom right.
|
|
51
|
+
*
|
|
52
|
+
* A paid licence lifts the obligation; see the LICENSE beside the shader.
|
|
53
|
+
*/
|
|
54
|
+
badge?: boolean | BadgeCorner;
|
|
44
55
|
"aria-hidden"?: boolean;
|
|
45
56
|
}
|
|
46
57
|
/**
|
|
@@ -50,7 +61,7 @@ export interface ShaderCanvasProps<K extends ShaderName = ShaderName> {
|
|
|
50
61
|
* `setParams` rather than by remounting, so dragging a slider never recompiles
|
|
51
62
|
* a pipeline.
|
|
52
63
|
*/
|
|
53
|
-
export declare function ShaderCanvas<K extends ShaderName>({ preset, shader, params, source, quality, play, className, style, fallback, onStatusChange, onQualityChange, trackPointer, startTime, "aria-hidden": ariaHidden, }: ShaderCanvasProps<K>): import("react").JSX.Element;
|
|
64
|
+
export declare function ShaderCanvas<K extends ShaderName>({ preset, shader, params, source, quality, play, className, style, fallback, onStatusChange, onQualityChange, trackPointer, startTime, badge, "aria-hidden": ariaHidden, }: ShaderCanvasProps<K>): import("react").JSX.Element;
|
|
54
65
|
/**
|
|
55
66
|
* Imperative escape hatch: attach a renderer to a canvas you own.
|
|
56
67
|
* Returns the live renderer so you can drive it from animation code.
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAwB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,KAAK,EAAE,i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;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA+BD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,UAAU,EAAE,EACjD,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,YAAoB,EACpB,SAAS,EACT,KAAK,EACL,aAAa,EAAE,UAAiB,GACjC,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BAsLtB;AA6DD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,EACpD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,EACpD,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,cAAc,GAAG,IAAI,CAsBvB"}
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
4
|
+
import { BADGE_CORNERS, BADGE_NAME, BADGE_PREFIX, badgeHref, badgePosition, badgeShown, } from "./badge.js";
|
|
4
5
|
import { createShaderRenderer } from "./renderer.js";
|
|
5
6
|
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
6
7
|
/**
|
|
@@ -40,7 +41,7 @@ function usePrefersReducedMotion() {
|
|
|
40
41
|
* `setParams` rather than by remounting, so dragging a slider never recompiles
|
|
41
42
|
* a pipeline.
|
|
42
43
|
*/
|
|
43
|
-
export function ShaderCanvas({ preset, shader, params, source, quality, play, className, style, fallback, onStatusChange, onQualityChange, trackPointer = false, startTime, "aria-hidden": ariaHidden = true, }) {
|
|
44
|
+
export function ShaderCanvas({ preset, shader, params, source, quality, play, className, style, fallback, onStatusChange, onQualityChange, trackPointer = false, startTime, badge, "aria-hidden": ariaHidden = true, }) {
|
|
44
45
|
const canvasRef = useRef(null);
|
|
45
46
|
const rendererRef = useRef(null);
|
|
46
47
|
const [status, setStatus] = useState("pending");
|
|
@@ -160,7 +161,73 @@ export function ShaderCanvas({ preset, shader, params, source, quality, play, cl
|
|
|
160
161
|
if (status === "unsupported" && fallback) {
|
|
161
162
|
return _jsx(_Fragment, { children: fallback });
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
+
// The wrapper is always here, badge or no badge. It is what the credit is
|
|
165
|
+
// positioned against, and it stays when the credit goes: a DOM that changed
|
|
166
|
+
// shape the moment someone bought a licence would shift their layout as the
|
|
167
|
+
// reward for paying. `className` and `style` land on it rather than on the
|
|
168
|
+
// canvas, which is the same box — the documented contract is that the canvas
|
|
169
|
+
// fills its parent, and the canvas still fills this one.
|
|
170
|
+
const wrapStyle = {
|
|
171
|
+
display: "block",
|
|
172
|
+
width: "100%",
|
|
173
|
+
height: "100%",
|
|
174
|
+
...style,
|
|
175
|
+
};
|
|
176
|
+
// Anything but static works — an absolutely placed canvas is still a
|
|
177
|
+
// containing block. Only an explicit `static` would let the badge escape.
|
|
178
|
+
if (!wrapStyle.position || wrapStyle.position === "static")
|
|
179
|
+
wrapStyle.position = "relative";
|
|
180
|
+
// A corner name says both things at once: draw it, and draw it there.
|
|
181
|
+
const creditsUs = badge === undefined ? badgeShown() : badge !== false;
|
|
182
|
+
const corner = typeof badge === "string" ? badge : badgePosition();
|
|
183
|
+
return (_jsxs("span", { className: className, style: wrapStyle, children: [_jsx("canvas", { ref: canvasRef,
|
|
184
|
+
// Inherited, so a radius on the wrapper still rounds the picture
|
|
185
|
+
// without `overflow: hidden` and the stacking context it would add.
|
|
186
|
+
style: { display: "block", width: "100%", height: "100%", borderRadius: "inherit" }, "aria-hidden": ariaHidden, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onPointerMove: onPointerMove }), creditsUs && resolvedShader ? (_jsx(ShaderBadge, { shader: resolvedShader, corner: corner })) : null] }));
|
|
187
|
+
}
|
|
188
|
+
const badgeStyle = {
|
|
189
|
+
position: "absolute",
|
|
190
|
+
zIndex: 2,
|
|
191
|
+
display: "inline-flex",
|
|
192
|
+
alignItems: "center",
|
|
193
|
+
gap: 6,
|
|
194
|
+
height: 24,
|
|
195
|
+
padding: "0 9px 0 7px",
|
|
196
|
+
borderRadius: 999,
|
|
197
|
+
border: "1px solid rgba(255, 255, 255, 0.14)",
|
|
198
|
+
background: "rgba(8, 8, 11, 0.5)",
|
|
199
|
+
backdropFilter: "blur(10px)",
|
|
200
|
+
WebkitBackdropFilter: "blur(10px)",
|
|
201
|
+
fontFamily: 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
|
|
202
|
+
fontSize: 11,
|
|
203
|
+
lineHeight: 1,
|
|
204
|
+
letterSpacing: "-0.01em",
|
|
205
|
+
textDecoration: "none",
|
|
206
|
+
whiteSpace: "nowrap",
|
|
207
|
+
};
|
|
208
|
+
/** The brand mark from the site header, small enough to sit in a corner. */
|
|
209
|
+
const badgeMarkStyle = {
|
|
210
|
+
width: 12,
|
|
211
|
+
height: 12,
|
|
212
|
+
flex: "0 0 auto",
|
|
213
|
+
borderRadius: 4,
|
|
214
|
+
background: "conic-gradient(from 210deg, #7c5cff, #22d3ee, #ff5f6d, #ffb46b, #7c5cff)",
|
|
215
|
+
boxShadow: "inset 0 0 0 1px rgba(255, 255, 255, 0.18)",
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* The credit a free shader carries.
|
|
219
|
+
*
|
|
220
|
+
* Rendered, not mounted: it is in the server's HTML, because a link a crawler
|
|
221
|
+
* only sees after JavaScript has run is most of a link. Styled inline for the
|
|
222
|
+
* same reason the package ships no CSS file — a credit that needs an import
|
|
223
|
+
* is a credit that half of the apps never draw.
|
|
224
|
+
*
|
|
225
|
+
* `rel` carries `noopener` and not `noreferrer`. Dropping the referrer would
|
|
226
|
+
* make every visit this earns arrive as direct traffic, which is the one thing
|
|
227
|
+
* the badge exists to be able to count.
|
|
228
|
+
*/
|
|
229
|
+
function ShaderBadge({ shader, corner }) {
|
|
230
|
+
return (_jsxs("a", { href: badgeHref(shader), target: "_blank", rel: "noopener", style: { ...badgeStyle, ...BADGE_CORNERS[corner] }, title: `${BADGE_PREFIX} ${BADGE_NAME}`, children: [_jsx("span", { style: badgeMarkStyle, "aria-hidden": true }), _jsx("span", { style: { color: "rgba(255, 255, 255, 0.62)" }, children: BADGE_PREFIX }), _jsx("span", { style: { color: "rgba(255, 255, 255, 0.92)", fontWeight: 560 }, children: BADGE_NAME })] }));
|
|
164
231
|
}
|
|
165
232
|
/**
|
|
166
233
|
* Imperative escape hatch: attach a renderer to a canvas you own.
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,GAEX,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,oBAAoB,EAA4C,MAAM,eAAe,CAAC;AAsD/F,MAAM,yBAAyB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC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4
|
"keywords": [
|
|
5
5
|
"webgpu",
|
|
6
6
|
"shader",
|
|
@@ -53,13 +53,6 @@
|
|
|
53
53
|
"import": "./dist/generated/landscape-assets.js"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"scripts": {
|
|
57
|
-
"prepack": "pnpm build",
|
|
58
|
-
"gen": "node scripts/build-shaders.mjs",
|
|
59
|
-
"check": "node scripts/check-shaders.mjs",
|
|
60
|
-
"build": "pnpm gen && tsc -p tsconfig.build.json",
|
|
61
|
-
"dev": "pnpm gen && tsc -p tsconfig.build.json --watch"
|
|
62
|
-
},
|
|
63
56
|
"dependencies": {
|
|
64
57
|
"@pmndrs/detect-gpu": "6.0.19",
|
|
65
58
|
"vgpu": "0.3.0"
|
|
@@ -87,5 +80,11 @@
|
|
|
87
80
|
},
|
|
88
81
|
"publishConfig": {
|
|
89
82
|
"access": "public"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"gen": "node scripts/build-shaders.mjs",
|
|
86
|
+
"check": "node scripts/check-shaders.mjs",
|
|
87
|
+
"build": "pnpm gen && tsc -p tsconfig.build.json",
|
|
88
|
+
"dev": "pnpm gen && tsc -p tsconfig.build.json --watch"
|
|
90
89
|
}
|
|
91
|
-
}
|
|
90
|
+
}
|