@thanhnguyxn/pixelcraft 0.1.0 → 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/.agents/plugins/marketplace.json +1 -1
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +15 -4
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/README.md +185 -328
- package/SECURITY.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/bin/pixelcraft.mjs +431 -23
- package/docs/ARCHITECTURE.md +40 -37
- package/docs/DESIGN-RATIONALE.md +51 -3
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +16 -6
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/pixelcraft-accessibility.md +17 -0
- package/evals/pixelcraft-craft.md +16 -0
- package/evals/pixelcraft-dataviz.md +3 -3
- package/evals/pixelcraft-direction.md +17 -0
- package/evals/pixelcraft-game-ui.md +3 -3
- package/evals/pixelcraft-mobile.md +3 -3
- package/evals/pixelcraft-patterns.md +16 -0
- package/evals/pixelcraft-plan.md +65 -3
- package/evals/pixelcraft-review.md +3 -3
- package/evals/pixelcraft-visual-qa.md +11 -5
- package/evals/pixelcraft-web.md +21 -3
- package/evals/pixelcraft.md +4 -4
- package/gemini-extension.json +3 -2
- package/install.ps1 +57 -11
- package/install.sh +82 -7
- package/package.json +32 -4
- package/plugin.json +6 -1
- package/scripts/build-adapters.mjs +11 -13
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +14 -1
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +86 -7
- package/scripts/test-export-tokens.mjs +259 -3
- package/scripts/test-finish-gate.mjs +133 -10
- package/scripts/test-installers.mjs +155 -6
- package/scripts/test-shoot.mjs +23 -1
- package/scripts/test-slop-scan.mjs +390 -3
- package/scripts/test-style-inventory.mjs +23 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +82 -4
- package/scripts/validate-skills.mjs +149 -3
- package/skills/pixelcraft/SKILL.md +67 -47
- package/skills/pixelcraft/references/design-brief.md +2 -2
- package/skills/pixelcraft/references/floor.md +36 -19
- package/skills/pixelcraft/references/report-template.md +25 -11
- package/skills/pixelcraft/references/stack-detection.md +138 -67
- package/skills/pixelcraft/references/surface-acceptance.md +33 -21
- package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
- package/skills/pixelcraft-accessibility/SKILL.md +34 -13
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
- package/skills/pixelcraft-accessibility/references/verification.md +15 -10
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
- package/skills/pixelcraft-brandkit/SKILL.md +42 -30
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
- package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
- package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
- package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
- package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
- package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
- package/skills/pixelcraft-constrained/SKILL.md +21 -20
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
- package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
- package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
- package/skills/pixelcraft-craft/SKILL.md +29 -15
- package/skills/pixelcraft-craft/references/color.md +62 -6
- package/skills/pixelcraft-craft/references/layout.md +32 -0
- package/skills/pixelcraft-craft/references/motion.md +99 -12
- package/skills/pixelcraft-craft/references/typography.md +48 -9
- package/skills/pixelcraft-data-apps/SKILL.md +50 -31
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +87 -31
- package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
- package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
- package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
- package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
- package/skills/pixelcraft-data-apps/references/panel.md +69 -23
- package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
- package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
- package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
- package/skills/pixelcraft-dataviz/SKILL.md +21 -24
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
- package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
- package/skills/pixelcraft-desktop/SKILL.md +61 -39
- package/skills/pixelcraft-desktop/references/appkit.md +60 -26
- package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
- package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
- package/skills/pixelcraft-desktop/references/electron.md +68 -26
- package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
- package/skills/pixelcraft-desktop/references/gtk.md +74 -31
- package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
- package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
- package/skills/pixelcraft-desktop/references/tauri.md +80 -24
- package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
- package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
- package/skills/pixelcraft-desktop/references/working-context.md +82 -3
- package/skills/pixelcraft-direction/SKILL.md +48 -82
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +11 -1
- package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +3 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
- package/skills/pixelcraft-document/SKILL.md +27 -23
- package/skills/pixelcraft-document/references/archetypes.md +27 -4
- package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +96 -43
- package/skills/pixelcraft-document/references/slides.md +123 -27
- package/skills/pixelcraft-email/SKILL.md +42 -20
- package/skills/pixelcraft-email/references/client-quirks.md +101 -33
- package/skills/pixelcraft-email/references/html-tables.md +83 -22
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +13 -11
- package/skills/pixelcraft-email/references/react-email.md +76 -34
- package/skills/pixelcraft-extensions/SKILL.md +32 -27
- package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
- package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +90 -11
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
- package/skills/pixelcraft-game-ui/SKILL.md +45 -26
- package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
- package/skills/pixelcraft-game-ui/references/godot.md +100 -27
- package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
- package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
- package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +14 -13
- package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +20 -23
- package/skills/pixelcraft-media/references/banners-video.md +83 -65
- package/skills/pixelcraft-media/references/og-generation.md +110 -63
- package/skills/pixelcraft-media/references/social-cards.md +57 -58
- package/skills/pixelcraft-mobile/SKILL.md +53 -36
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
- package/skills/pixelcraft-mobile/references/flet.md +53 -26
- package/skills/pixelcraft-mobile/references/flutter.md +76 -32
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
- package/skills/pixelcraft-mobile/references/kivy.md +54 -31
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
- package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
- package/skills/pixelcraft-mobile/references/uikit.md +57 -23
- package/skills/pixelcraft-patterns/SKILL.md +30 -13
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +35 -16
- package/skills/pixelcraft-patterns/references/communication.md +34 -15
- package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +31 -19
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/settings.md +40 -12
- package/skills/pixelcraft-plan/SKILL.md +54 -18
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +44 -9
- package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
- package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
- package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
- package/skills/pixelcraft-review/SKILL.md +41 -19
- package/skills/pixelcraft-review/references/audit-report.md +20 -1
- package/skills/pixelcraft-review/references/heuristics.md +63 -18
- package/skills/pixelcraft-review/references/personas.md +41 -14
- package/skills/pixelcraft-review/references/polish.md +66 -26
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
- package/skills/pixelcraft-spatial/SKILL.md +16 -17
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
- package/skills/pixelcraft-spatial/references/platforms.md +123 -53
- package/skills/pixelcraft-tokens/SKILL.md +18 -14
- package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
- package/skills/pixelcraft-tokens/references/format.md +39 -9
- package/skills/pixelcraft-tokens/references/governance.md +1 -1
- package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
- package/skills/pixelcraft-tui/SKILL.md +41 -25
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +77 -28
- package/skills/pixelcraft-tui/references/ratatui.md +70 -30
- package/skills/pixelcraft-tui/references/rich.md +53 -33
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +75 -34
- package/skills/pixelcraft-ux/SKILL.md +22 -12
- package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
- package/skills/pixelcraft-ux/references/forms.md +57 -3
- package/skills/pixelcraft-ux/references/i18n.md +50 -12
- package/skills/pixelcraft-ux/references/laws.md +35 -14
- package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
- package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
- package/skills/pixelcraft-web/SKILL.md +105 -49
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
- package/skills/pixelcraft-web/references/angular.md +63 -16
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +64 -13
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +52 -17
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +144 -12
- package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +27 -18
- package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
- package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
- package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +6 -1
- package/skills/pixelcraft-web/references/qwik.md +51 -11
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +112 -13
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +106 -63
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +67 -16
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -11
- package/skills/pixelcraft-web/references/tailwind.md +40 -14
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Video and media experiences
|
|
2
|
+
|
|
3
|
+
For adaptive streaming (`hls.js`, Shaka Player, `dash.js`), DRM, and accessible player UI suites (Vidstack, Media Chrome, Mux Player, Video.js), read [media-players.md](media-players.md).
|
|
4
|
+
|
|
5
|
+
## Media decision
|
|
6
|
+
|
|
7
|
+
Use a standard HTML `<video>` element when the user needs to watch a clip. Use a WebGL/WebGPU video texture only when mapping video onto 3D/shader geometry materially improves the experience. Use WebCodecs only for frame-level decode/encode pipelines (browser video editors, custom muxers) after checking codec and cross-browser support.
|
|
8
|
+
|
|
9
|
+
## Delivery & codec `<source>` ordering
|
|
10
|
+
|
|
11
|
+
- Start with a `poster` and explicit `width`/`height` (or CSS `aspect-ratio`) to prevent layout shift.
|
|
12
|
+
- Order `<source>` tags from **most efficient modern codec to widest fallback** with explicit `codecs` parameters so browsers pick the best hardware-decoded stream without probing every file: **AV1** (`av01`) → **HEVC** (`hvc1` for Safari/Apple hardware decode) or **VP9** (`vp09`) → **H.264** (`avc1` universal fallback).
|
|
13
|
+
- Defer below-fold or interaction-triggered media (`preload="none"` or `"metadata"`).
|
|
14
|
+
- Require synchronized captions (`<track kind="captions">`) for prerecorded informative video (WCAG 1.2.2; see [accessibility-performance.md](accessibility-performance.md)).
|
|
15
|
+
- Honor autoplay policy: ambient video must be `muted playsinline`, skip/pause under `prefers-reduced-motion: reduce`, and always expose a visible pause control (WCAG 2.2.2).
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<video
|
|
19
|
+
width="1280"
|
|
20
|
+
height="720"
|
|
21
|
+
poster="/media/preview-poster.webp"
|
|
22
|
+
preload="metadata"
|
|
23
|
+
playsinline
|
|
24
|
+
controls
|
|
25
|
+
>
|
|
26
|
+
<source src="/media/demo-av1.mp4" type='video/mp4; codecs="av01.0.08M.08"' />
|
|
27
|
+
<source src="/media/demo-hevc.mp4" type='video/mp4; codecs="hvc1.1.6.L93.B0"' />
|
|
28
|
+
<source src="/media/demo-vp9.webm" type='video/webm; codecs="vp09.00.41.08"' />
|
|
29
|
+
<source src="/media/demo-h264.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
|
|
30
|
+
<track kind="captions" src="/media/demo.en.vtt" srclang="en" label="English" default />
|
|
31
|
+
</video>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Video textures & `requestVideoFrameCallback`
|
|
35
|
+
|
|
36
|
+
When uploading `<video>` frames to Canvas 2D, WebGL, or WebGPU textures, prefer **`video.requestVideoFrameCallback()`** (with a `requestAnimationFrame` fallback) so textures only re-upload when a **new decoded video frame arrives** instead of uploading duplicate 24/30 fps frames at 60/120 Hz:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
let handle = 0;
|
|
40
|
+
let cancelled = false;
|
|
41
|
+
|
|
42
|
+
function scheduleFrame(video: HTMLVideoElement, uploadTexture: () => void) {
|
|
43
|
+
if (cancelled) return;
|
|
44
|
+
if ('requestVideoFrameCallback' in video) {
|
|
45
|
+
handle = video.requestVideoFrameCallback(() => {
|
|
46
|
+
uploadTexture();
|
|
47
|
+
scheduleFrame(video, uploadTexture);
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
handle = requestAnimationFrame(() => {
|
|
51
|
+
if (video.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA) uploadTexture();
|
|
52
|
+
scheduleFrame(video, uploadTexture);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Teardown:
|
|
58
|
+
// cancelled = true;
|
|
59
|
+
// if ('cancelVideoFrameCallback' in video) video.cancelVideoFrameCallback(handle);
|
|
60
|
+
// else cancelAnimationFrame(handle);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- Set `video.crossOrigin = 'anonymous'` (with matching CORS headers on the media host) before uploading to WebGL/WebGPU textures, handle play promise rejections and decode stalls, and dispose GPU textures on unmount.
|
|
64
|
+
- Keep a static poster or normal `<video>` fallback when GPU contexts fail.
|
|
65
|
+
|
|
66
|
+
Official docs:
|
|
67
|
+
- HTMLVideoElement: https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement
|
|
68
|
+
- `requestVideoFrameCallback`: https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/requestVideoFrameCallback
|
|
69
|
+
- WebCodecs: https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API
|
|
@@ -13,41 +13,66 @@ In Nuxt, register global CSS in `nuxt.config` rather than importing it repeatedl
|
|
|
13
13
|
|
|
14
14
|
## Layout and responsive idioms
|
|
15
15
|
|
|
16
|
-
Use single-file components to scope behavior, not to replace CSS architecture. Layouts in `layouts/` handle shell persistence; pages handle route content. Prefer CSS grid/flex/logical properties and composables only for genuinely reactive layout state. Avoid teleporting chrome without considering focus and server rendering.
|
|
16
|
+
Use single-file components to scope behavior, not to replace CSS architecture. Layouts in `app/layouts/` (Nuxt 4) or `layouts/` (Nuxt 3) handle shell persistence; pages handle route content. Prefer CSS grid/flex/logical properties and composables only for genuinely reactive layout state. Avoid teleporting chrome without considering focus and server rendering.
|
|
17
17
|
|
|
18
18
|
## Typography/custom fonts
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Use **`@nuxt/fonts`** (automatic font metric fallbacks, self-hosting, subsetting) and **`@nuxt/image`** (`<NuxtImg>` / `<NuxtPicture>` with explicit dimensions and `preload` for LCP hero media) in Nuxt apps. In standalone Vue, configure font loading in `index.html`/Vite with explicit fallback stacks. Reactive font classes are rarely necessary; semantic CSS roles are cheaper.
|
|
21
21
|
|
|
22
22
|
## Motion/reduced motion
|
|
23
23
|
|
|
24
|
-
Use Vue `<Transition>`/`<TransitionGroup>` for meaningful enter/leave state, with CSS classes honoring reduced motion. Query `useMediaQuery('(prefers-reduced-motion: reduce)')` or
|
|
24
|
+
Use Vue `<Transition>`/`<TransitionGroup>` for meaningful enter/leave state, with CSS classes honoring reduced motion. Query `useMediaQuery('(prefers-reduced-motion: reduce)')` (VueUse) or client-guarded `matchMedia` for JS animation. Do not animate every list mutation by default.
|
|
25
25
|
|
|
26
26
|
## Accessibility specifics
|
|
27
27
|
|
|
28
|
-
Use native HTML inside components. `v-model` does not label inputs; explicit `label for`/`id` or wrapped labeling remains required. Manage focus after route changes, modal close, dynamic error insertion, and component removal.
|
|
28
|
+
Use native HTML inside components. `v-model` does not label inputs; explicit `label for`/`id` (use `useId()` in Vue 3.5+ for SSR-safe unique IDs) or wrapped labeling remains required. Manage focus after route changes, modal close, dynamic error insertion, and component removal. `<NuxtLink>` preserves anchor semantics; do not replace navigation with bare click handlers.
|
|
29
29
|
|
|
30
30
|
## States idiom
|
|
31
31
|
|
|
32
|
-
Use `useAsyncData`/`useFetch` status/error/refresh deliberately: initial loading, refresh loading, stale data, empty result, server error, retry. Keep optimistic mutation rollback explicit.
|
|
32
|
+
Use `useAsyncData`/`useFetch` status/error/refresh deliberately: initial loading, refresh loading, stale data, empty result, server error, retry. Keep optimistic mutation rollback explicit. For SSR-safe shared state across components, always use **Nuxt `useState('key', () => ...)`** or **Pinia** (registered per SSR app instance)—never export mutable module-level `ref()` singletons that leak between concurrent server requests. Use **`callOnce()`** for one-time SSR-to-client initialization (such as bootstrapping Pinia store data without double-running on hydration).
|
|
33
33
|
|
|
34
34
|
## Forms idiom
|
|
35
35
|
|
|
36
|
-
Use correct input attributes in templates; Vue attribute casing/hyphenation preserves native semantics. Validation libraries are optional—state timing and recovery matter more than schema existence. Preserve user input across failed submission and auth redirect.
|
|
36
|
+
Use correct input attributes in templates; Vue attribute casing/hyphenation preserves native semantics. Validation libraries (VeeValidate, FormKit, or Nuxt UI `<UForm>` with Standard Schema) are optional—state timing and recovery matter more than schema existence. Preserve user input across failed submission and auth redirect.
|
|
37
|
+
|
|
38
|
+
## Vue 3.5 / 3.6 and Nuxt 4 idioms
|
|
39
|
+
|
|
40
|
+
- **Vue 3.5+**: prefer `defineModel()` for two-way component bindings, `useTemplateRef('inputEl')` for typed DOM refs, **reactive props destructuring** (`const { count = 0 } = defineProps<{ count?: number }>()`—remains reactive without `toRefs`), and **`onWatcherCleanup()`** inside `watch`/`watchEffect` to abort stale `fetch` requests or clear timers cleanly.
|
|
41
|
+
- **Vue 3.6 Vapor Mode**: for high-frequency, low-overhead leaf components or large lists on Vue 3.6+, Vapor Mode compiles `<script setup vapor>` directly to fine-grained DOM operations without VDOM diffing—opt in selectively for measured hot paths while keeping standard SFCs where VDOM slots/libraries are required.
|
|
42
|
+
- **Pinia & Nuxt UI v3/v4**: use **Pinia** (`defineStore` setup syntax) for structured multi-route client state; when using **Nuxt UI v3/v4** (built on Reka UI + Tailwind Variants), map semantic design tokens through `app.config.ts` and `@theme inline` rather than overriding internal classes.
|
|
43
|
+
- **Nuxt 4 architecture**: application source lives under `app/` (`app/pages`, `app/layouts`, `app/components`, `app/composables`, `app/app.vue`), universal utilities under `shared/`, and Nitro endpoints under `server/`. `useAsyncData` / `useFetch` `data` is a **`shallowRef`** by default—replace the value immutably or opt into `{ deep: true }` explicitly. Use **`.server.vue`** components (Server Components / Nuxt Islands) to keep heavy static renderers (Markdown, syntax highlighters, charts) off the client bundle.
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
const { invoiceId } = defineProps<{ invoiceId: string }>();
|
|
48
|
+
const id = useId();
|
|
49
|
+
const note = defineModel<string>('note', { default: '' });
|
|
50
|
+
|
|
51
|
+
watch(
|
|
52
|
+
() => invoiceId,
|
|
53
|
+
(nextId, _prev, onCleanup) => {
|
|
54
|
+
const controller = new AbortController();
|
|
55
|
+
onCleanup(() => controller.abort());
|
|
56
|
+
void fetchAuditLog(nextId, controller.signal);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
</script>
|
|
60
|
+
```
|
|
37
61
|
|
|
38
62
|
## Do/don't pairs
|
|
39
63
|
|
|
40
64
|
| Do | Don't |
|
|
41
65
|
|---|---|
|
|
42
66
|
| `<NuxtLink :to="`/invoice/${id}`">View invoice</NuxtLink>` | `<span @click="navigateTo(`/invoice/${id}`)">View invoice</span>` |
|
|
43
|
-
| `
|
|
44
|
-
|
|
|
45
|
-
| `
|
|
46
|
-
|
|
|
67
|
+
| `useState('filters', () => ({ ... }))` or Pinia store per request | Exporting a module-level `export const filters = ref(...)` in Nuxt SSR (cross-request state leak) |
|
|
68
|
+
| `await callOnce(() => store.bootstrap())` for SSR + hydration init | Running store bootstrap in setup without guarding against double execution |
|
|
69
|
+
| `const { status, error, refresh } = await useFetch(...)` rendered distinctly | Treating every non-success state as one spinner or mutating `shallowRef` fields in place |
|
|
70
|
+
| `<label :for="id">Search</label><input :id="id" v-model="q">` using `useId()` | Hardcoded duplicate IDs or `<input placeholder="Search">` without a label |
|
|
71
|
+
| `.server.vue` components for heavy read-only renderers | Shipping Markdown/syntax-highlighting libraries to the browser for static sections |
|
|
47
72
|
|
|
48
73
|
## Known traps
|
|
49
74
|
|
|
50
|
-
SSR
|
|
75
|
+
Cross-request SSR state leaks from module-level `ref()`, mutating Nuxt 4 `shallowRef` `useAsyncData` results in place, mixing Nuxt 3 root `layouts/` with Nuxt 4 `app/layouts/`, SSR hydration mismatch from browser-only state, teleport focus traps, uncancelled watchers causing race conditions, auto-import magic hiding ownership.
|
|
51
76
|
|
|
52
77
|
## Verification commands
|
|
53
78
|
|
|
@@ -56,7 +81,6 @@ npm run lint
|
|
|
56
81
|
npm run test -- --run
|
|
57
82
|
npm run build
|
|
58
83
|
npx playwright test
|
|
59
|
-
npx nuxi analyze 2>/dev/null || true
|
|
60
84
|
```
|
|
61
85
|
|
|
62
|
-
Browser rendering and keyboard/screen-reader inspection remain required for visual/a11y claims.
|
|
86
|
+
Run `npx nuxi analyze` interactively when inspecting client/server chunk sizes (`static`). Browser rendering and keyboard/screen-reader inspection remain required for visual/a11y claims (`rendered`).
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Web 3D and graphics engine alternatives
|
|
2
|
+
|
|
3
|
+
For Three.js (`WebGPURenderer` + TSL), React Three Fiber v9, and 2D/PixiJS/WebGPU selection, see [scene-architecture.md](scene-architecture.md), [r3f-integration.md](r3f-integration.md), and [rendering-choice.md](rendering-choice.md). Use this reference when selecting or implementing **`<model-viewer>`, Babylon.js, PlayCanvas, Threlte, TresJS, luma.gl, or regl** on browser surfaces. For embodied XR/VR/AR headset ergonomics, locomotion comfort, and spatial accessibility, use `pixelcraft-spatial`.
|
|
4
|
+
|
|
5
|
+
## Engine decision matrix
|
|
6
|
+
|
|
7
|
+
| Engine | Target framework / style | WebGPU support | Built-in extras | Best fit |
|
|
8
|
+
|---|---|---|---|---|
|
|
9
|
+
| **`<model-viewer>` (v4+)** | Standards Web Component (any stack) | Via Three.js | Orbit camera, poster, progressive loading, AR (`webxr scene-viewer quick-look`) | E-commerce / product 3D & AR previews without writing scene-graph code |
|
|
10
|
+
| **Babylon.js** | Framework-agnostic TypeScript | Yes (`WebGPUEngine`) | Full scene graph, PBR, GUI, spatial audio, Havok physics, WebXR helper | Complex interactive 3D apps, industrial configurators, simulations, and WebXR |
|
|
11
|
+
| **PlayCanvas** | JS/TS ECS + cloud/local editor | Yes | Lightweight runtime, physics, asset pipeline, collaborative visual editor | Web games, playable ads, high-FPS mobile 3D experiences |
|
|
12
|
+
| **Threlte (v8+)** | Svelte 5 declarative Three.js | Via Three.js | `@threlte/extras`, Rapier physics, `@threlte/gltf`, auto-disposal for `<T>` | Svelte / SvelteKit 3D interfaces |
|
|
13
|
+
| **TresJS (v5+)** | Vue 3 / Nuxt declarative Three.js | Via Three.js | `@tresjs/cientos`, `@tresjs/rapier`, `@tresjs/nuxt` | Vue / Nuxt 3D interfaces |
|
|
14
|
+
| **luma.gl (v9+)** | Low-level GPU library | Yes (WebGPU + WebGL2) | Compute shaders, buffer/pipeline abstraction (powers deck.gl) | Custom GPU data visualization and scientific rendering |
|
|
15
|
+
| **regl** | Functional stateless WebGL | WebGL 1 | Minimal command-based draw calls | Lightweight procedural shaders and custom 2D/3D experiments |
|
|
16
|
+
|
|
17
|
+
## Verified implementation idioms
|
|
18
|
+
|
|
19
|
+
### `<model-viewer>` (product 3D + AR)
|
|
20
|
+
|
|
21
|
+
Always supply `alt` (accessible name), `poster` (instant LCP image before GLB downloads), and `touch-action="pan-y"` (prevents vertical mobile scroll hijacking). Setting `ar-modes="webxr scene-viewer quick-look"` supports iOS Quick Look with on-the-fly USDZ conversion when `ios-src` is omitted.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<model-viewer
|
|
25
|
+
src="/models/chair.glb"
|
|
26
|
+
poster="/models/chair-poster.webp"
|
|
27
|
+
alt="Oak lounge chair in natural finish"
|
|
28
|
+
ar
|
|
29
|
+
ar-modes="webxr scene-viewer quick-look"
|
|
30
|
+
camera-controls
|
|
31
|
+
touch-action="pan-y"
|
|
32
|
+
shadow-intensity="1"
|
|
33
|
+
></model-viewer>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Babylon.js (tree-shaking, WebGPU + WebXR fallback)
|
|
37
|
+
|
|
38
|
+
- Import subpaths from `@babylonjs/core/*` rather than the monolithic `babylonjs` barrel to keep bundles tree-shakable.
|
|
39
|
+
- **WebGPU + WebXR (`XRGPUBinding`) caveat**: browser and headset support for WebGPU + WebXR bindings (`XRGPUBinding`) remains uneven across standalone headsets and browsers. Check both `await WebGPUEngine.IsSupportedAsync` and `typeof XRGPUBinding !== 'undefined'` when XR is required, and **automatically fall back to Babylon's WebGL 2 `Engine`** rather than failing XR initialization.
|
|
40
|
+
- For WebXR controller models under ES6 tree-shaking, import `@babylonjs/loaders/glTF` and `@babylonjs/core/Materials/Node/Blocks`. Always call `scene.dispose()` and `engine.dispose()` on unmount.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
44
|
+
import { WebGPUEngine } from '@babylonjs/core/Engines/webgpuEngine';
|
|
45
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
46
|
+
import '@babylonjs/core/XR/webXRDefaultExperience';
|
|
47
|
+
import '@babylonjs/loaders/glTF';
|
|
48
|
+
import '@babylonjs/core/Materials/Node/Blocks';
|
|
49
|
+
|
|
50
|
+
export async function createBabylonEngine(canvas: HTMLCanvasElement, needsXr: boolean) {
|
|
51
|
+
const canUseWebGpu =
|
|
52
|
+
(await WebGPUEngine.IsSupportedAsync) && (!needsXr || typeof XRGPUBinding !== 'undefined');
|
|
53
|
+
|
|
54
|
+
if (canUseWebGpu) {
|
|
55
|
+
const gpu = new WebGPUEngine(canvas, { xrCompatible: needsXr });
|
|
56
|
+
await gpu.initAsync();
|
|
57
|
+
return gpu;
|
|
58
|
+
}
|
|
59
|
+
return new Engine(canvas, true, { xrCompatible: needsXr });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Always dispose on unmount: scene.dispose(); engine.dispose();
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Threlte v8 (Svelte 5) & TresJS v5 (Vue 3)
|
|
66
|
+
|
|
67
|
+
- **Threlte v8**: wrap scene content in a child `Scene.svelte` inside `<Canvas>` so `useTask((delta) => ...)` accesses canvas context. Remember that automatic disposal only covers objects created by `<T.*>` components—manually dispose external textures/assets loaded outside `<T>`.
|
|
68
|
+
- **TresJS v5**: `useRenderLoop`, `useCamera`, `useSeek`, and `useTresReady` were **removed in v5**. Use `useLoop()` (`onBeforeRender` inside a child of `<TresCanvas>`, or `@loop` on `<TresCanvas>`), `useTres()` for camera access, and `useGraph()` for GLTF scene nodes.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// TresJS v5 (child component inside <TresCanvas>)
|
|
72
|
+
import { useLoop } from '@tresjs/core';
|
|
73
|
+
|
|
74
|
+
const { onBeforeRender } = useLoop();
|
|
75
|
+
onBeforeRender(({ delta }) => {
|
|
76
|
+
if (meshRef.value) meshRef.value.rotation.y += delta * 1.5;
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Do/don't pairs
|
|
81
|
+
|
|
82
|
+
| Do | Don't |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Use `<model-viewer>` with `poster`, `alt`, and `touch-action="pan-y"` for simple GLB product previews | Spin up a full Babylon.js or Three.js app just to orbit one product GLB |
|
|
85
|
+
| Fall back from `WebGPUEngine` to WebGL2 `Engine` when `XRGPUBinding` or WebGPU is unavailable | Assume `WebGPUEngine({ xrCompatible: true })` works on every WebXR headset/browser |
|
|
86
|
+
| Import `@babylonjs/core/*` subpaths and call `scene.dispose()` + `engine.dispose()` on unmount | Import the entire Babylon monolithic bundle or leak GPU contexts |
|
|
87
|
+
| Use `useLoop()` (`onBeforeRender`) and `useTres()` in TresJS v5 | Copy removed v4 `useRenderLoop()` or `useCamera()` snippets into TresJS v5 |
|
|
88
|
+
| Manually dispose external `useTexture` / loader assets in Threlte when unmounted | Assume Threlte auto-disposes textures created outside `<T.*>` |
|
|
89
|
+
|
|
90
|
+
## Verification commands
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
npm run build
|
|
94
|
+
npx playwright test
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Inspect chunk sizes (`static`), and verify poster-to-3D transition, mobile scroll (`touch-action`), GPU memory cleanup on navigation, and WebGPU/WebGL2/WebXR fallback in a real browser/device (`rendered`).
|