Prevent text selection and restrict globe/camera controls

Disable copy, cut, and context menu site-wide, and limit Cesium
camera input to left-drag rotation and wheel zoom only. Also speed
up page flip animation from 1.3s to 0.6s with an ease-out curve for
a snappier feel.
This commit is contained in:
2026-09-18 21:39:11 +08:00
parent 13d3ef180a
commit 94fde7942f
4 changed files with 23 additions and 5 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import { ENTRIES } from '../data/entries.js';
import { PAGE_W, PAGE_H, HOLE_U, getPageTextures } from '../textures/pages.js';
import { clamp, easeInOutQuint } from '../utils/easing.js';
import { clamp, easeOutCubic } from '../utils/easing.js';
const RING_R = 0.085;
const RING_TUBE = 0.0115;
@@ -481,13 +481,13 @@ export class Binder {
flipForward() {
if (!this.canFlipForward()) return;
this.flip = { index: this.current, from: 0, to: -Math.PI, t: 0, duration: 1.3 };
this.flip = { index: this.current, from: 0, to: -Math.PI, t: 0, duration: 0.6 };
this.pages[this.current].group.position.z = 0.006;
}
flipBackward() {
if (!this.canFlipBackward()) return;
this.flip = { index: this.current - 1, from: -Math.PI, to: 0, t: 0, duration: 1.3 };
this.flip = { index: this.current - 1, from: -Math.PI, to: 0, t: 0, duration: 0.6 };
this.pages[this.current - 1].group.position.z = 0.006;
}
@@ -496,7 +496,7 @@ export class Binder {
const f = this.flip;
f.t += dt / f.duration;
const k = clamp(f.t, 0, 1);
const e = easeInOutQuint(k);
const e = easeOutCubic(k);
const angle = f.from + (f.to - f.from) * e;
const p = this.pages[f.index];