agent-robot-avatar 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/CHANGELOG.md +60 -0
- package/LICENSE +21 -0
- package/README.md +286 -0
- package/agent-robot-avatar.js +16 -0
- package/assets/support/alipay.png +0 -0
- package/assets/support/wechat-pay.png +0 -0
- package/docs/README.de.md +152 -0
- package/docs/README.es.md +217 -0
- package/docs/README.fr.md +215 -0
- package/docs/README.ja.md +217 -0
- package/docs/README.ko.md +217 -0
- package/docs/README.pt.md +217 -0
- package/docs/README.zh-CN.md +286 -0
- package/docs/README.zh-TW.md +219 -0
- package/index.d.ts +78 -0
- package/package.json +76 -0
- package/src/agent-robot-avatar-actions.js +394 -0
- package/src/agent-robot-avatar-antenna-flash.js +127 -0
- package/src/agent-robot-avatar-antenna.js +173 -0
- package/src/agent-robot-avatar-core.js +1056 -0
- package/src/agent-robot-avatar-extension-host.js +73 -0
- package/src/agent-robot-avatar-failure.js +127 -0
- package/src/agent-robot-avatar-head-roundness.js +136 -0
- package/src/agent-robot-avatar-inspect.js +231 -0
- package/src/agent-robot-avatar-version.js +3 -0
- package/src/agent-robot-avatar-waiting.js +121 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Agent Robot Avatar
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="../assets/readme/agent-robot-avatar-header.jpg" alt="Agent Robot Avatar">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
[English](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/README.md) | [简体中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-CN.md) | [繁體中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-TW.md) | [日本語](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ja.md) | [한국어](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ko.md) | [Español](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.es.md) | [Português](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.pt.md) | [Deutsch](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.de.md) | [Français](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.fr.md)
|
|
8
|
+
|
|
9
|
+
 [](../LICENSE) [](https://github.com/CX-ArtLab/agent-robot-avatar/actions/workflows/validate.yml) [](https://ko-fi.com/P0E625WIOI)
|
|
10
|
+
|
|
11
|
+
      
|
|
12
|
+
|
|
13
|
+
AI 에이전트와 다양한 인터랙티브 애플리케이션에서 사용할 수 있는 가볍고 표현력 있는 로봇 아바타 Web Component입니다.
|
|
14
|
+
|
|
15
|
+
Agent Robot Avatar는 SVG와 Vanilla JavaScript로만 구성되어 있으며 타사 애니메이션 프레임워크에 의존하지 않습니다. 네이티브 Custom Element로 동작하고 표정, 상호작용 상태, 포인터 추적, 대기 피드백, 머리 형태를 제어하는 간결한 API를 제공합니다.
|
|
16
|
+
|
|
17
|
+
**현재 공개 버전: v0.2.0**
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="../assets/demo/agent-robot-avatar-demo.gif" alt="Agent Robot Avatar 인터랙티브 애니메이션 데모" width="560">
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
## 주요 특징
|
|
24
|
+
|
|
25
|
+
- 순수 SVG + Vanilla JavaScript
|
|
26
|
+
- 네이티브 Web Component
|
|
27
|
+
- 외부 애니메이션 프레임워크 의존성 없음
|
|
28
|
+
- 자동 깜빡임과 자연스러운 시선 이동
|
|
29
|
+
- 포인터 추적과 관성이 있는 머리 움직임
|
|
30
|
+
- 국소적인 젤리 스타일 드래그 변형과 탄성 복귀
|
|
31
|
+
- 프로그램으로 제어하는 Agent 상태와 표정
|
|
32
|
+
- waiting / failure / warning / inspect / blocked / system error 의미 구분
|
|
33
|
+
- 머리 둥글기 조절
|
|
34
|
+
- 선택적으로 상태 점멸이 가능한 플로팅 안테나
|
|
35
|
+
- Demo와 재사용 가능한 컴포넌트 런타임 분리
|
|
36
|
+
|
|
37
|
+
## 빠른 시작
|
|
38
|
+
|
|
39
|
+
저장소 소스를 직접 사용할 때는 루트의 `agent-robot-avatar.js`와 `src/` 디렉터리를 함께 유지하고 공개 엔트리를 불러옵니다.
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<script type="module" src="./agent-robot-avatar.js"></script>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<agent-robot-avatar id="avatar"></agent-robot-avatar>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
컴포넌트는 로드 후 자동으로 기본 idle 상태에 들어갑니다. 최소 실행 예제는 [`examples/basic.html`](../examples/basic.html)에 있습니다.
|
|
50
|
+
|
|
51
|
+
## 기본 API
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
const avatar = document.querySelector('#avatar');
|
|
55
|
+
|
|
56
|
+
avatar.play('success');
|
|
57
|
+
avatar.play('failure');
|
|
58
|
+
avatar.play('warning');
|
|
59
|
+
avatar.play('inspect');
|
|
60
|
+
avatar.play('angry');
|
|
61
|
+
avatar.play('error');
|
|
62
|
+
|
|
63
|
+
avatar.reset();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 상태와 표정
|
|
67
|
+
|
|
68
|
+
| 상태 | API 이름 | 용도 |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| Idle | `idle` | 기본 대기 상태 |
|
|
71
|
+
| Bored | `bored` | 오랫동안 활성 작업이 없음 |
|
|
72
|
+
| Waiting | `waiting` | 요청을 보낸 뒤 결과를 기다림 |
|
|
73
|
+
| Input | `input` | 사용자가 입력 중 |
|
|
74
|
+
| Send | `send` | 전송 / 끄덕임 피드백 |
|
|
75
|
+
| Success | `success` | 작업 성공 |
|
|
76
|
+
| Failure | `failure` | 작업 결과 실패 |
|
|
77
|
+
| Warning | `warning` | 위험하거나 파괴적인 동작 확인 |
|
|
78
|
+
| Inspect | `inspect` | 결과 검토 / 확인 / 검증 |
|
|
79
|
+
| Blocked | `angry` | 요청이 차단되거나 진행 불가 |
|
|
80
|
+
| System error | `error` | 연결, 서비스 또는 시스템 오류 |
|
|
81
|
+
| Surprise | `surprise` | 예상하지 못한 결과 |
|
|
82
|
+
| Sleep | `sleep` | 수면 상태 진입 |
|
|
83
|
+
| Wake | `wake` | 수면 상태에서 복귀 |
|
|
84
|
+
|
|
85
|
+
`failure`는 요청한 작업 자체의 실패를 의미하고, `error`는 연결·서비스·시스템 문제를 의미합니다. `waiting`은 진행 중인 요청을 기다리는 상태이며 `bored`는 활성 작업이 없는 상태입니다.
|
|
86
|
+
|
|
87
|
+
의미 기반 별칭도 지원합니다.
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
avatar.play('failed');
|
|
91
|
+
avatar.play('fail');
|
|
92
|
+
avatar.play('verify');
|
|
93
|
+
avatar.play('review');
|
|
94
|
+
avatar.play('blocked');
|
|
95
|
+
avatar.play('policy-blocked');
|
|
96
|
+
avatar.play('system-error');
|
|
97
|
+
avatar.play('connection-error');
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 지속 대기
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
avatar.startWaiting();
|
|
104
|
+
// 응답이나 결과를 받으면 중지합니다.
|
|
105
|
+
avatar.stopWaiting();
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
다른 액션을 재생해도 현재 waiting 상태가 종료됩니다.
|
|
109
|
+
|
|
110
|
+
## 포인터 추적
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
avatar.setPointerFollow(false);
|
|
114
|
+
avatar.setPointerFollow(true);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 머리 둥글기
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
avatar.setHeadRoundness(0); // 더 각진 형태
|
|
121
|
+
avatar.setHeadRoundness(50); // 기본값
|
|
122
|
+
avatar.setHeadRoundness(100); // 더 둥근 형태
|
|
123
|
+
|
|
124
|
+
console.log(avatar.getHeadRoundness());
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
값은 `0–100` 범위로 제한됩니다. 변경 시 `head-roundness-change` 이벤트가 발생합니다.
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
avatar.addEventListener('head-roundness-change', (event) => {
|
|
131
|
+
console.log(event.detail.value);
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 상태 이벤트
|
|
136
|
+
|
|
137
|
+
시각 상태가 바뀔 때 `face-state` 이벤트가 발생합니다.
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
avatar.addEventListener('face-state', (event) => {
|
|
141
|
+
console.log(event.detail.state);
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 속성
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<agent-robot-avatar
|
|
149
|
+
size="160"
|
|
150
|
+
color="#08090b"
|
|
151
|
+
auto-sleep="30000">
|
|
152
|
+
</agent-robot-avatar>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
| 속성 | 설명 |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `size` | 컴포넌트 크기(px) |
|
|
158
|
+
| `color` | 아바타 기본 색상 |
|
|
159
|
+
| `auto-sleep` | 자동 수면까지의 유휴 시간(ms), `0`은 비활성화 |
|
|
160
|
+
|
|
161
|
+
## 기본 동작
|
|
162
|
+
|
|
163
|
+
별도 API 호출이 없어도 랜덤 깜빡임, 미세한 시선 이동, 가까운 포인터 추적, 가벼운 관성 움직임, 자연스러운 idle 복귀, 선택적 자동 수면이 동작합니다.
|
|
164
|
+
|
|
165
|
+
## 드래그 상호작용
|
|
166
|
+
|
|
167
|
+
드래그할 때 머리 전체가 단단한 물체처럼 이동하는 대신 입력 지점 주변이 국소적으로 변형됩니다.
|
|
168
|
+
|
|
169
|
+
- 강하게 바깥쪽으로 당김: 복귀 후 `angry`
|
|
170
|
+
- 강하게 중심으로 밀기: 복귀 후 `success`
|
|
171
|
+
- 작은 드래그: 변형만 적용
|
|
172
|
+
|
|
173
|
+
## 인터랙티브 Demo
|
|
174
|
+
|
|
175
|
+
`demo/index.html`에는 모든 공개 상태, 포인터 추적, 젤리 드래그, waiting 라이프사이클, 머리 둥글기 조절, 색상 / 동작 설정, Agent 대화 시뮬레이션이 포함됩니다. Demo 전용 JavaScript는 `demo/`에 분리되어 재사용 가능한 npm runtime에는 포함되지 않습니다.
|
|
176
|
+
|
|
177
|
+
## 프로젝트 구조
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
agent-robot-avatar.js 공개 컴포넌트 엔트리
|
|
181
|
+
src/ 재사용 가능한 runtime 및 표정 모듈
|
|
182
|
+
demo/ 인터랙티브 Demo와 전용 스크립트
|
|
183
|
+
examples/ 최소 통합 예제
|
|
184
|
+
assets/support/ 후원 / 결제 QR 자산
|
|
185
|
+
docs/ 다국어 문서
|
|
186
|
+
README.md 영어 기본 문서
|
|
187
|
+
CHANGELOG.md 공개 릴리스 기록
|
|
188
|
+
CONTRIBUTING.md 기여 가이드
|
|
189
|
+
package.json 패키지 메타데이터
|
|
190
|
+
LICENSE MIT License
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## 배포 및 호환성
|
|
194
|
+
|
|
195
|
+
패키지는 `agent-robot-avatar` 이름으로 npm에 공개되며 액션, 이벤트 및 공개 메서드에 대한 TypeScript 타입 선언을 포함합니다. ES Modules, Custom Elements, SVG, Pointer Events, Web Animations API를 지원하는 최신 브라우저를 대상으로 합니다.
|
|
196
|
+
|
|
197
|
+
## 기여
|
|
198
|
+
|
|
199
|
+
Issue와 Pull Request를 환영합니다. 제출 전 [`CONTRIBUTING.md`](../CONTRIBUTING.md)를 확인해 주세요.
|
|
200
|
+
|
|
201
|
+
## 프로젝트 상태
|
|
202
|
+
|
|
203
|
+
v0.1.0은 첫 공개 릴리스 라인입니다. 향후 `1.0.0` 안정성 약속 이전에 신중하게 발전시킬 수 있도록 공개 API를 의도적으로 작게 유지하고 있습니다.
|
|
204
|
+
|
|
205
|
+
Agent Robot Avatar는 독립적으로 개발된 오픈 소스 프로젝트이며 특정 AI 플랫폼이나 브랜드와 제휴하거나 공식 승인을 받은 프로젝트가 아닙니다.
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
MIT License. 자세한 내용은 [`LICENSE`](../LICENSE)를 참조하세요.
|
|
210
|
+
|
|
211
|
+
## 커피 한 잔으로 후원하기
|
|
212
|
+
|
|
213
|
+
프로젝트가 도움이 되었다면 편한 방법으로 후원할 수 있습니다.
|
|
214
|
+
|
|
215
|
+
| Ko-fi | Alipay | WeChat Pay |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| <a href='https://ko-fi.com/P0E625WIOI' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi6.png?v=6' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a> | <img src="../assets/support/alipay.png" alt="Alipay QR code" width="160"> | <img src="../assets/support/wechat-pay.png" alt="WeChat Pay QR code" width="160"> |
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Agent Robot Avatar
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="../assets/readme/agent-robot-avatar-header.jpg" alt="Agent Robot Avatar">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
[English](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/README.md) | [简体中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-CN.md) | [繁體中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-TW.md) | [日本語](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ja.md) | [한국어](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ko.md) | [Español](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.es.md) | [Português](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.pt.md) | [Deutsch](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.de.md) | [Français](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.fr.md)
|
|
8
|
+
|
|
9
|
+
 [](../LICENSE) [](https://github.com/CX-ArtLab/agent-robot-avatar/actions/workflows/validate.yml) [](https://ko-fi.com/P0E625WIOI)
|
|
10
|
+
|
|
11
|
+
      
|
|
12
|
+
|
|
13
|
+
Um Web Component leve e expressivo de avatar robótico para agentes de IA e outras aplicações interativas.
|
|
14
|
+
|
|
15
|
+
Agent Robot Avatar é construído com SVG e JavaScript puro, sem dependência de frameworks de animação de terceiros. Funciona como um Custom Element nativo e oferece uma API compacta para expressões, estados de interação, seguimento do ponteiro, feedback de espera e formato da cabeça.
|
|
16
|
+
|
|
17
|
+
**Versão pública atual: v0.2.0**
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="../assets/demo/agent-robot-avatar-demo.gif" alt="Demonstração animada interativa do Agent Robot Avatar" width="560">
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
## Principais recursos
|
|
24
|
+
|
|
25
|
+
- SVG + JavaScript puro
|
|
26
|
+
- Web Component nativo
|
|
27
|
+
- Sem dependências de frameworks de animação
|
|
28
|
+
- Piscar automático e movimento sutil do olhar
|
|
29
|
+
- Seguimento do ponteiro e movimento da cabeça com inércia
|
|
30
|
+
- Deformação local tipo gelatina ao arrastar e retorno elástico
|
|
31
|
+
- Estados e expressões de Agent controláveis por código
|
|
32
|
+
- Semântica separada para espera, falha, aviso, inspeção, bloqueio e erro de sistema
|
|
33
|
+
- Arredondamento da cabeça ajustável
|
|
34
|
+
- Antena flutuante com indicação piscante opcional
|
|
35
|
+
- Demo separado do componente reutilizável
|
|
36
|
+
|
|
37
|
+
## Início rápido
|
|
38
|
+
|
|
39
|
+
Ao usar diretamente o código do repositório, mantenha `agent-robot-avatar.js` junto com `src/` e carregue a entrada pública:
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<script type="module" src="./agent-robot-avatar.js"></script>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<agent-robot-avatar id="avatar"></agent-robot-avatar>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
O avatar entra automaticamente no estado idle. Um exemplo mínimo está em [`examples/basic.html`](../examples/basic.html).
|
|
50
|
+
|
|
51
|
+
## API básica
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
const avatar = document.querySelector('#avatar');
|
|
55
|
+
|
|
56
|
+
avatar.play('success');
|
|
57
|
+
avatar.play('failure');
|
|
58
|
+
avatar.play('warning');
|
|
59
|
+
avatar.play('inspect');
|
|
60
|
+
avatar.play('angry');
|
|
61
|
+
avatar.play('error');
|
|
62
|
+
|
|
63
|
+
avatar.reset();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Estados e expressões
|
|
67
|
+
|
|
68
|
+
| Estado | API | Uso |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| Idle | `idle` | Estado normal de espera |
|
|
71
|
+
| Bored | `bored` | Longos períodos sem tarefa ativa |
|
|
72
|
+
| Waiting | `waiting` | Solicitação enviada, aguardando resultado |
|
|
73
|
+
| Input | `input` | Usuário digitando |
|
|
74
|
+
| Send | `send` | Envio / feedback de aceno |
|
|
75
|
+
| Success | `success` | Tarefa concluída com sucesso |
|
|
76
|
+
| Failure | `failure` | Tarefa concluída sem sucesso |
|
|
77
|
+
| Warning | `warning` | Ação arriscada ou destrutiva exige confirmação |
|
|
78
|
+
| Inspect | `inspect` | Revisar, conferir ou verificar um resultado |
|
|
79
|
+
| Blocked | `angry` | Solicitação bloqueada ou impossibilitada de continuar |
|
|
80
|
+
| System error | `error` | Falha de conexão, serviço ou sistema |
|
|
81
|
+
| Surprise | `surprise` | Evento ou resultado inesperado |
|
|
82
|
+
| Sleep | `sleep` | Entrar em repouso |
|
|
83
|
+
| Wake | `wake` | Sair do repouso |
|
|
84
|
+
|
|
85
|
+
`failure` representa falha da própria tarefa; `error` é reservado para problemas de conexão, serviço ou sistema. `waiting` indica uma solicitação pendente e `bored` representa inatividade.
|
|
86
|
+
|
|
87
|
+
Aliases semânticos também estão disponíveis:
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
avatar.play('failed');
|
|
91
|
+
avatar.play('fail');
|
|
92
|
+
avatar.play('verify');
|
|
93
|
+
avatar.play('review');
|
|
94
|
+
avatar.play('blocked');
|
|
95
|
+
avatar.play('policy-blocked');
|
|
96
|
+
avatar.play('system-error');
|
|
97
|
+
avatar.play('connection-error');
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Espera contínua
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
avatar.startWaiting();
|
|
104
|
+
// Pare quando a resposta ou resultado chegar.
|
|
105
|
+
avatar.stopWaiting();
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Qualquer outra ação também interrompe o estado waiting ativo.
|
|
109
|
+
|
|
110
|
+
## Seguimento do ponteiro
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
avatar.setPointerFollow(false);
|
|
114
|
+
avatar.setPointerFollow(true);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Arredondamento da cabeça
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
avatar.setHeadRoundness(0); // mais quadrada
|
|
121
|
+
avatar.setHeadRoundness(50); // padrão
|
|
122
|
+
avatar.setHeadRoundness(100); // mais arredondada
|
|
123
|
+
|
|
124
|
+
console.log(avatar.getHeadRoundness());
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Os valores são limitados a `0–100`. Alterações emitem `head-roundness-change`.
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
avatar.addEventListener('head-roundness-change', (event) => {
|
|
131
|
+
console.log(event.detail.value);
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Evento de estado
|
|
136
|
+
|
|
137
|
+
Cada mudança visual emite `face-state`:
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
avatar.addEventListener('face-state', (event) => {
|
|
141
|
+
console.log(event.detail.state);
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Atributos
|
|
146
|
+
|
|
147
|
+
```html
|
|
148
|
+
<agent-robot-avatar
|
|
149
|
+
size="160"
|
|
150
|
+
color="#08090b"
|
|
151
|
+
auto-sleep="30000">
|
|
152
|
+
</agent-robot-avatar>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
| Atributo | Descrição |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `size` | Tamanho do componente em pixels |
|
|
158
|
+
| `color` | Cor principal do avatar |
|
|
159
|
+
| `auto-sleep` | Tempo de inatividade antes de dormir, em ms; `0` desativa |
|
|
160
|
+
|
|
161
|
+
## Comportamento padrão
|
|
162
|
+
|
|
163
|
+
Sem chamadas explícitas à API, o avatar já oferece piscadas aleatórias, movimento sutil do olhar, seguimento do ponteiro próximo, movimento inercial da cabeça, retorno natural a idle e suspensão automática opcional.
|
|
164
|
+
|
|
165
|
+
## Interação por arraste
|
|
166
|
+
|
|
167
|
+
Ao arrastar, a cabeça se deforma localmente ao redor do ponto de interação, em vez de se mover como um corpo rígido.
|
|
168
|
+
|
|
169
|
+
- Puxão forte para fora: ativa `angry` após retornar
|
|
170
|
+
- Empurrão forte para o centro: ativa `success` após retornar
|
|
171
|
+
- Arraste pequeno: apenas deformação
|
|
172
|
+
|
|
173
|
+
## Demo interativo
|
|
174
|
+
|
|
175
|
+
`demo/index.html` inclui todos os estados públicos, seguimento do ponteiro, arraste tipo gelatina, ciclo de waiting, ajuste do arredondamento, controles de cor e comportamento e simulação de conversa com Agent. O JavaScript exclusivo do Demo fica isolado em `demo/` e não faz parte do runtime reutilizável do npm.
|
|
176
|
+
|
|
177
|
+
## Estrutura do projeto
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
agent-robot-avatar.js Entrada pública do componente
|
|
181
|
+
src/ Runtime reutilizável e módulos de expressão
|
|
182
|
+
demo/ Demo interativo e scripts exclusivos
|
|
183
|
+
examples/ Exemplos mínimos de integração
|
|
184
|
+
assets/support/ Recursos QR de apoio / pagamento
|
|
185
|
+
docs/ Documentação multilíngue
|
|
186
|
+
README.md Documento principal em inglês
|
|
187
|
+
CHANGELOG.md Histórico público de versões
|
|
188
|
+
CONTRIBUTING.md Guia de contribuição
|
|
189
|
+
package.json Metadados do pacote
|
|
190
|
+
LICENSE Licença MIT
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Distribuição e compatibilidade
|
|
194
|
+
|
|
195
|
+
O pacote está publicado no npm como `agent-robot-avatar` e inclui declarações TypeScript para ações, eventos e métodos públicos. Destina-se a navegadores modernos com suporte a ES Modules, Custom Elements, SVG, Pointer Events e Web Animations API.
|
|
196
|
+
|
|
197
|
+
## Contribuição
|
|
198
|
+
|
|
199
|
+
Issues e Pull Requests são bem-vindos. Leia [`CONTRIBUTING.md`](../CONTRIBUTING.md) antes de enviar alterações.
|
|
200
|
+
|
|
201
|
+
## Status do projeto
|
|
202
|
+
|
|
203
|
+
v0.1.0 é a primeira linha de lançamento público. A API pública é mantida deliberadamente pequena para evoluir com cuidado antes de um futuro compromisso de estabilidade `1.0.0`.
|
|
204
|
+
|
|
205
|
+
Agent Robot Avatar é um projeto independente de código aberto e não é afiliado, endossado nem representa nenhuma plataforma ou marca de IA.
|
|
206
|
+
|
|
207
|
+
## Licença
|
|
208
|
+
|
|
209
|
+
MIT License. Consulte [`LICENSE`](../LICENSE).
|
|
210
|
+
|
|
211
|
+
## Pague-me um café
|
|
212
|
+
|
|
213
|
+
Se este projeto for útil, você pode apoiá-lo pelo método mais conveniente:
|
|
214
|
+
|
|
215
|
+
| Ko-fi | Alipay | WeChat Pay |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| <a href='https://ko-fi.com/P0E625WIOI' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi6.png?v=6' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a> | <img src="../assets/support/alipay.png" alt="QR code do Alipay" width="160"> | <img src="../assets/support/wechat-pay.png" alt="QR code do WeChat Pay" width="160"> |
|