Skip to content

Commit bcfdb19

Browse files
committed
chore: bigger border
1 parent 97591ba commit bcfdb19

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body {
77
@apply absolute w-full h-full pointer-events-none overflow-hidden left-0 top-0;
88
}
99
.draggable-photo {
10-
@apply absolute pointer-events-auto bg-contain bg-no-repeat cursor-grab opacity-0 animate-[fadeIn_0.3s_ease_forwards] active:cursor-grabbing active:z-[1000];
10+
@apply absolute pointer-events-auto bg-contain bg-no-repeat cursor-grab opacity-0 animate-[fadeIn_0.3s_ease_forwards] active:cursor-grabbing will-change-transform;
1111
filter: drop-shadow(4px 0 0 #eee) drop-shadow(-4px 0 0 #eee)
1212
drop-shadow(0 4px 0 #eee) drop-shadow(0 -4px 0 #eee);
1313

src/components/BookScene.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class BookScene {
4141

4242
private initialCameraOffset = isDev() ? new THREE.Vector3(0, 0, 0) : new THREE.Vector3(5, -5, -4);
4343
private initialCameraUp = isDev() ? new THREE.Vector3(0, 1, 0) : new THREE.Vector3(-2, 3, 3);
44+
// FIXME: mobile dev 视角有问题
4445

4546
public openingAnimationStatus: 'none' | 'playing' | 'played' = isDev() ? 'played' : 'none';
4647

@@ -67,8 +68,6 @@ export class BookScene {
6768
this.videoOverlayManager
6869
);
6970

70-
this.handleResize(); //FIXME: 现在这个 handleResize 不可以放在后面执行
71-
7271
this.renderer.setSize(container.clientWidth, container.clientHeight);
7372
this.renderer.toneMapping = THREE.NoToneMapping;
7473
this.renderer.localClippingEnabled = true;
@@ -79,6 +78,9 @@ export class BookScene {
7978
this.setUpLight();
8079
// this.setupLightControls();
8180

81+
this.handleResize(); //FIXME: 现在这个 handleResize 不可以放在后面执行
82+
window.addEventListener('resize', () => this.handleResize());
83+
8284
this.camera.position.add(this.initialCameraOffset);
8385
this.camera.up.copy(this.initialCameraUp);
8486
this.camera.lookAt(0, 0, 0);
@@ -87,7 +89,6 @@ export class BookScene {
8789
// const axesHelper = new THREE.AxesHelper(5);
8890
// this.scene.add(axesHelper);
8991

90-
window.addEventListener('resize', () => this.handleResize());
9192
}
9293

9394
private setUpLight() {

src/components/IconManager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,9 @@ export class IconManager {
213213
let newY = clientY - offsetY;
214214

215215
const containerRect = this.photoContainer.getBoundingClientRect();
216-
const elRect = el.getBoundingClientRect();
217216

218-
newX = Math.max(0, Math.min(newX, containerRect.width - elRect.width));
219-
newY = Math.max(0, Math.min(newY, containerRect.height - elRect.height));
217+
newX = Math.max(-el.clientWidth, Math.min(newX, containerRect.width));
218+
newY = Math.max(-el.clientHeight, Math.min(newY, containerRect.height));
220219

221220
el.style.left = `${ newX }px`;
222221
el.style.top = `${ newY }px`;

0 commit comments

Comments
 (0)