@autumnsgrove/gossamer 0.1.0 → 0.1.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/dist/characters.d.ts.map +1 -1
- package/dist/colors.d.ts +312 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +542 -0
- package/dist/index.js.map +1 -1
- package/dist/patterns.d.ts +119 -2
- package/dist/patterns.d.ts.map +1 -1
- package/dist/renderer.d.ts +27 -0
- package/dist/renderer.d.ts.map +1 -1
- package/dist/svelte/index.js +9 -12
- package/dist/svelte/index.js.map +1 -1
- package/package.json +12 -3
- package/src/characters.ts +55 -0
- package/src/colors.ts +234 -0
- package/src/index.ts +35 -4
- package/src/patterns.ts +447 -3
- package/src/renderer.ts +161 -0
- package/src/svelte/GossamerClouds.svelte +6 -6
package/dist/patterns.d.ts
CHANGED
|
@@ -76,6 +76,84 @@ export declare function staticNoise(seed?: number): number;
|
|
|
76
76
|
* @returns Value between 0 and 1
|
|
77
77
|
*/
|
|
78
78
|
export declare function seededNoise2D(x: number, y: number, seed?: number): number;
|
|
79
|
+
/**
|
|
80
|
+
* Clouds pattern - soft, billowy fbm with gentle movement
|
|
81
|
+
* The signature Gossamer effect!
|
|
82
|
+
*
|
|
83
|
+
* @param x - X coordinate
|
|
84
|
+
* @param y - Y coordinate
|
|
85
|
+
* @param time - Time value for animation
|
|
86
|
+
* @param config - Pattern configuration
|
|
87
|
+
* @returns Value between -1 and 1
|
|
88
|
+
*/
|
|
89
|
+
export declare function cloudsPattern(x: number, y: number, time: number, config?: PatternConfig): number;
|
|
90
|
+
/**
|
|
91
|
+
* Plasma pattern - classic demoscene effect
|
|
92
|
+
* Combines sine waves at different frequencies and phases
|
|
93
|
+
*
|
|
94
|
+
* @param x - X coordinate
|
|
95
|
+
* @param y - Y coordinate
|
|
96
|
+
* @param time - Time value for animation
|
|
97
|
+
* @param config - Pattern configuration
|
|
98
|
+
* @returns Value between -1 and 1
|
|
99
|
+
*/
|
|
100
|
+
export declare function plasmaPattern(x: number, y: number, time: number, config?: PatternConfig): number;
|
|
101
|
+
/**
|
|
102
|
+
* Vortex pattern - swirling spiral around center
|
|
103
|
+
*
|
|
104
|
+
* @param x - X coordinate
|
|
105
|
+
* @param y - Y coordinate
|
|
106
|
+
* @param centerX - Vortex center X
|
|
107
|
+
* @param centerY - Vortex center Y
|
|
108
|
+
* @param time - Time value for animation
|
|
109
|
+
* @param config - Pattern configuration
|
|
110
|
+
* @returns Value between -1 and 1
|
|
111
|
+
*/
|
|
112
|
+
export declare function vortexPattern(x: number, y: number, centerX: number, centerY: number, time: number, config?: PatternConfig): number;
|
|
113
|
+
/**
|
|
114
|
+
* Matrix pattern - falling columns like digital rain
|
|
115
|
+
*
|
|
116
|
+
* @param x - X coordinate (column)
|
|
117
|
+
* @param y - Y coordinate (row)
|
|
118
|
+
* @param time - Time value for animation
|
|
119
|
+
* @param config - Pattern configuration
|
|
120
|
+
* @returns Value between -1 and 1
|
|
121
|
+
*/
|
|
122
|
+
export declare function matrixPattern(x: number, y: number, time: number, config?: PatternConfig): number;
|
|
123
|
+
/**
|
|
124
|
+
* Gradient pattern - smooth animated gradients
|
|
125
|
+
*
|
|
126
|
+
* @param x - X coordinate
|
|
127
|
+
* @param y - Y coordinate
|
|
128
|
+
* @param cols - Total columns (for normalization)
|
|
129
|
+
* @param rows - Total rows (for normalization)
|
|
130
|
+
* @param time - Time value for animation
|
|
131
|
+
* @param config - Pattern configuration
|
|
132
|
+
* @returns Value between -1 and 1
|
|
133
|
+
*/
|
|
134
|
+
export declare function gradientPattern(x: number, y: number, cols: number, rows: number, time: number, config?: PatternConfig): number;
|
|
135
|
+
/**
|
|
136
|
+
* Diamond pattern - interference creating diamond shapes
|
|
137
|
+
*
|
|
138
|
+
* @param x - X coordinate
|
|
139
|
+
* @param y - Y coordinate
|
|
140
|
+
* @param time - Time value for animation
|
|
141
|
+
* @param config - Pattern configuration
|
|
142
|
+
* @returns Value between -1 and 1
|
|
143
|
+
*/
|
|
144
|
+
export declare function diamondPattern(x: number, y: number, time: number, config?: PatternConfig): number;
|
|
145
|
+
/**
|
|
146
|
+
* Fractal pattern - animated Mandelbrot/Julia set
|
|
147
|
+
*
|
|
148
|
+
* @param x - X coordinate
|
|
149
|
+
* @param y - Y coordinate
|
|
150
|
+
* @param cols - Total columns (for centering)
|
|
151
|
+
* @param rows - Total rows (for centering)
|
|
152
|
+
* @param time - Time value for animation
|
|
153
|
+
* @param config - Pattern configuration
|
|
154
|
+
* @returns Value between -1 and 1
|
|
155
|
+
*/
|
|
156
|
+
export declare function fractalPattern(x: number, y: number, cols: number, rows: number, time: number, config?: PatternConfig): number;
|
|
79
157
|
/**
|
|
80
158
|
* Generate a brightness grid for pattern rendering
|
|
81
159
|
*
|
|
@@ -86,7 +164,7 @@ export declare function seededNoise2D(x: number, y: number, seed?: number): numb
|
|
|
86
164
|
* @param config - Pattern configuration
|
|
87
165
|
* @returns 2D array of brightness values (0-255)
|
|
88
166
|
*/
|
|
89
|
-
export declare function generateBrightnessGrid(cols: number, rows: number, pattern:
|
|
167
|
+
export declare function generateBrightnessGrid(cols: number, rows: number, pattern: PatternType, time?: number, config?: PatternConfig): number[][];
|
|
90
168
|
/**
|
|
91
169
|
* Generate ImageData from a brightness grid
|
|
92
170
|
*
|
|
@@ -96,5 +174,44 @@ export declare function generateBrightnessGrid(cols: number, rows: number, patte
|
|
|
96
174
|
* @returns ImageData object
|
|
97
175
|
*/
|
|
98
176
|
export declare function gridToImageData(grid: number[][], cellWidth: number, cellHeight: number): ImageData;
|
|
99
|
-
export type PatternType = 'perlin' | 'waves' | 'static' | 'ripple' | 'fbm';
|
|
177
|
+
export type PatternType = 'perlin' | 'waves' | 'static' | 'ripple' | 'fbm' | 'clouds' | 'plasma' | 'vortex' | 'matrix' | 'gradient' | 'diamond' | 'fractal';
|
|
178
|
+
/**
|
|
179
|
+
* Reusable brightness buffer using flat Uint8Array
|
|
180
|
+
* ~30% faster than number[][] due to contiguous memory and no GC pressure
|
|
181
|
+
*/
|
|
182
|
+
export interface BrightnessBuffer {
|
|
183
|
+
/** Flat array of brightness values (0-255), row-major order */
|
|
184
|
+
data: Uint8Array;
|
|
185
|
+
/** Number of columns */
|
|
186
|
+
cols: number;
|
|
187
|
+
/** Number of rows */
|
|
188
|
+
rows: number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Create a reusable brightness buffer
|
|
192
|
+
* Call once at init, then reuse with fillBrightnessBuffer
|
|
193
|
+
*
|
|
194
|
+
* @param cols - Number of columns
|
|
195
|
+
* @param rows - Number of rows
|
|
196
|
+
* @returns Reusable buffer object
|
|
197
|
+
*/
|
|
198
|
+
export declare function createBrightnessBuffer(cols: number, rows: number): BrightnessBuffer;
|
|
199
|
+
/**
|
|
200
|
+
* Fill an existing brightness buffer with pattern data (zero allocation)
|
|
201
|
+
* Use this in animation loops for best performance
|
|
202
|
+
*
|
|
203
|
+
* @param buffer - Pre-allocated buffer from createBrightnessBuffer
|
|
204
|
+
* @param pattern - Pattern type to generate
|
|
205
|
+
* @param time - Current time in seconds
|
|
206
|
+
* @param config - Pattern configuration
|
|
207
|
+
*/
|
|
208
|
+
export declare function fillBrightnessBuffer(buffer: BrightnessBuffer, pattern: PatternType, time?: number, config?: PatternConfig): void;
|
|
209
|
+
/**
|
|
210
|
+
* Get brightness value from buffer at (col, row)
|
|
211
|
+
* @param buffer - Brightness buffer
|
|
212
|
+
* @param col - Column index
|
|
213
|
+
* @param row - Row index
|
|
214
|
+
* @returns Brightness value 0-255
|
|
215
|
+
*/
|
|
216
|
+
export declare function getBufferValue(buffer: BrightnessBuffer, col: number, row: number): number;
|
|
100
217
|
//# sourceMappingURL=patterns.d.ts.map
|
package/dist/patterns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../src/patterns.ts"],"names":[],"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CAgFZ;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAyBlG;AAED,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,GACT,SAAS,CAAC;AAMd;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,IAAI,EAAE,UAAU,CAAC;IACjB,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAMnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,GAAE,MAAU,EAChB,MAAM,GAAE,aAAsC,GAC7C,IAAI,CA6EN;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzF"}
|
package/dist/renderer.d.ts
CHANGED
|
@@ -37,7 +37,15 @@ export declare class GossamerRenderer {
|
|
|
37
37
|
private animationId;
|
|
38
38
|
private lastFrameTime;
|
|
39
39
|
private isRunning;
|
|
40
|
+
private charAtlas;
|
|
41
|
+
private atlasCharacters;
|
|
40
42
|
constructor(canvas: HTMLCanvasElement, config?: Partial<Omit<RenderConfig, 'canvas'>>);
|
|
43
|
+
/**
|
|
44
|
+
* Build character texture atlas for fast rendering
|
|
45
|
+
* Pre-renders all characters to an offscreen canvas, then uses drawImage
|
|
46
|
+
* instead of fillText for 5-10x faster rendering
|
|
47
|
+
*/
|
|
48
|
+
private buildCharacterAtlas;
|
|
41
49
|
/**
|
|
42
50
|
* Set up the canvas with optimal rendering settings
|
|
43
51
|
*/
|
|
@@ -85,6 +93,25 @@ export declare class GossamerRenderer {
|
|
|
85
93
|
x: number;
|
|
86
94
|
y: number;
|
|
87
95
|
}>): void;
|
|
96
|
+
/**
|
|
97
|
+
* PERFORMANCE: Render from BrightnessBuffer using texture atlas
|
|
98
|
+
*
|
|
99
|
+
* Uses pre-rendered character sprites instead of fillText calls.
|
|
100
|
+
* 5-10x faster than renderFromBrightnessGrid for large canvases.
|
|
101
|
+
*
|
|
102
|
+
* @param buffer - BrightnessBuffer from fillBrightnessBuffer
|
|
103
|
+
*/
|
|
104
|
+
renderFromBuffer(buffer: {
|
|
105
|
+
data: Uint8Array;
|
|
106
|
+
cols: number;
|
|
107
|
+
rows: number;
|
|
108
|
+
}): void;
|
|
109
|
+
/**
|
|
110
|
+
* PERFORMANCE: Render brightness grid using atlas (legacy grid format)
|
|
111
|
+
*
|
|
112
|
+
* @param grid - 2D array of brightness values
|
|
113
|
+
*/
|
|
114
|
+
renderGridFast(grid: number[][]): void;
|
|
88
115
|
/**
|
|
89
116
|
* Calculate average brightness for a cell region
|
|
90
117
|
*/
|
package/dist/renderer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd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AO,CAAC,iBAAiB;IAyBzB;;OAEG;IACH,cAAc,CACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,SAAS,GAAG,MAAM,EAAE,EAAE,EACrE,GAAG,GAAE,MAAW,GACf,IAAI;IAgCP;;OAEG;IACH,aAAa,IAAI,IAAI;IAQrB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,KAAK,IAAI,IAAI;IAQb;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
package/dist/svelte/index.js
CHANGED
|
@@ -2838,7 +2838,7 @@ function GossamerClouds($$anchor, $$props) {
|
|
|
2838
2838
|
let isVisible = true;
|
|
2839
2839
|
let reducedMotion = false;
|
|
2840
2840
|
let animationId = null;
|
|
2841
|
-
const config = /* @__PURE__ */ user_derived(() =>
|
|
2841
|
+
const config = /* @__PURE__ */ user_derived(() => {
|
|
2842
2842
|
if ($$props.preset && PRESETS[$$props.preset]) {
|
|
2843
2843
|
const p = PRESETS[$$props.preset];
|
|
2844
2844
|
return {
|
|
@@ -2865,7 +2865,7 @@ function GossamerClouds($$anchor, $$props) {
|
|
|
2865
2865
|
if (!renderer || !get(shouldAnimate)) return;
|
|
2866
2866
|
const elapsed = (currentTime - startTime) / 1e3;
|
|
2867
2867
|
const { cols, rows } = renderer.getCellCount();
|
|
2868
|
-
const cfg = get(config)
|
|
2868
|
+
const cfg = get(config);
|
|
2869
2869
|
const grid = generateBrightnessGrid(cols, rows, cfg.pattern, elapsed, {
|
|
2870
2870
|
frequency: cfg.frequency,
|
|
2871
2871
|
amplitude: cfg.amplitude,
|
|
@@ -2888,13 +2888,13 @@ function GossamerClouds($$anchor, $$props) {
|
|
|
2888
2888
|
function renderStatic() {
|
|
2889
2889
|
if (!renderer) return;
|
|
2890
2890
|
const { cols, rows } = renderer.getCellCount();
|
|
2891
|
-
const cfg = get(config)
|
|
2891
|
+
const cfg = get(config);
|
|
2892
2892
|
const grid = generateBrightnessGrid(cols, rows, cfg.pattern, 0, { frequency: cfg.frequency, amplitude: cfg.amplitude, speed: 0 });
|
|
2893
2893
|
renderer.renderFromBrightnessGrid(grid);
|
|
2894
2894
|
}
|
|
2895
2895
|
function setupRenderer(width, height) {
|
|
2896
2896
|
if (!canvas) return;
|
|
2897
|
-
const cfg = get(config)
|
|
2897
|
+
const cfg = get(config);
|
|
2898
2898
|
if (renderer) {
|
|
2899
2899
|
renderer.destroy();
|
|
2900
2900
|
}
|
|
@@ -2949,7 +2949,7 @@ function GossamerClouds($$anchor, $$props) {
|
|
|
2949
2949
|
});
|
|
2950
2950
|
user_effect(() => {
|
|
2951
2951
|
if (renderer) {
|
|
2952
|
-
const cfg = get(config)
|
|
2952
|
+
const cfg = get(config);
|
|
2953
2953
|
renderer.updateConfig({
|
|
2954
2954
|
characters: cfg.characters,
|
|
2955
2955
|
color: color(),
|
|
@@ -2969,13 +2969,10 @@ function GossamerClouds($$anchor, $$props) {
|
|
|
2969
2969
|
var canvas_1 = child(div);
|
|
2970
2970
|
bind_this(canvas_1, ($$value) => canvas = $$value, () => canvas);
|
|
2971
2971
|
bind_this(div, ($$value) => container = $$value, () => container);
|
|
2972
|
-
template_effect(
|
|
2973
|
-
($
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
},
|
|
2977
|
-
[() => ({ opacity: get(config)().opacity })]
|
|
2978
|
-
);
|
|
2972
|
+
template_effect(() => {
|
|
2973
|
+
set_class(div, 1, `gossamer-clouds ${className() ?? ""}`, "svelte-sqd1fq");
|
|
2974
|
+
styles = set_style(div, "", styles, { opacity: get(config).opacity });
|
|
2975
|
+
});
|
|
2979
2976
|
append($$anchor, div);
|
|
2980
2977
|
pop();
|
|
2981
2978
|
}
|