@autumnsgrove/gossamer 0.1.0 → 0.2.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/LICENSE +21 -0
- package/dist/animation.js +165 -0
- package/dist/animation.test.js +204 -0
- package/dist/characters.d.ts.map +1 -1
- package/dist/characters.js +176 -0
- package/dist/characters.test.js +115 -0
- package/dist/colors.d.ts +312 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +199 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -1308
- package/dist/index.test.js +92 -0
- package/dist/patterns.d.ts +119 -2
- package/dist/patterns.d.ts.map +1 -1
- package/dist/patterns.js +539 -0
- package/dist/patterns.test.js +223 -0
- package/dist/renderer.d.ts +27 -0
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +362 -0
- package/dist/svelte/GossamerBorder.svelte.d.ts +56 -1
- package/dist/svelte/GossamerBorder.svelte.d.ts.map +1 -0
- package/{src → dist}/svelte/GossamerClouds.svelte +6 -6
- package/dist/svelte/GossamerClouds.svelte.d.ts +31 -1
- package/dist/svelte/GossamerClouds.svelte.d.ts.map +1 -0
- package/dist/svelte/GossamerImage.svelte.d.ts +28 -1
- package/dist/svelte/GossamerImage.svelte.d.ts.map +1 -0
- package/dist/svelte/GossamerOverlay.svelte.d.ts +32 -1
- package/dist/svelte/GossamerOverlay.svelte.d.ts.map +1 -0
- package/dist/svelte/GossamerText.svelte.d.ts +29 -1
- package/dist/svelte/GossamerText.svelte.d.ts.map +1 -0
- package/dist/svelte/index.js +31 -3649
- package/dist/svelte/presets.d.ts +4 -2
- package/dist/svelte/presets.js +161 -0
- package/dist/utils/canvas.js +139 -0
- package/dist/utils/image.js +195 -0
- package/dist/utils/performance.js +205 -0
- package/package.json +20 -15
- package/dist/index.js.map +0 -1
- package/dist/style.css +0 -124
- package/dist/svelte/index.js.map +0 -1
- package/src/animation.test.ts +0 -254
- package/src/animation.ts +0 -243
- package/src/characters.test.ts +0 -148
- package/src/characters.ts +0 -164
- package/src/index.test.ts +0 -115
- package/src/index.ts +0 -203
- package/src/patterns.test.ts +0 -273
- package/src/patterns.ts +0 -316
- package/src/renderer.ts +0 -309
- package/src/svelte/index.ts +0 -75
- package/src/svelte/presets.ts +0 -174
- package/src/utils/canvas.ts +0 -210
- package/src/utils/image.ts +0 -275
- package/src/utils/performance.ts +0 -282
- /package/{src → dist}/svelte/GossamerBorder.svelte +0 -0
- /package/{src → dist}/svelte/GossamerImage.svelte +0 -0
- /package/{src → dist}/svelte/GossamerOverlay.svelte +0 -0
- /package/{src → dist}/svelte/GossamerText.svelte +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GossamerBorder.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/GossamerBorder.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExF,MAAM,WAAW,mBAAmB;IAClC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qDAAqD;IACrD,UAAU,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,KA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AC,OAAO,cAAc,CAAC,CAAC;AAC5D,eAAe,cAAc,CAAC"}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
let animationId: number | null = null;
|
|
68
68
|
|
|
69
69
|
// Apply preset if specified
|
|
70
|
-
const config = $derived(() => {
|
|
70
|
+
const config = $derived.by(() => {
|
|
71
71
|
if (preset && PRESETS[preset]) {
|
|
72
72
|
const p = PRESETS[preset];
|
|
73
73
|
return {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
|
|
94
94
|
const elapsed = (currentTime - startTime) / 1000;
|
|
95
95
|
const { cols, rows } = renderer.getCellCount();
|
|
96
|
-
const cfg = config
|
|
96
|
+
const cfg = config;
|
|
97
97
|
|
|
98
98
|
const grid = generateBrightnessGrid(
|
|
99
99
|
cols,
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
if (!renderer) return;
|
|
129
129
|
|
|
130
130
|
const { cols, rows } = renderer.getCellCount();
|
|
131
|
-
const cfg = config
|
|
131
|
+
const cfg = config;
|
|
132
132
|
|
|
133
133
|
const grid = generateBrightnessGrid(
|
|
134
134
|
cols,
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
function setupRenderer(width: number, height: number): void {
|
|
149
149
|
if (!canvas) return;
|
|
150
150
|
|
|
151
|
-
const cfg = config
|
|
151
|
+
const cfg = config;
|
|
152
152
|
|
|
153
153
|
// Create or update renderer
|
|
154
154
|
if (renderer) {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
// React to prop changes
|
|
221
221
|
$effect(() => {
|
|
222
222
|
if (renderer) {
|
|
223
|
-
const cfg = config
|
|
223
|
+
const cfg = config;
|
|
224
224
|
renderer.updateConfig({
|
|
225
225
|
characters: cfg.characters,
|
|
226
226
|
color,
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
<div
|
|
242
242
|
bind:this={container}
|
|
243
243
|
class="gossamer-clouds {className}"
|
|
244
|
-
style:opacity={config
|
|
244
|
+
style:opacity={config.opacity}
|
|
245
245
|
>
|
|
246
246
|
<canvas
|
|
247
247
|
bind:this={canvas}
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PatternType } from '../index';
|
|
2
|
+
export interface GossamerCloudsProps {
|
|
3
|
+
/** Pattern type for generation */
|
|
4
|
+
pattern?: PatternType;
|
|
5
|
+
/** Character set (light to dark) */
|
|
6
|
+
characters?: string;
|
|
7
|
+
/** Foreground color */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Overall opacity (0-1) */
|
|
10
|
+
opacity?: number;
|
|
11
|
+
/** Enable animation */
|
|
12
|
+
animated?: boolean;
|
|
13
|
+
/** Animation speed multiplier */
|
|
14
|
+
speed?: number;
|
|
15
|
+
/** Pattern frequency (scale) */
|
|
16
|
+
frequency?: number;
|
|
17
|
+
/** Pattern amplitude (intensity) */
|
|
18
|
+
amplitude?: number;
|
|
19
|
+
/** Cell size in pixels */
|
|
20
|
+
cellSize?: number;
|
|
21
|
+
/** Target FPS for animation */
|
|
22
|
+
fps?: number;
|
|
23
|
+
/** Use a preset configuration */
|
|
24
|
+
preset?: string;
|
|
25
|
+
/** Additional CSS class */
|
|
26
|
+
class?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const GossamerClouds: import("svelte").Component<GossamerCloudsProps, {}, "">;
|
|
29
|
+
type GossamerClouds = ReturnType<typeof GossamerClouds>;
|
|
30
|
+
export default GossamerClouds;
|
|
31
|
+
//# sourceMappingURL=GossamerClouds.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GossamerClouds.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/GossamerClouds.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkOH,QAAA,MAAM,cAAc,yDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface GossamerImageProps {
|
|
2
|
+
/** Image source URL */
|
|
3
|
+
src: string;
|
|
4
|
+
/** Alt text for accessibility */
|
|
5
|
+
alt: string;
|
|
6
|
+
/** Character set (light to dark) */
|
|
7
|
+
characters?: string;
|
|
8
|
+
/** Cell size for ASCII detail level */
|
|
9
|
+
cellSize?: number;
|
|
10
|
+
/** Single color or 'preserve' to keep image colors */
|
|
11
|
+
color?: string | 'preserve';
|
|
12
|
+
/** Invert brightness mapping */
|
|
13
|
+
invert?: boolean;
|
|
14
|
+
/** Output width in pixels */
|
|
15
|
+
width?: number;
|
|
16
|
+
/** Output height in pixels */
|
|
17
|
+
height?: number;
|
|
18
|
+
/** Show original image on hover */
|
|
19
|
+
showOriginalOnHover?: boolean;
|
|
20
|
+
/** Hover transition duration in ms */
|
|
21
|
+
transitionDuration?: number;
|
|
22
|
+
/** Additional CSS class */
|
|
23
|
+
class?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const GossamerImage: import("svelte").Component<GossamerImageProps, {}, "">;
|
|
26
|
+
type GossamerImage = ReturnType<typeof GossamerImage>;
|
|
27
|
+
export default GossamerImage;
|
|
28
|
+
//# sourceMappingURL=GossamerImage.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GossamerImage.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/GossamerImage.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,WAAW,kBAAkB;IACjC,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sCAAsC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA4KH,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PatternType } from '../index';
|
|
2
|
+
export type BlendMode = 'normal' | 'multiply' | 'screen' | 'overlay' | 'soft-light' | 'hard-light' | 'difference';
|
|
3
|
+
export interface GossamerOverlayProps {
|
|
4
|
+
/** Pattern type */
|
|
5
|
+
pattern?: PatternType;
|
|
6
|
+
/** Character set (light to dark) */
|
|
7
|
+
characters?: string;
|
|
8
|
+
/** Foreground color */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** Overall opacity (0-1) */
|
|
11
|
+
opacity?: number;
|
|
12
|
+
/** CSS blend mode */
|
|
13
|
+
blendMode?: BlendMode;
|
|
14
|
+
/** Enable animation */
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
/** Animation speed */
|
|
17
|
+
speed?: number;
|
|
18
|
+
/** Pattern frequency */
|
|
19
|
+
frequency?: number;
|
|
20
|
+
/** Pattern amplitude */
|
|
21
|
+
amplitude?: number;
|
|
22
|
+
/** Cell size in pixels */
|
|
23
|
+
cellSize?: number;
|
|
24
|
+
/** Target FPS */
|
|
25
|
+
fps?: number;
|
|
26
|
+
/** Additional CSS class */
|
|
27
|
+
class?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const GossamerOverlay: import("svelte").Component<GossamerOverlayProps, {}, "">;
|
|
30
|
+
type GossamerOverlay = ReturnType<typeof GossamerOverlay>;
|
|
31
|
+
export default GossamerOverlay;
|
|
32
|
+
//# sourceMappingURL=GossamerOverlay.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GossamerOverlay.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/GossamerOverlay.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAElH,MAAM,WAAW,oBAAoB;IACnC,mBAAmB;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyLH,QAAA,MAAM,eAAe,0DAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PatternType } from '../index';
|
|
2
|
+
export interface GossamerTextProps {
|
|
3
|
+
/** Text content to display */
|
|
4
|
+
text: string;
|
|
5
|
+
/** Character set for effect (light to dark) */
|
|
6
|
+
characters?: string;
|
|
7
|
+
/** Text color */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Font size in pixels */
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
/** Font family */
|
|
12
|
+
fontFamily?: string;
|
|
13
|
+
/** Enable animation effect */
|
|
14
|
+
animated?: boolean;
|
|
15
|
+
/** Animation pattern */
|
|
16
|
+
pattern?: PatternType;
|
|
17
|
+
/** Animation speed */
|
|
18
|
+
speed?: number;
|
|
19
|
+
/** Effect intensity */
|
|
20
|
+
intensity?: number;
|
|
21
|
+
/** Target FPS */
|
|
22
|
+
fps?: number;
|
|
23
|
+
/** Additional CSS class */
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
26
|
+
declare const GossamerText: import("svelte").Component<GossamerTextProps, {}, "">;
|
|
27
|
+
type GossamerText = ReturnType<typeof GossamerText>;
|
|
28
|
+
export default GossamerText;
|
|
29
|
+
//# sourceMappingURL=GossamerText.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GossamerText.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/GossamerText.svelte.ts"],"names":[],"mappings":"AAGE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA+LH,QAAA,MAAM,YAAY,uDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|