@georgepxto/dot-field 0.0.0-stage → 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 georgepxto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,128 @@
1
- # Temporary Holding Version
1
+ # `<dot-field>`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A dependency-free web component that draws a grid of dots on a canvas. Around the pointer the dots grow and light up, fading out smoothly with distance, and with no pointer around they ripple gently. Works in any stack: plain HTML, React, Vue, Svelte, Astro, Rails templates.
4
+
5
+ <picture>
6
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/georgepxto/web-components/main/dot-field/screenshots/dark.png">
7
+ <img alt="A grid of faint dots behind a headline, with the dots near the pointer larger and green" src="https://raw.githubusercontent.com/georgepxto/web-components/main/dot-field/screenshots/light.png" width="880">
8
+ </picture>
9
+
10
+ - No runtime dependencies, Shadow DOM, Canvas 2D (no WebGL), under 4 kB gzipped
11
+ - Sharp on high-density screens and resized automatically with `ResizeObserver`
12
+ - Stops drawing when it scrolls out of view or the tab is hidden
13
+ - Respects `prefers-reduced-motion`: the grid is drawn still and only redraws when the pointer moves
14
+ - Light and dark defaults, any color through CSS custom properties
15
+
16
+ <!-- TODO: add a GIF of the pointer moving across the field (screenshots/pointer.gif) -->
17
+
18
+ ## Install
19
+
20
+ ```sh
21
+ npm install @georgepxto/dot-field
22
+ ```
23
+
24
+ ```js
25
+ import '@georgepxto/dot-field';
26
+ ```
27
+
28
+ Or load it from a CDN with no build step:
29
+
30
+ ```html
31
+ <script type="module" src="https://cdn.jsdelivr.net/gh/georgepxto/web-components@main/dot-field/dist/index.js"></script>
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ Give the field a size and put your content inside it. The canvas fills the element and the content sits on top:
37
+
38
+ ```html
39
+ <dot-field style="min-height: 420px">
40
+ <h1>Hello</h1>
41
+ </dot-field>
42
+ ```
43
+
44
+ Or lay it behind existing content as a background. With `track="parent"` it keeps reacting while the pointer is over the content in front of it:
45
+
46
+ ```html
47
+ <section class="hero">
48
+ <dot-field track="parent"></dot-field>
49
+ <h1>Hello</h1>
50
+ </section>
51
+
52
+ <style>
53
+ .hero {
54
+ position: relative;
55
+ }
56
+
57
+ .hero dot-field {
58
+ position: absolute;
59
+ inset: 0;
60
+ }
61
+
62
+ .hero h1 {
63
+ position: relative;
64
+ }
65
+ </style>
66
+ ```
67
+
68
+ The canvas has `pointer-events: none`, so it never blocks clicks. The pointer is followed at the document level, which is why the field still reacts when other elements cover it.
69
+
70
+ ## API
71
+
72
+ ### Attributes
73
+
74
+ | Attribute | Default | Description |
75
+ | --- | --- | --- |
76
+ | `gap` | `24` | Distance between dots, in pixels |
77
+ | `radius` | `140` | Radius of the pointer's influence, in pixels |
78
+ | `dot-size` | `1` | Radius of a dot at rest, in pixels |
79
+ | `grow` | `3.5` | How many times larger a dot gets at the centre of the influence |
80
+ | `track` | `host` | `parent` reacts while the pointer is over the parent element instead of the field itself |
81
+ | `theme` | `auto` | `light`, `dark` or `auto` (follows `prefers-color-scheme`) |
82
+
83
+ ## Theming
84
+
85
+ | Property | Default (light / dark) | Description |
86
+ | --- | --- | --- |
87
+ | `--dot-color` | `rgba(13, 19, 16, 0.18)` / `rgba(233, 238, 234, 0.16)` | Color of the dots at rest |
88
+ | `--dot-active-color` | `#1d8049` / `#43c97e` | Color near the pointer, drawn from 30% to 100% opacity as the pointer gets closer |
89
+
90
+ Any CSS color works, including `color-mix()` and custom properties from your page:
91
+
92
+ ```css
93
+ dot-field {
94
+ --dot-color: color-mix(in oklab, currentColor 14%, transparent);
95
+ --dot-active-color: var(--accent);
96
+ }
97
+ ```
98
+
99
+ If your site switches themes with an attribute, for example with [`<pull-cord>`](../pull-cord), set the colors per theme:
100
+
101
+ ```css
102
+ :root[data-theme='light'] dot-field {
103
+ --dot-color: rgba(13, 19, 16, 0.18);
104
+ }
105
+ ```
106
+
107
+ The canvas is exposed as `::part(canvas)` and the content wrapper as `::part(content)`.
108
+
109
+ ## Accessibility
110
+
111
+ The canvas is decorative and hidden from assistive technology with `aria-hidden`. Content placed inside the field stays in the normal reading order. With `prefers-reduced-motion: reduce` the idle ripple is off and nothing animates on its own; the dots near the pointer still change, without easing.
112
+
113
+ ## Browser support
114
+
115
+ All current browsers. The component uses custom elements, Shadow DOM, Canvas 2D, `ResizeObserver` and `IntersectionObserver`.
116
+
117
+ ## Development
118
+
119
+ ```sh
120
+ npm install
121
+ npm test
122
+ ```
123
+
124
+ `npm test` builds `dist/` and runs the unit tests. To try the demo, serve the package folder over HTTP and open `/demo/`.
125
+
126
+ ## License
127
+
128
+ MIT
@@ -0,0 +1,16 @@
1
+ export type Track = 'host' | 'parent';
2
+ declare const Base: typeof HTMLElement;
3
+ export declare class DotField extends Base {
4
+ #private;
5
+ static observedAttributes: string[];
6
+ constructor();
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ attributeChangedCallback(name: string, previous: string | null, value: string | null): void;
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ 'dot-field': DotField;
14
+ }
15
+ }
16
+ export {};
@@ -0,0 +1,264 @@
1
+ import { activeAlpha, defaults, dotRadius, grid, influence, readNumber } from './field.js';
2
+ import { styles } from './styles.js';
3
+ const TAG = 'dot-field';
4
+ const TAU = Math.PI * 2;
5
+ const WAVE_AMPLITUDE = 0.4;
6
+ const WAVE_SPEED = 0.0016;
7
+ const FOLLOW = 0.2;
8
+ const MAX_RATIO = 2;
9
+ const Base = (typeof HTMLElement === 'undefined' ? class {
10
+ } : HTMLElement);
11
+ let sharedSheet;
12
+ const adoptStyles = (shadow) => {
13
+ try {
14
+ if (!sharedSheet) {
15
+ sharedSheet = new CSSStyleSheet();
16
+ sharedSheet.replaceSync(styles);
17
+ }
18
+ shadow.adoptedStyleSheets = [sharedSheet];
19
+ }
20
+ catch {
21
+ const style = document.createElement('style');
22
+ style.textContent = styles;
23
+ shadow.append(style);
24
+ }
25
+ };
26
+ const inside = (point, rect) => point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom;
27
+ export class DotField extends Base {
28
+ static observedAttributes = ['gap', 'radius', 'dot-size', 'grow', 'track', 'theme'];
29
+ #canvas;
30
+ #context;
31
+ #dotProbe;
32
+ #activeProbe;
33
+ #options = { ...defaults };
34
+ #controller;
35
+ #resizeObserver;
36
+ #themeObserver;
37
+ #intersectionObserver;
38
+ #reducedMotion;
39
+ #width = 0;
40
+ #height = 0;
41
+ #ratio = 1;
42
+ #visible = false;
43
+ #frame = 0;
44
+ #pending = 0;
45
+ #pointer = null;
46
+ #focus = null;
47
+ #strength = 0;
48
+ constructor() {
49
+ super();
50
+ const shadow = this.attachShadow({ mode: 'open' });
51
+ adoptStyles(shadow);
52
+ this.#canvas = document.createElement('canvas');
53
+ this.#canvas.setAttribute('part', 'canvas');
54
+ this.#canvas.setAttribute('aria-hidden', 'true');
55
+ this.#context = this.#canvas.getContext('2d');
56
+ this.#dotProbe = document.createElement('span');
57
+ this.#dotProbe.className = 'probe probe-dot';
58
+ this.#activeProbe = document.createElement('span');
59
+ this.#activeProbe.className = 'probe probe-active';
60
+ const content = document.createElement('div');
61
+ content.className = 'content';
62
+ content.setAttribute('part', 'content');
63
+ content.append(document.createElement('slot'));
64
+ shadow.append(this.#canvas, content, this.#dotProbe, this.#activeProbe);
65
+ }
66
+ connectedCallback() {
67
+ this.#readOptions();
68
+ this.#controller?.abort();
69
+ this.#controller = new AbortController();
70
+ const { signal } = this.#controller;
71
+ this.#reducedMotion = matchMedia('(prefers-reduced-motion: reduce)');
72
+ this.#reducedMotion.addEventListener('change', () => this.#refresh(), { signal });
73
+ matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => this.#wake(), { signal });
74
+ this.#themeObserver = new MutationObserver(() => this.#wake());
75
+ this.#themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style', 'data-theme'] });
76
+ const track = (event) => {
77
+ this.#pointer = { x: event.clientX, y: event.clientY };
78
+ this.#wake();
79
+ };
80
+ const release = (event) => {
81
+ if (event.pointerType === 'mouse')
82
+ return;
83
+ this.#pointer = null;
84
+ this.#wake();
85
+ };
86
+ const clear = () => {
87
+ this.#pointer = null;
88
+ this.#wake();
89
+ };
90
+ document.addEventListener('pointermove', track, { passive: true, signal });
91
+ document.addEventListener('pointerdown', track, { passive: true, signal });
92
+ document.addEventListener('pointerup', release, { passive: true, signal });
93
+ document.addEventListener('pointercancel', clear, { passive: true, signal });
94
+ document.documentElement.addEventListener('pointerleave', clear, { passive: true, signal });
95
+ window.addEventListener('blur', clear, { signal });
96
+ window.addEventListener('scroll', () => this.#wake(), { passive: true, signal });
97
+ document.addEventListener('visibilitychange', () => this.#refresh(), { signal });
98
+ this.#resizeObserver = new ResizeObserver(() => {
99
+ this.#resize();
100
+ this.#refresh();
101
+ });
102
+ this.#resizeObserver.observe(this);
103
+ if ('IntersectionObserver' in window) {
104
+ this.#intersectionObserver = new IntersectionObserver((entries) => {
105
+ this.#visible = entries.some((entry) => entry.isIntersecting);
106
+ this.#refresh();
107
+ });
108
+ this.#intersectionObserver.observe(this);
109
+ }
110
+ else {
111
+ this.#visible = true;
112
+ }
113
+ this.#resize();
114
+ this.#refresh();
115
+ }
116
+ disconnectedCallback() {
117
+ this.#controller?.abort();
118
+ this.#controller = undefined;
119
+ this.#resizeObserver?.disconnect();
120
+ this.#resizeObserver = undefined;
121
+ this.#themeObserver?.disconnect();
122
+ this.#themeObserver = undefined;
123
+ this.#intersectionObserver?.disconnect();
124
+ this.#intersectionObserver = undefined;
125
+ cancelAnimationFrame(this.#frame);
126
+ cancelAnimationFrame(this.#pending);
127
+ this.#frame = 0;
128
+ this.#pending = 0;
129
+ this.#visible = false;
130
+ this.#pointer = null;
131
+ this.#focus = null;
132
+ this.#strength = 0;
133
+ }
134
+ attributeChangedCallback(name, previous, value) {
135
+ if (previous === value)
136
+ return;
137
+ if (name !== 'theme' && name !== 'track')
138
+ this.#readOptions();
139
+ if (this.isConnected)
140
+ this.#refresh();
141
+ }
142
+ #readOptions() {
143
+ this.#options = {
144
+ gap: readNumber(this.getAttribute('gap'), defaults.gap, 4, 400),
145
+ radius: readNumber(this.getAttribute('radius'), defaults.radius, 0, 4000),
146
+ dotSize: readNumber(this.getAttribute('dot-size'), defaults.dotSize, 0.1, 100),
147
+ grow: readNumber(this.getAttribute('grow'), defaults.grow, 0, 100),
148
+ };
149
+ }
150
+ #reduced() {
151
+ return this.#reducedMotion?.matches ?? false;
152
+ }
153
+ #animating() {
154
+ return this.isConnected && this.#visible && document.visibilityState !== 'hidden' && !this.#reduced();
155
+ }
156
+ #area() {
157
+ if (this.getAttribute('track') !== 'parent')
158
+ return this;
159
+ const parent = this.parentElement ?? (this.parentNode instanceof ShadowRoot ? this.parentNode.host : null);
160
+ return parent ?? this;
161
+ }
162
+ #resize() {
163
+ const width = this.clientWidth;
164
+ const height = this.clientHeight;
165
+ const ratio = Math.min(MAX_RATIO, Math.max(1, window.devicePixelRatio || 1));
166
+ if (width === this.#width && height === this.#height && ratio === this.#ratio)
167
+ return;
168
+ this.#width = width;
169
+ this.#height = height;
170
+ this.#ratio = ratio;
171
+ this.#canvas.width = Math.round(width * ratio);
172
+ this.#canvas.height = Math.round(height * ratio);
173
+ }
174
+ #refresh() {
175
+ if (this.#animating()) {
176
+ if (!this.#frame)
177
+ this.#frame = requestAnimationFrame(this.#loop);
178
+ return;
179
+ }
180
+ cancelAnimationFrame(this.#frame);
181
+ this.#frame = 0;
182
+ this.#drawOnce();
183
+ }
184
+ #wake() {
185
+ if (!this.#animating())
186
+ this.#drawOnce();
187
+ }
188
+ #drawOnce() {
189
+ if (this.#pending || !this.isConnected || !this.#visible || document.visibilityState === 'hidden')
190
+ return;
191
+ this.#pending = requestAnimationFrame((time) => {
192
+ this.#pending = 0;
193
+ this.#draw(time, true);
194
+ });
195
+ }
196
+ #loop = (time) => {
197
+ this.#frame = 0;
198
+ if (!this.#animating())
199
+ return;
200
+ this.#draw(time, false);
201
+ this.#frame = requestAnimationFrame(this.#loop);
202
+ };
203
+ #draw(time, still) {
204
+ const context = this.#context;
205
+ const width = this.#width;
206
+ const height = this.#height;
207
+ if (!context || !width || !height)
208
+ return;
209
+ const rect = this.getBoundingClientRect();
210
+ const area = this.#area();
211
+ const pointer = this.#pointer;
212
+ const hovering = pointer !== null && inside(pointer, area === this ? rect : area.getBoundingClientRect());
213
+ if (hovering)
214
+ this.#focus = { x: pointer.x - rect.left, y: pointer.y - rect.top };
215
+ const target = hovering ? 1 : 0;
216
+ this.#strength = still ? target : this.#strength + (target - this.#strength) * FOLLOW;
217
+ if (this.#strength < 0.002 && !hovering) {
218
+ this.#strength = 0;
219
+ this.#focus = null;
220
+ }
221
+ const { gap, radius, dotSize, grow } = this.#options;
222
+ const strength = this.#strength;
223
+ const focus = this.#focus;
224
+ const layout = grid(width, height, gap);
225
+ const wave = still ? 0 : WAVE_AMPLITUDE * (1 - strength);
226
+ const phase = time * WAVE_SPEED;
227
+ const active = [];
228
+ context.setTransform(this.#ratio, 0, 0, this.#ratio, 0, 0);
229
+ context.clearRect(0, 0, width, height);
230
+ context.beginPath();
231
+ for (let row = 0; row < layout.rows; row++) {
232
+ const baseY = layout.y + row * gap;
233
+ for (let column = 0; column < layout.columns; column++) {
234
+ const x = layout.x + column * gap;
235
+ const y = wave ? baseY + wave * Math.sin(phase + x * 0.045 + baseY * 0.03) : baseY;
236
+ let power = 0;
237
+ if (focus && strength > 0)
238
+ power = influence(Math.hypot(x - focus.x, y - focus.y), radius) * strength;
239
+ const size = dotRadius(dotSize, grow, power);
240
+ context.moveTo(x + size, y);
241
+ context.arc(x, y, size, 0, TAU);
242
+ if (power > 0.002)
243
+ active.push({ x, y, radius: size, strength: power });
244
+ }
245
+ }
246
+ context.fillStyle = getComputedStyle(this.#dotProbe).color;
247
+ context.fill();
248
+ if (active.length) {
249
+ context.fillStyle = getComputedStyle(this.#activeProbe).color;
250
+ for (const dot of active) {
251
+ context.globalAlpha = activeAlpha(dot.strength);
252
+ context.beginPath();
253
+ context.arc(dot.x, dot.y, dot.radius, 0, TAU);
254
+ context.fill();
255
+ }
256
+ context.globalAlpha = 1;
257
+ }
258
+ if (still && strength === 0)
259
+ this.#focus = null;
260
+ }
261
+ }
262
+ if (typeof customElements !== 'undefined' && !customElements.get(TAG)) {
263
+ customElements.define(TAG, DotField);
264
+ }
@@ -0,0 +1,18 @@
1
+ export interface FieldOptions {
2
+ gap: number;
3
+ radius: number;
4
+ dotSize: number;
5
+ grow: number;
6
+ }
7
+ export interface Grid {
8
+ columns: number;
9
+ rows: number;
10
+ x: number;
11
+ y: number;
12
+ }
13
+ export declare const defaults: FieldOptions;
14
+ export declare const readNumber: (value: string | null | undefined, fallback: number, min: number, max: number) => number;
15
+ export declare const grid: (width: number, height: number, gap: number) => Grid;
16
+ export declare const influence: (distance: number, radius: number) => number;
17
+ export declare const dotRadius: (size: number, grow: number, strength: number) => number;
18
+ export declare const activeAlpha: (strength: number) => number;
package/dist/field.js ADDED
@@ -0,0 +1,32 @@
1
+ export const defaults = {
2
+ gap: 24,
3
+ radius: 140,
4
+ dotSize: 1,
5
+ grow: 3.5,
6
+ };
7
+ export const readNumber = (value, fallback, min, max) => {
8
+ if (value === null || value === undefined || value.trim() === '')
9
+ return fallback;
10
+ const number = Number(value);
11
+ return Number.isFinite(number) ? Math.min(max, Math.max(min, number)) : fallback;
12
+ };
13
+ export const grid = (width, height, gap) => {
14
+ if (width <= 0 || height <= 0 || gap <= 0)
15
+ return { columns: 0, rows: 0, x: 0, y: 0 };
16
+ const columns = Math.floor(width / gap) + 1;
17
+ const rows = Math.floor(height / gap) + 1;
18
+ return {
19
+ columns,
20
+ rows,
21
+ x: (width - (columns - 1) * gap) / 2,
22
+ y: (height - (rows - 1) * gap) / 2,
23
+ };
24
+ };
25
+ export const influence = (distance, radius) => {
26
+ if (radius <= 0 || distance >= radius)
27
+ return 0;
28
+ const t = 1 - Math.max(0, distance) / radius;
29
+ return t * t * (3 - 2 * t);
30
+ };
31
+ export const dotRadius = (size, grow, strength) => size * (1 + (grow - 1) * strength);
32
+ export const activeAlpha = (strength) => 0.3 + 0.7 * Math.min(1, Math.max(0, strength));
@@ -0,0 +1,2 @@
1
+ export { DotField, type Track } from './dot-field.js';
2
+ export { activeAlpha, defaults, dotRadius, grid, influence, readNumber, type FieldOptions, type Grid } from './field.js';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { DotField } from './dot-field.js';
2
+ export { activeAlpha, defaults, dotRadius, grid, influence, readNumber } from './field.js';
@@ -0,0 +1 @@
1
+ export declare const styles = "\n :host {\n \n --_dot: var(--dot-color, rgba(13, 19, 16, 0.18));\n --_active: var(--dot-active-color, #1d8049);\n\n position: relative;\n display: block;\n }\n\n :host([theme='dark']) {\n \n --_dot: var(--dot-color, rgba(233, 238, 234, 0.16));\n --_active: var(--dot-active-color, #43c97e);\n\n }\n\n @media (prefers-color-scheme: dark) {\n :host(:not([theme='light'])) {\n \n --_dot: var(--dot-color, rgba(233, 238, 234, 0.16));\n --_active: var(--dot-active-color, #43c97e);\n\n }\n }\n\n :host([hidden]) {\n display: none;\n }\n\n canvas {\n position: absolute;\n inset: 0;\n display: block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n\n .content {\n position: relative;\n }\n\n .probe {\n display: none;\n }\n\n .probe-dot {\n color: var(--_dot);\n }\n\n .probe-active {\n color: var(--_active);\n }\n";
package/dist/styles.js ADDED
@@ -0,0 +1,54 @@
1
+ const light = `
2
+ --_dot: var(--dot-color, rgba(13, 19, 16, 0.18));
3
+ --_active: var(--dot-active-color, #1d8049);
4
+ `;
5
+ const dark = `
6
+ --_dot: var(--dot-color, rgba(233, 238, 234, 0.16));
7
+ --_active: var(--dot-active-color, #43c97e);
8
+ `;
9
+ export const styles = `
10
+ :host {
11
+ ${light}
12
+ position: relative;
13
+ display: block;
14
+ }
15
+
16
+ :host([theme='dark']) {
17
+ ${dark}
18
+ }
19
+
20
+ @media (prefers-color-scheme: dark) {
21
+ :host(:not([theme='light'])) {
22
+ ${dark}
23
+ }
24
+ }
25
+
26
+ :host([hidden]) {
27
+ display: none;
28
+ }
29
+
30
+ canvas {
31
+ position: absolute;
32
+ inset: 0;
33
+ display: block;
34
+ width: 100%;
35
+ height: 100%;
36
+ pointer-events: none;
37
+ }
38
+
39
+ .content {
40
+ position: relative;
41
+ }
42
+
43
+ .probe {
44
+ display: none;
45
+ }
46
+
47
+ .probe-dot {
48
+ color: var(--_dot);
49
+ }
50
+
51
+ .probe-active {
52
+ color: var(--_active);
53
+ }
54
+ `;
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@georgepxto/dot-field",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "A dependency-free <dot-field> web component: a canvas dot grid that grows and lights up around the pointer, with a gentle idle ripple.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "georgepxto",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/georgepxto/web-components.git",
11
+ "directory": "dot-field"
12
+ },
13
+ "keywords": [
14
+ "web-component",
15
+ "custom-element",
16
+ "canvas",
17
+ "background",
18
+ "dot-grid",
19
+ "pointer"
20
+ ],
21
+ "main": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "sideEffects": [
33
+ "./dist/index.js",
34
+ "./dist/dot-field.js"
35
+ ],
36
+ "scripts": {
37
+ "build": "tsc -p tsconfig.json",
38
+ "test": "npm run build && node --test test/*.test.js",
39
+ "prepublishOnly": "npm test"
40
+ },
41
+ "devDependencies": {
42
+ "typescript": "^7.0.2"
43
+ }
44
+ }