update: スキップボタンの表示・アニメーションスキップ処理を実装
This commit is contained in:
parent
cabe6f9423
commit
104f9bbb56
@ -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 => {})
|
||||
})
|
||||
|
||||
|
||||
@ -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 : コールバック関数
|
||||
|
||||
Loading…
Reference in New Issue
Block a user