Merge pull request #24 from yuki540net/feature/skip-button
Feature/skip button
This commit is contained in:
commit
b77d010f71
@ -47,6 +47,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main id="root">
|
<main id="root">
|
||||||
|
<!--********************************* skip button **************************************-->
|
||||||
|
<button id="skip-button">SKIP</button>
|
||||||
<!--********************************** load view ***************************************-->
|
<!--********************************** load view ***************************************-->
|
||||||
<section class="load-view">
|
<section class="load-view">
|
||||||
<div class="load-view__frame">
|
<div class="load-view__frame">
|
||||||
@ -309,7 +311,7 @@
|
|||||||
<div></div><div></div><div></div><div></div><div></div>
|
<div></div><div></div><div></div><div></div><div></div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<!--********************************** end-animation ***************************************-->
|
<!--********************************** end animation ***************************************-->
|
||||||
<section class="end-animation">
|
<section class="end-animation">
|
||||||
<section class="end-animation__end-roll">
|
<section class="end-animation__end-roll">
|
||||||
<div class="text-balls">
|
<div class="text-balls">
|
||||||
@ -341,7 +343,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<!--********************************** top-page ***************************************-->
|
<!--********************************** top page ***************************************-->
|
||||||
<section class="top-page">
|
<section class="top-page">
|
||||||
<section class="top-page__ring">
|
<section class="top-page__ring">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
@ -393,7 +395,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<!--********************************** page-box ***************************************-->
|
<!--********************************** page box ***************************************-->
|
||||||
<section class="page-box">
|
<section class="page-box">
|
||||||
<section class="page-box__bg"><div></div><div></div></section>
|
<section class="page-box__bg"><div></div><div></div></section>
|
||||||
<a class="page-box__close-btn" href="#">
|
<a class="page-box__close-btn" href="#">
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import riot from 'riot'
|
import riot from 'riot'
|
||||||
import route from 'riot-route'
|
|
||||||
import * as util from './lib/util'
|
import * as util from './lib/util'
|
||||||
import preload_json from './config/preload'
|
import preload_json from './config/preload'
|
||||||
import history_json from './config/history'
|
import history_json from './config/history'
|
||||||
@ -20,6 +19,7 @@ util.bindCloseBtn()
|
|||||||
util.startLoading(() => {
|
util.startLoading(() => {
|
||||||
util.preload(preload_json, () => {
|
util.preload(preload_json, () => {
|
||||||
util.finLoad()
|
util.finLoad()
|
||||||
|
util.showSkipButton()
|
||||||
}, data => {})
|
}, data => {})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -129,6 +129,34 @@ export const hiddenPage = () => {
|
|||||||
document.querySelector('.product-page').style.display = 'none'
|
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 : コールバック関数
|
* @param fn : コールバック関数
|
||||||
|
|||||||
71
src/scss/modules/_skip-button.scss
Normal file
71
src/scss/modules/_skip-button.scss
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
@include pc-layout {
|
||||||
|
#skip-button {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 50px; right: 0;
|
||||||
|
width: 160px; height: 60px;
|
||||||
|
background-color: $theme-mint;
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
font-size: 30px;
|
||||||
|
color: $theme-purple;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60px;
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,0.6);
|
||||||
|
transform: translateX(100%);
|
||||||
|
transition: all 0.3s ease 0s;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@include tablet-layout {
|
||||||
|
#skip-button {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 50px; right: 0;
|
||||||
|
width: 160px; height: 60px;
|
||||||
|
background-color: $theme-mint;
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
font-size: 30px;
|
||||||
|
color: $theme-purple;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60px;
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,0.6);
|
||||||
|
transform: translateX(100%);
|
||||||
|
transition: all 0.3s ease 0s;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@include sp-layout {
|
||||||
|
#skip-button {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 50px; right: 0;
|
||||||
|
width: 100px; height: 45px;
|
||||||
|
background-color: $theme-mint;
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: $theme-purple;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 45px;
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,0.6);
|
||||||
|
transform: translateX(100%);
|
||||||
|
transition: all 0.3s ease 0s;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#skip-button:hover {
|
||||||
|
color: #fff;
|
||||||
|
background-color: $theme-pink;
|
||||||
|
}
|
||||||
|
|
||||||
|
#skip-button[data-state="true"] {
|
||||||
|
transform: translateX(0%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#skip-button[data-state="false"] {
|
||||||
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user