Skip to content

Commit

Permalink
FEATURE(snowfall-space): Added a new chapter placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
SuneBear committed May 2, 2022
1 parent 8b1fae3 commit 07097ca
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template lang="pug">
transition( name="el-fade-in" appear)
.tsi-snowfall-space
.loading-wrapper ❄️ Loading...
iframe(
:src="cineShaderUrl"
allow="xr-spatial-tracking"
frameborder="0"
)
</template>

<script>
// @TODO: Replace CineShader iframe with local scene
export default {
data() {
return {
cineShaderUrl: 'https://cineshader.com/view/slfBW2'
}
}
}
</script>

<style lang="stylus">
.tsi-snowfall-space
width: 100%
height: 100%
transition: all 1000ms
.loading-wrapper
position absolute
top: 50%
left: 50%
transform: translate3d(-50%, -50%, 0)
color: secondary(50)
iframe
pointer-events: initial
mask-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 1) 20%,
rgba(0, 0, 0, 1) 80%,
rgba(0, 0, 0, 0.5) 99%,
rgba(0, 0, 0, 0) 100%
)
mask-size: 100% 100%
width: 100%
height: 100%
</style>
4 changes: 4 additions & 0 deletions components/sketches/the-sinking-isle/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
)
tsi-chapter-control
tsi-inventory
//- Chapters
tsi-the-origin(
v-if="currentChapter === 'theOrigin'"
)
tsi-snowfall-space(
v-else-if="currentChapter === 'snowfallSpace'"
)
.dom-renderer( ref="domRenderer" )
cear-story.is-absolute-center(
:class="{ 'is-show': !isShowMainMenu }"
Expand Down
24 changes: 15 additions & 9 deletions components/sketches/the-sinking-isle/modules/chapter.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Module from './base'

import { MainChapter } from './chapters/main.chapter'
import { SuneBearHomeChapter } from './chapters/sune-bear-home.chapter'
import { SnowfallSpaceChapter } from './chapters/snowfall-space.chapter'
import { TheOriginChapter } from './chapters/the-origin.chapter'

import postVertexShader from '../shaders/base.vert'
Expand All @@ -26,11 +27,11 @@ export default class ChapterModule extends Module {
}

get $lastChapter() {
return this.chapters.find(el => el.name === this.lastChapter)
return this.chapters.find((el) => el.name === this.lastChapter)
}

get $currentChapter() {
return this.chapters.find(el => el.name === this.currentChapter)
return this.chapters.find((el) => el.name === this.currentChapter)
}

setupRender() {
Expand All @@ -43,9 +44,9 @@ export default class ChapterModule extends Module {
time: { value: 0 },

// @REF: https://tympanus.net/Development/webGLImageTransitions/index.html
width: { value: 4, },
scaleX: { value: 4.5, },
scaleY: { value: 5, },
width: { value: 4 },
scaleX: { value: 4.5 },
scaleY: { value: 5 },

resolution: {
value: new THREE.Vector4(1, 1, 1, 1)
Expand Down Expand Up @@ -89,8 +90,13 @@ export default class ChapterModule extends Module {
}

setupChapters() {
const chapterClasses = [MainChapter, SuneBearHomeChapter, TheOriginChapter]
chapterClasses.map(Class => {
const chapterClasses = [
MainChapter,
SuneBearHomeChapter,
SnowfallSpaceChapter,
TheOriginChapter
]
chapterClasses.map((Class) => {
const ins = new Class({ sketch: this })
this.chapters.push(ins)
})
Expand All @@ -109,7 +115,7 @@ export default class ChapterModule extends Module {
return
}

if (!this.chapters.find(el => el.name === chapter)) {
if (!this.chapters.find((el) => el.name === chapter)) {
console.warn(`Chapter: ${chapter} was invalid name`)
}

Expand Down Expand Up @@ -140,7 +146,7 @@ export default class ChapterModule extends Module {
resize() {
const { width, height } = this.sizes
this.renderer.setSize(width, height)
this.chapters.map(el => el.resize && el.resize(width, height))
this.chapters.map((el) => el.resize && el.resize(width, height))
}

update(delta, elapsed) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Chapter } from './base'

export class SnowfallSpaceChapter extends Chapter {

constructor (options) {
super(options)

this.name = 'snowfallSpace'
}

async afterEntered() {
super.afterEntered()
this.$vm.$message.error(this.$vm.$t('tsi.snowfallSpace.wip'))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class EnviromentBuildings extends Module {
position: new THREE.Vector3(0.8, 4, 2),
needAnimateY: true,
onOpened: () => {
this.$vm.$message.error(this.$vm.$t('tsi.snowfallSpace.closing'))
this.$vm.currentChapter = 'snowfallSpace'
}
}
})
Expand Down
4 changes: 4 additions & 0 deletions content/memoir/memoir-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ timeline:
title: '🦠 武汉因新冠疫情封城,在老家避难 3 个月'
tags: [ 'covid-19' ]

- date: '2022-04-27'
title: '🚑 上海封城期间,低血糖晕厥,人生第一次坐救护车'
tags: [ 'covid-19', 'ambulance' ]

- date: '2043-02-10'
title: '✨ 希望这时能有一些完整的交互作品,以及不要再见证历史了'
tags: [ 'wish' ]
Expand Down
3 changes: 2 additions & 1 deletion locales/zh-Hans.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default {
'tsi.menu.setting': '设置',
'tsi.menu.sound': '声音',
'tsi.menu.map': '地图',
'tsi.snowfallSpace.intro': '雪花如叶子一般独特,却同柳絮一样转瞬即逝 \n 来*❄雪花落语❄*倾听它的声音',

"tsi.building.suneBearHome": "舒乐熊之屋",
"tsi.building.snowfallSpace": "雪花落语",
Expand All @@ -28,7 +27,9 @@ export default {
'tsi.wishInput.storyMessage': '{text} \n <text-meta>第一次点亮@花火灯塔</text-meta>',
'tsi.wishInput.storyMessageBearReply': '祝福你',

'tsi.snowfallSpace.intro': '雪花如叶子一般独特,却同柳絮一样转瞬即逝 \n 来*❄雪花落语❄*倾听它的声音',
'tsi.snowfallSpace.closing': '由于疫情原因,展会暂时关闭 :(',
'tsi.snowfallSpace.wip': '展会正在策划中,当前展示仅为测试效果',

'tsi.chapter-shb.needKey': '箱子钥匙掉到湖中了,无法打开~',
'tsi.chapter-shb.notThatKey': '并不是这把钥匙~',
Expand Down

1 comment on commit 07097ca

@vercel
Copy link

@vercel vercel bot commented on 07097ca May 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.