From 124a00e14d22bff52d11926143affe0ef5e6171a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 19 Apr 2019 14:31:45 +0200 Subject: slow zoom --- client/splash/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'client') diff --git a/client/splash/index.js b/client/splash/index.js index a21110f0..b07da1a1 100644 --- a/client/splash/index.js +++ b/client/splash/index.js @@ -9,6 +9,8 @@ import * as modal from './modal' import * as cloud from './cloud' import * as face from './face' +let interacted = false + const controls = new OrbitControls(camera, renderer.domElement) controls.maxDistance = camera.far / 2 controls.enableDamping = true @@ -39,6 +41,16 @@ function bind() { document.querySelector('.about').addEventListener('click', modal.close) document.querySelector('.close').addEventListener('click', modal.close) } + renderer.domElement.addEventListener('wheel', () => { + interacted = true + }, false) + renderer.domElement.addEventListener('mousedown', () => { + interacted = true + }, false) + renderer.domElement.addEventListener('touchstart', () => { + interacted = true + }, false) + camera.position.z = 1.17 } function animate() { @@ -46,6 +58,9 @@ function animate() { // camera.position.z += -0.0025 // camera.rotation.y += 0.00001 + if (!interacted && camera.position.z < 2.28) { + camera.position.z += 0.0025 + } controls.update() cloud.update() -- cgit v1.2.3-70-g09d2