summaryrefslogtreecommitdiff
path: root/client/splash/index.js
blob: 4e1683547791b21dcaeb83c19aa6243c8f5c9c5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import oktween from '../util/vendor/oktween'

import OrbitControls from 'three-orbitcontrols'

import { init, render, camera, renderer } from './renderer'

import * as cloud from './cloud'

const controls = new OrbitControls(camera, renderer.domElement)
controls.maxDistance = camera.far / 2
controls.enableDamping = true
controls.dampingFactor = 1 / 8
controls.rotateSpeed = 1 / 4
controls.zoomSpeed = 1
controls.keyPanSpeed = 1 / 2

function animate() {
  requestAnimationFrame(animate)

  camera.position.z += -0.0025
  camera.rotation.y += 0.00001

  controls.update()

  render()
}

function build() {
  init()
  cloud.init()
  animate()
}

document.addEventListener('DOMContentLoaded', build)