brandbot 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.
@@ -0,0 +1,59 @@
1
+ import type * as THREE from 'three';
2
+ /** A CSS color string, e.g. "#13294b". */
3
+ export type Color = string;
4
+ /** Where the head watches the cursor. */
5
+ export type TrackPointer = 'window' | 'element' | false;
6
+ /** Options for the framework-agnostic engine, `createBrandbot`. */
7
+ export interface BrandbotOptions {
8
+ /** Parsed glTF JSON (e.g. `import model from 'brandbot/model'`). */
9
+ gltf?: unknown;
10
+ /** ...or a URL to a .gltf/.glb, used if `gltf` is not given. */
11
+ modelUrl?: string | null;
12
+ /** What the head watches. Default `'window'`. */
13
+ trackPointer?: TrackPointer;
14
+ /** Soft ground shadow. Default `true`. */
15
+ shadow?: boolean;
16
+ /** `false` shows the upper body only. Default `true`. */
17
+ legs?: boolean;
18
+ /** `true` lets visitors drag to rotate (for demos). Default `false`. */
19
+ orbit?: boolean;
20
+ /** One-time zoom-in when the model loads. Default `true`. */
21
+ intro?: boolean;
22
+ /** Camera framing. */
23
+ camera?: {
24
+ position: [number, number, number];
25
+ target: [number, number, number];
26
+ fov: number;
27
+ };
28
+ primary?: Color;
29
+ accent?: Color;
30
+ visor?: Color;
31
+ hands?: Color;
32
+ eyes?: Color;
33
+ logoText?: string;
34
+ logoColor?: Color;
35
+ /** Image logo: URL, data URI, or object URL. Overrides `logoText`. */
36
+ logoImage?: string | null;
37
+ }
38
+ /** Live updates accepted by `robot.set(...)`. */
39
+ export type BrandbotUpdate = Partial<Pick<BrandbotOptions, 'primary' | 'accent' | 'visor' | 'hands' | 'eyes' | 'logoText' | 'logoColor' | 'logoImage' | 'legs'>>;
40
+ /** The handle returned by `createBrandbot`. */
41
+ export interface BrandbotInstance {
42
+ /** Update colors / logo / legs live. */
43
+ set(update?: BrandbotUpdate): BrandbotInstance;
44
+ /** Do one full turn. */
45
+ spin(): void;
46
+ /** Replay the zoom-in intro. */
47
+ replay(): void;
48
+ /** Tear down: stops the loop, removes listeners, frees GPU resources. */
49
+ dispose(): void;
50
+ scene: THREE.Scene;
51
+ camera: THREE.PerspectiveCamera;
52
+ renderer: THREE.WebGLRenderer;
53
+ }
54
+ /** Imperative handle exposed via the React component's ref. */
55
+ export interface BrandBotHandle {
56
+ spin(): void;
57
+ replay(): void;
58
+ set(update?: BrandbotUpdate): void;
59
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "brandbot",
3
+ "version": "0.1.0",
4
+ "description": "🤖 A 3D robot mascot you brand with your own logo and colors — a drop-in React component with cursor tracking, built on Three.js.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
11
+ "./core": { "types": "./dist/robot-core.d.ts", "default": "./dist/robot-core.js" },
12
+ "./model": "./dist/nexbot-model.js"
13
+ },
14
+ "files": ["dist", "README.md", "LICENSE", "preview.png"],
15
+ "sideEffects": false,
16
+ "homepage": "https://aidan945.github.io/brandbot/demo/",
17
+ "repository": { "type": "git", "url": "https://github.com/Aidan945/brandbot.git" },
18
+ "bugs": { "url": "https://github.com/Aidan945/brandbot/issues" },
19
+ "author": "Aidan Zarski",
20
+ "scripts": {
21
+ "build": "tsc && cp src/nexbot-model.js dist/nexbot-model.js && cp src/nexbot-model.d.ts dist/nexbot-model.d.ts",
22
+ "typecheck": "tsc --noEmit",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "peerDependencies": {
26
+ "react": ">=17",
27
+ "three": ">=0.150.0"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "react": { "optional": true }
31
+ },
32
+ "devDependencies": {
33
+ "typescript": "^5.4.5",
34
+ "@types/react": "^18.3.3",
35
+ "@types/three": "^0.160.0"
36
+ },
37
+ "keywords": ["robot", "mascot", "3d", "threejs", "react", "hero", "brand", "logo", "cursor", "spline", "typescript"],
38
+ "license": "MIT"
39
+ }
package/preview.png ADDED
Binary file