summaryrefslogtreecommitdiff
path: root/client/splash/face/index.js
diff options
context:
space:
mode:
authoradamhrv <adam@ahprojects.com>2019-01-29 22:20:57 +0100
committeradamhrv <adam@ahprojects.com>2019-01-29 22:20:57 +0100
commitedc5e1542071fdc1a18a2bb1af2c2b5bed8be02a (patch)
treeea62bcba3e9e384c1e619af7fc63489443cab762 /client/splash/face/index.js
parentf7077a7cf80dc9454bf58f708642a68edfaadb13 (diff)
parent78fbb43ae9726ee1f0ca7f4c27f4060a34763629 (diff)
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'client/splash/face/index.js')
-rw-r--r--client/splash/face/index.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/client/splash/face/index.js b/client/splash/face/index.js
index 31ce8f3b..46b7b847 100644
--- a/client/splash/face/index.js
+++ b/client/splash/face/index.js
@@ -16,10 +16,18 @@ export function startAnimation() {
const name = choice(names)
const face = faces[name]
mesh.remove()
- mesh.load(name).then(meshes => {
- meshes.wireframe.position.z -= 0.001
+ mesh.load(name).then(geometry => {
+ let meshes
markers.swap(face)
.then({
+ obj: {},
+ duration: 0,
+ finished: () => {
+ meshes = mesh.createFaceMeshes(geometry)
+ meshes.wireframe.position.z -= 0.001
+ }
+ })
+ .then({
from: { n: 0 },
to: { n: 1 },
duration: 500,
@@ -43,27 +51,31 @@ export function startAnimation() {
}
})
.then({
- from: { n: 0 },
- to: { n: 1 },
+ from: { n: 0, lines: 1, cubes: 1, },
+ to: { n: 1, lines: 0, cubes: 0.5 },
delay: 500,
duration: 1000,
easing: oktween.easing.quad_in,
update: (obj) => {
meshes.solid.material.opacity = 1 - obj.n
meshes.wireframe.material.opacity = obj.n
+ markers.fadePointsTo(obj.cubes)
+ markers.fadeLinesTo(obj.lines)
},
finished: () => {
mesh.removeMesh('solid')
}
})
.then({
- from: { n: 1 },
- to: { n: 0 },
+ from: { n: 1, lines: 0, cubes: 0 },
+ to: { n: 0, lines: 1, cubes: 1 },
delay: 5000,
duration: 500,
- easing: oktween.easing.quad_in_out,
+ easing: oktween.easing.quad_out,
update: (obj) => {
meshes.wireframe.material.opacity = obj.n
+ markers.fadePointsTo(obj.cubes)
+ markers.fadeLinesTo(obj.lines)
},
})
.then({