threejs-html
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeb and Framework Integration
Web 与框架集成
Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions.
Inspect the framework's client/server boundary, routing lifecycle, stacking contexts, and layout before inserting a canvas. Create the renderer only in a browser lifecycle. Do not access window or WebGL at server module evaluation time.
Reserve a stable canvas area in CSS and observe its container. Keep semantic headings, controls, forms, and searchable product information in HTML. Use the existing design system for loading, error, and fallback states. Lazy-load heavy 3D code when it is not needed for the initial view.
Define pointer routing explicitly between overlays and the scene. Avoid a full-page invisible canvas intercepting links or touch scrolling. For scene-anchored labels, project world positions and handle behind-camera, occlusion, viewport clipping, and readable placement.
For multiple product thumbnails, consider one shared renderer with scoped viewports or static previews instead of a context per card. Scissor rectangles and event coordinates must use the same view bounds. Pause or invalidate offscreen content according to actual motion requirements.
Keep route cleanup safe during async loading and development remounts. Verify page scrolling, browser zoom, nested scroll containers, layout shifts, navigation away and back, reduced motion, and content availability when rendering fails.
使用项目已安装的版本和现有架构。这些说明是对用户任务的补充;并不授权无关的更改或外部操作。
在插入 canvas 之前,先检查框架的客户端/服务端边界、路由生命周期、层叠上下文和布局。仅应在浏览器生命周期内创建渲染器。不要在服务端模块评估时访问 window 或 WebGL。
在 CSS 中预留稳定的 canvas 区域,并观察其容器。保留语义化的标题、控件、表单和可搜索的产品信息在 HTML 中。使用现有设计系统处理加载、错误和回退状态。当初始视图不需要重型 3D 代码时,进行懒加载。
明确在覆盖层和场景之间定义指针路由。避免全页不可见 canvas 拦截链接或触摸滚动。对于场景锚定的标签,投影世界坐标并处理相机后方、遮挡、视口裁剪和可读性放置。
对于多个产品缩略图,考虑使用一个共享渲染器配合限定视口或静态预览,而不是每个卡片一个上下文。裁剪矩形和事件坐标必须使用相同的视图边界。根据实际运动需求暂停或使屏幕外内容失效。
在异步加载和开发重挂载期间保持路由清理安全。验证页面滚动、浏览器缩放、嵌套滚动容器、布局偏移、导航离开和返回、减少动态效果,以及渲染失败时的内容可用性。
API reference
API 参考
Consult the official documentation for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.
查阅官方文档以获取精确签名和特定版本的行为。如果无法访问文档,请检查已安装的类型/源码,并说明任何剩余的不确定性。