summaryrefslogtreecommitdiff
path: root/client/splash/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-27 19:10:16 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-27 19:10:16 +0100
commit618af6682e6de7662da961abd7e7de3a2f996bac (patch)
tree6595cb673033c194d8e3b6d2bc91ed6a3dd8d160 /client/splash/index.js
parent215b201bdc4d2ddcc36c83c86b6e8133d5ad4add (diff)
render smaller tag cloud
Diffstat (limited to 'client/splash/index.js')
-rw-r--r--client/splash/index.js38
1 files changed, 31 insertions, 7 deletions
diff --git a/client/splash/index.js b/client/splash/index.js
index aee394bf..4e168354 100644
--- a/client/splash/index.js
+++ b/client/splash/index.js
@@ -1,10 +1,34 @@
-import * as THREE from 'three'
-import { MeshLine, MeshLineMaterial } from 'three.meshline'
-import TextSprite from 'three.textsprite'
-
import oktween from '../util/vendor/oktween'
-import DRACOLoader from '../util/vendor/DRACOLoader'
-import GeometryHelper from '../util/vendor/geometryHelper'
-DRACOLoader.setDecoderPath('/assets/js/vendor/draco/')
+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)