From 104f9bbb5654df34a95800506a8dcd39a5b145db Mon Sep 17 00:00:00 2001 From: yuki540 Date: Fri, 20 Apr 2018 11:56:49 +0900 Subject: [PATCH] =?UTF-8?q?update:=20=E3=82=B9=E3=82=AD=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=83=BB?= =?UTF-8?q?=E3=82=A2=E3=83=8B=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=AD=E3=83=83=E3=83=97=E5=87=A6=E7=90=86=E3=82=92?= =?UTF-8?q?=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/app.js | 2 +- src/scripts/lib/util.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/scripts/app.js b/src/scripts/app.js index 0b73cdd..d44e636 100644 --- a/src/scripts/app.js +++ b/src/scripts/app.js @@ -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 => {}) }) diff --git a/src/scripts/lib/util.js b/src/scripts/lib/util.js index 10a06d7..056e2b6 100644 --- a/src/scripts/lib/util.js +++ b/src/scripts/lib/util.js @@ -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 : コールバック関数