diff options
| author | adamhrv <adam@ahprojects.com> | 2019-01-29 22:20:57 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-01-29 22:20:57 +0100 |
| commit | edc5e1542071fdc1a18a2bb1af2c2b5bed8be02a (patch) | |
| tree | ea62bcba3e9e384c1e619af7fc63489443cab762 /client/splash/index.js | |
| parent | f7077a7cf80dc9454bf58f708642a68edfaadb13 (diff) | |
| parent | 78fbb43ae9726ee1f0ca7f4c27f4060a34763629 (diff) | |
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'client/splash/index.js')
| -rw-r--r-- | client/splash/index.js | 25 |
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) |
