summaryrefslogtreecommitdiff
path: root/client/splash/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/splash/index.js')
-rw-r--r--client/splash/index.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/client/splash/index.js b/client/splash/index.js
index 88211337..322ed0ff 100644
--- a/client/splash/index.js
+++ b/client/splash/index.js
@@ -1,8 +1,11 @@
import { Vector3 } from 'three'
import OrbitControls from 'three-orbitcontrols'
-import { init, render, camera, renderer } from './renderer'
+import { appendRenderer, render, camera, renderer } from './renderer'
+import { toArray } from '../util'
+
+import * as modal from './modal'
import * as cloud from './cloud'
import * as face from './face'
@@ -14,11 +17,25 @@ controls.rotateSpeed = 1 / 4
controls.zoomSpeed = 1
controls.keyPanSpeed = 1 / 2
+function init() {
+ build()
+ bind()
+ animate()
+}
+
function build() {
- init()
+ appendRenderer()
cloud.init()
face.init()
- animate()
+}
+
+function bind() {
+ toArray(document.querySelectorAll('.aboutLink')).forEach(el => {
+ el.addEventListener('click', modal.open)
+ })
+ document.querySelector('.about .inner').addEventListener('click', e => e.stopPropagation())
+ document.querySelector('.about').addEventListener('click', modal.close)
+ document.querySelector('.close').addEventListener('click', modal.close)
}
function animate() {
@@ -37,4 +54,4 @@ function animate() {
render()
}
-document.addEventListener('DOMContentLoaded', build)
+document.addEventListener('DOMContentLoaded', init)