@ranjeet_/digital-pet 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 +17 -0
- package/README.md +283 -0
- package/assets/README.md +10 -0
- package/assets/bark-cute.mp3 +0 -0
- package/dist/index.d.ts +150 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30387 -0
- package/dist/index.js.map +7 -0
- package/dist/three-renderer.d.ts +54 -0
- package/dist/three-renderer.d.ts.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface ThreePetFrame {
|
|
2
|
+
behavior: string;
|
|
3
|
+
progress: number;
|
|
4
|
+
time: number;
|
|
5
|
+
facing: number;
|
|
6
|
+
ballColor: string;
|
|
7
|
+
reducedMotion: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class ThreePetRenderer {
|
|
10
|
+
private readonly renderer;
|
|
11
|
+
private readonly scene;
|
|
12
|
+
private readonly camera;
|
|
13
|
+
private readonly root;
|
|
14
|
+
private readonly body;
|
|
15
|
+
private readonly head;
|
|
16
|
+
private readonly muzzle;
|
|
17
|
+
private readonly tongue;
|
|
18
|
+
private readonly tail;
|
|
19
|
+
private readonly tailJoints;
|
|
20
|
+
private readonly hairBatches;
|
|
21
|
+
private readonly furPatches;
|
|
22
|
+
private readonly ears;
|
|
23
|
+
private readonly legs;
|
|
24
|
+
private readonly balls;
|
|
25
|
+
private readonly fetchBall;
|
|
26
|
+
private readonly foodBowl;
|
|
27
|
+
private readonly treat;
|
|
28
|
+
private readonly golden;
|
|
29
|
+
private readonly lightGolden;
|
|
30
|
+
private readonly cream;
|
|
31
|
+
private readonly darkGolden;
|
|
32
|
+
private readonly black;
|
|
33
|
+
constructor(canvas: HTMLCanvasElement);
|
|
34
|
+
render(frame: ThreePetFrame): void;
|
|
35
|
+
resize(): void;
|
|
36
|
+
dispose(): void;
|
|
37
|
+
private buildBody;
|
|
38
|
+
private buildFur;
|
|
39
|
+
private buildHead;
|
|
40
|
+
private buildMouth;
|
|
41
|
+
private buildLeg;
|
|
42
|
+
private buildTail;
|
|
43
|
+
private buildBalls;
|
|
44
|
+
private buildCareProps;
|
|
45
|
+
private resetPose;
|
|
46
|
+
private animateGait;
|
|
47
|
+
private applyBehavior;
|
|
48
|
+
private applyPawTrick;
|
|
49
|
+
private addHairStrand;
|
|
50
|
+
private finalizeFur;
|
|
51
|
+
private addCoatShell;
|
|
52
|
+
private mesh;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=three-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-renderer.d.ts","sourceRoot":"","sources":["../src/three-renderer.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB;AAQD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiE;IACxF,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAGxB;IACJ,OAAO,CAAC,QAAQ,CAAC,UAAU,CAInB;IACR,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2B;IAChD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmC;IACxD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAIpB;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAIzB;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAIxB;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;gBAES,MAAM,EAAE,iBAAiB;IAiErC,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IA0DlC,MAAM,IAAI,IAAI;IAKd,OAAO,IAAI,IAAI;IAUf,OAAO,CAAC,SAAS;IAoBjB,OAAO,CAAC,QAAQ;IA4LhB,OAAO,CAAC,SAAS;IAyDjB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,QAAQ;IAyBhB,OAAO,CAAC,SAAS;IAgCjB,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,cAAc;IA4BtB,OAAO,CAAC,SAAS;IA+BjB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,aAAa;IA6GrB,OAAO,CAAC,aAAa;IA2BrB,OAAO,CAAC,aAAa;IA0CrB,OAAO,CAAC,WAAW;IA+BnB,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,IAAI;CAMb"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ranjeet_/digital-pet",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A customizable digital pet web component. The default pet is Shiro, a playful golden retriever.",
|
|
5
|
+
"homepage": "https://ranjeet447.github.io/digital-pet/",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ranjeet447/digital-pet.git",
|
|
9
|
+
"directory": "web"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ranjeet447/digital-pet/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"assets",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc -p tsconfig.json --emitDeclarationOnly && esbuild src/index.ts --bundle --format=esm --target=es2020 --outfile=dist/index.js --sourcemap",
|
|
33
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
34
|
+
"prepublishOnly": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"digital-pet",
|
|
38
|
+
"web-component",
|
|
39
|
+
"golden-retriever",
|
|
40
|
+
"webgl",
|
|
41
|
+
"threejs",
|
|
42
|
+
"website-widget",
|
|
43
|
+
"shiro"
|
|
44
|
+
],
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"sideEffects": true,
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/three": "^0.184.1",
|
|
49
|
+
"esbuild": "^0.28.1",
|
|
50
|
+
"typescript": "^5.9.3"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"three": "^0.184.0"
|
|
54
|
+
}
|
|
55
|
+
}
|