关于 platform-building
面向构建类系统开发者的跨平台输入与无障碍模式技能,涵盖移动触控、VR 控制和视觉及感官反馈。
主要功能
- 01移动手势建造控制
- 02VR 手部与控制器输入
- 03色盲模式与对比度设置
- 04屏幕阅读器集成模式
- 05平台能力检测
适用场景
- 01为移动端建造加入触控操作
- 02设计降低眩晕与疲劳的 VR 建造
- 03为关键视觉反馈提供替代方案
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ bbeierle12/ skill-mcp-claude --skill platform-building安装后在 Claude Code 中输入/platform-building确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
_meta.jsonreferences/platform-considerations.mdscripts/accessibility-config.jstouch-build-controller.jsvr-building-adapter.js详细介绍
平台构建
用于构建系统的触控操作、VR 输入和无障碍设计模式。
快速开始
import { TouchBuildController } from './scripts/touch-build-controller.js';
import { VRBuildingAdapter } from './scripts/vr-building-adapter.js';
import { AccessibilityConfig } from './scripts/accessibility-config.js';
// Mobile touch building
const touch = new TouchBuildController(canvas, {
doubleTapToPlace: true,
pinchToRotate: true,
swipeToChangePiece: true
});
touch.onPlace = (position, rotation) => buildingSystem.place(position, rotation);
touch.onRotate = (angle) => ghost.rotate(angle);
// VR building with hand tracking
const vr = new VRBuildingAdapter(xrSession, {
dominantHand: 'right',
snapToGrid: true,
comfortMode: true // Reduces motion sickness
});
vr.onGrab = (piece) => selection.select(piece);
vr.onRelease = (position) => buildingSystem.place(position);
// Accessibility configuration
const a11y = new AccessibilityConfig({
colorblindMode: 'deuteranopia', // red-green
highContrast: true,
screenReaderHints: true
});
// Apply to ghost preview
ghost.setColors(a11y.getValidityColors());
参考资料
请参阅 references/platform-considerations.md,了解:
- 移动端手势模式(Fortnite Mobile、Minecraft PE)
- VR 构建研究和舒适度指南
- 色盲配色建议
- 屏幕阅读器集成模式
- 跨平台输入抽象
脚本
| 文件 | 行数 | 用途 |
|---|---|---|
touch-build-controller.js | ~450 | 移动端手势:点击、拖动、捏合、滑动 |
vr-building-adapter.js | ~400 | VR 手部/控制器输入、舒适度设置 |
accessibility-config.js | ~350 | 色盲模式、对比度、屏幕阅读器 |
平台检测
// Detect platform capabilities
const platform = {
isMobile: /Android|iPhone|iPad|iPod/i.test(navigator.userAgent),
isTouch: 'ontouchstart' in window,
isVR: navigator.xr !== undefined,
prefersReducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
prefersHighContrast: window.matchMedia('(prefers-contrast: more)').matches
};
// Initialize appropriate controllers
if (platform.isVR && xrSession) {
setupVRControls();
} else if (platform.isTouch) {
setupTouchControls();
} else {
setupMouseKeyboard();
}
移动端注意事项
Fortnite Mobile 展示了有效的触控构建方式,包括可自定义的 HUD、自动材质选择和基于手势的部件旋转。关键模式包括专用的构建模式切换、大尺寸触控目标(最小 44 px),以及针对所有操作的视觉反馈。
VR 注意事项
VR 构建需要关注舒适度。步进旋转可减轻晕动症,手臂可及范围内的构建距离可避免疲劳。手部追踪支持直观的抓取和放置,而使用控制器构建时,激光指示器有助于选择远处的部件。
无障碍设计模式
Valheim 使用蓝色/黄色而非绿色/红色来显示稳定性指标,方便红绿色盲(最常见的色盲类型)用户识别。高对比度模式应将关键指标的对比度设为 7:1,且所有视觉反馈都应提供音频/触觉替代方式。
评论
支持 Markdown