fix(h5): center score stack, lock profile scroll and gate turn guidance

This commit is contained in:
xsl
2026-10-12 23:48:11 +08:00
parent 2a49ebdab2
commit 6f83f58a09
17 changed files with 1396 additions and 969 deletions
+8 -1
View File
@@ -6,7 +6,14 @@ const path = require('node:path');
const source = fs.readFileSync(path.join(__dirname, '../js/app.js'), 'utf8');
function extract(name) { return source.split('/* ' + name + '-begin */')[1].split('/* ' + name + '-end */')[0]; }
const context = {};
vm.runInNewContext(extract('camera-outline-pure') + extract('camera-haptic-pure'), context);
vm.runInNewContext(extract('camera-outline-pure') + extract('camera-haptic-pure') + extract('camera-hint-stage-pure'), context);
for (const hint of ['请向左转头', '请向右转头']) {
assert.equal(context.captureStageHint(hint, 'front', false), '请正对屏幕');
assert.equal(context.captureStageHint(hint, 'front', true), '请正对屏幕');
assert.equal(context.captureStageHint(hint, 'right', false), '请正对屏幕');
assert.equal(context.captureStageHint(hint, 'right', true), hint);
}
assert.equal(context.captureStageHint('请靠近一点', 'front', false), '请靠近一点');
const geometry = { window: {} };
vm.runInNewContext(fs.readFileSync(path.join(__dirname, '../js/camera-geometry.js'), 'utf8'), geometry);
const original = JSON.stringify(geometry.window.CameraGeometry);