|
@@ -47,6 +47,7 @@
|
|
|
|
|
|
</scene>
|
|
</scene>
|
|
</renderer>
|
|
</renderer>
|
|
|
|
+ <Content v-if="content_data" :data="content_data" @onClose="onCloseContent" />
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<footer />
|
|
<footer />
|
|
@@ -66,6 +67,7 @@ import WaterFragment from 'assets/glsl/WaterFragment'
|
|
import Ground from './components/objects/Ground'
|
|
import Ground from './components/objects/Ground'
|
|
import Cube from './components/objects/Cube'
|
|
import Cube from './components/objects/Cube'
|
|
import Project from './components/objects/Project'
|
|
import Project from './components/objects/Project'
|
|
|
|
+import Content from './components/Content'
|
|
|
|
|
|
// const TWEEN = require('@tweenjs/tween.js')
|
|
// const TWEEN = require('@tweenjs/tween.js')
|
|
const _debug = false
|
|
const _debug = false
|
|
@@ -80,7 +82,8 @@ export default {
|
|
components: {
|
|
components: {
|
|
Cube,
|
|
Cube,
|
|
Project,
|
|
Project,
|
|
- Ground
|
|
|
|
|
|
+ Ground,
|
|
|
|
+ Content
|
|
},
|
|
},
|
|
mixins: [mixins],
|
|
mixins: [mixins],
|
|
data () {
|
|
data () {
|
|
@@ -188,7 +191,9 @@ export default {
|
|
interactive_objects: [],
|
|
interactive_objects: [],
|
|
light_opts: {
|
|
light_opts: {
|
|
castShadow: true
|
|
castShadow: true
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ opened_vnode: null,
|
|
|
|
+ content_data: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -267,10 +272,17 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onDocMouseup (e) {
|
|
onDocMouseup (e) {
|
|
- // console.log('onDocumentMouseup', e)
|
|
|
|
|
|
+ console.log('onDocumentMouseup', e)
|
|
// CONTROLS
|
|
// CONTROLS
|
|
this.controls.user_interact = false
|
|
this.controls.user_interact = false
|
|
|
|
|
|
|
|
+ // check if event is not a classic html link
|
|
|
|
+ if (e.target.className === 'close-btn') {
|
|
|
|
+ // console.log('close-btn: vnode', this.opened_vnode)
|
|
|
|
+ // this.opened_vnode.isOpened = false
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
// INTERACTIONS
|
|
// INTERACTIONS
|
|
this.updatedInteractiveObjects()
|
|
this.updatedInteractiveObjects()
|
|
|
|
|
|
@@ -290,7 +302,19 @@ export default {
|
|
// for (var i = 0; i < intersects.length; i++) {
|
|
// for (var i = 0; i < intersects.length; i++) {
|
|
object = intersects[0].object
|
|
object = intersects[0].object
|
|
vnode = object.userData.vnode
|
|
vnode = object.userData.vnode
|
|
|
|
+ if (object.name === 'Content' && vnode.isOpened) {
|
|
|
|
+ this.content_data = vnode.data
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // close precedent vnode
|
|
|
|
+ if (this.opened_vnode && this.opened_vnode.$options._componentTag === 'ContentBlock') {
|
|
|
|
+ // console.log('opened_vnode', this.opened_vnode)
|
|
|
|
+ this.opened_vnode.isOpened = false
|
|
|
|
+ }
|
|
|
|
+ // opene current vnode
|
|
vnode.isOpened = true
|
|
vnode.isOpened = true
|
|
|
|
+ // recorde vnode as precedent vnode
|
|
|
|
+ this.opened_vnode = vnode
|
|
|
|
|
|
toPos = { ...object.position }
|
|
toPos = { ...object.position }
|
|
if (object.name === 'Content') {
|
|
if (object.name === 'Content') {
|
|
@@ -354,6 +378,9 @@ export default {
|
|
|
|
|
|
// TWEENS
|
|
// TWEENS
|
|
TWEEN.update()
|
|
TWEEN.update()
|
|
|
|
+ },
|
|
|
|
+ onCloseContent () {
|
|
|
|
+ this.content_data = null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|