From 6f0b53c85d7cefe13ec886698795e23e464f233f Mon Sep 17 00:00:00 2001 From: yuki540 Date: Wed, 18 Apr 2018 11:14:16 +0900 Subject: [PATCH] =?UTF-8?q?update:=20=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=AE?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=82=92=E8=AA=BF=E6=95=B4=E3=81=99?= =?UTF-8?q?=E3=82=8B=E5=87=A6=E7=90=86=E3=82=92=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 | 3 +++ src/scripts/lib/util.js | 31 ++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/scripts/app.js b/src/scripts/app.js index 156906a..1969132 100644 --- a/src/scripts/app.js +++ b/src/scripts/app.js @@ -6,6 +6,9 @@ import preload_json from './config/preload' // components import './components/app.tag' +// init +util.setRingSize() + // loading util.startLoading(() => { util.preload(preload_json, () => { diff --git a/src/scripts/lib/util.js b/src/scripts/lib/util.js index 07ea6ee..52f5e23 100644 --- a/src/scripts/lib/util.js +++ b/src/scripts/lib/util.js @@ -1,13 +1,15 @@ -const root = document.getElementById('root') -const load_icon = document.querySelector('.load-view__body__panel__icon_type_4 .icon') -const load_view = document.querySelector('.load-view') -const load_view_body_close = document.querySelector('.load-view__body__close') -const gab_animation = document.querySelector('.gab-animation') +const root = document.getElementById('root') +const load_icon = document.querySelector('.load-view__body__panel__icon_type_4 .icon') +const load_view = document.querySelector('.load-view') +const load_view_body_close = document.querySelector('.load-view__body__close') +const gab_animation = document.querySelector('.gab-animation') const gab_animation__end_block = document.querySelector('.gab-animation__close .end-block') -const calling = document.querySelector('.calling') -const calling__end = document.querySelector('.calling__end') -const end_animation = document.querySelector('.end-animation') -const end_animation__end = document.querySelector('.end-animation .window img') +const calling = document.querySelector('.calling') +const calling__end = document.querySelector('.calling__end') +const end_animation = document.querySelector('.end-animation') +const end_animation__end = document.querySelector('.end-animation .window img') +const top_page = document.querySelector('.top-page') +const top_page__wrap = document.querySelector('.top-page .wrap') /** * 画像のプリロード @@ -54,6 +56,17 @@ export const isPC = () => { return !isSP() } +/** + * top-page__ringのサイズを設定 + */ +export const setRingSize = () => { + const default_size = 650 + const window_size = top_page.clientHeight + const per = window_size / default_size + + top_page__wrap.style.transform = `scale(${ per })` +} + /** * ロードの開始タイミングを取得 * @param fn : コールバック関数