Merge remote-tracking branch 'origin/main' into ochafik/readme-mcp-config
This commit is contained in:
commit
5ef3120e0c
1 changed files with 2711 additions and 217 deletions
|
|
@ -129,3 +129,31 @@ React component that:
|
|||
- Displays streaming preview from `toolInputsPartial.code` as code arrives
|
||||
- Executes final code from `toolInputs.code` when complete
|
||||
- Renders to a pre-created canvas with configurable height
|
||||
|
||||
## Performance
|
||||
|
||||
### Visibility-Based Pause
|
||||
|
||||
Animation automatically pauses when the widget scrolls out of view:
|
||||
|
||||
- Uses `IntersectionObserver` to track visibility (browser-native, no polling)
|
||||
- Wraps `requestAnimationFrame` to skip frames when not visible
|
||||
- Animation loop stops completely → zero CPU usage while hidden
|
||||
- Queued callbacks resume instantly when scrolled back into view
|
||||
|
||||
This is transparent to user code - just use `requestAnimationFrame` normally.
|
||||
|
||||
### Transparent Background
|
||||
|
||||
Supports alpha transparency for seamless host UI integration:
|
||||
|
||||
```javascript
|
||||
const renderer = new THREE.WebGLRenderer({
|
||||
canvas,
|
||||
antialias: true,
|
||||
alpha: true,
|
||||
});
|
||||
renderer.setClearColor(0x000000, 0); // Fully transparent
|
||||
```
|
||||
|
||||
This is the default - 3D objects composite directly over the host background.
|
||||
|
|
|
|||
Loading…
Reference in a new issue