update: スキップボタンの表示・アニメーションスキップ処理を実装

This commit is contained in:
yuki540 2018-04-20 11:56:49 +09:00
parent cabe6f9423
commit 104f9bbb56
2 changed files with 29 additions and 1 deletions

View File

@ -1,5 +1,4 @@
import riot from 'riot'
import route from 'riot-route'
import * as util from './lib/util'
import preload_json from './config/preload'
import history_json from './config/history'
@ -20,6 +19,7 @@ util.bindCloseBtn()
util.startLoading(() => {
util.preload(preload_json, () => {
util.finLoad()
util.showSkipButton()
}, data => {})
})

View File

@ -129,6 +129,34 @@ export const hiddenPage = () => {
document.querySelector('.product-page').style.display = 'none'
}
/**
* スキップボタンの表示
*/
export const showSkipButton = () => {
const skip_button = document.getElementById('skip-button')
skip_button.setAttribute('data-state', 'true')
/* click ---------------------------------------------------------------- */
skip_button.addEventListener('click', e => {
e.target.setAttribute('data-state', 'false')
skipAnimation()
})
setTimeout(() => { skip_button.setAttribute('data-state', 'false') }, 5000)
}
/**
* アニメーションをスキップ
*/
export const skipAnimation = () => {
if(load_view) root.removeChild(load_view)
if(gab_animation) root.removeChild(gab_animation)
if(calling) root.removeChild(calling)
if(end_animation) root.removeChild(end_animation)
top_page.setAttribute('data-state', 'start')
}
/**
* ロードの開始タイミングを取得
* @param fn : コールバック関数