diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-19 14:31:45 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-19 14:31:45 +0200 |
| commit | 124a00e14d22bff52d11926143affe0ef5e6171a (patch) | |
| tree | b5d1808fe832d7b584b55fb0ee8024cbef69adb7 /client/splash/index.js | |
| parent | bf07955538ff20c89eeb2750cce6abb6019323b7 (diff) | |
slow zoom
Diffstat (limited to 'client/splash/index.js')
| -rw-r--r-- | client/splash/index.js | 15 |
1 files changed, 15 insertions, 0 deletions
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() |
