update: 閉じるボタンの処理を実装
This commit is contained in:
parent
480815723f
commit
205566eec9
@ -9,6 +9,7 @@ import './components/app.tag'
|
|||||||
// init
|
// init
|
||||||
util.setRingSize()
|
util.setRingSize()
|
||||||
util.bindNav()
|
util.bindNav()
|
||||||
|
util.bindCloseBtn()
|
||||||
|
|
||||||
// loading
|
// loading
|
||||||
util.startLoading(() => {
|
util.startLoading(() => {
|
||||||
|
|||||||
@ -10,6 +10,7 @@ const end_animation = document.querySelector('.end-animation')
|
|||||||
const end_animation__end = document.querySelector('.end-animation .window img')
|
const end_animation__end = document.querySelector('.end-animation .window img')
|
||||||
const top_page = document.querySelector('.top-page')
|
const top_page = document.querySelector('.top-page')
|
||||||
const top_page__wrap = document.querySelector('.top-page .wrap')
|
const top_page__wrap = document.querySelector('.top-page .wrap')
|
||||||
|
const page_box = document.querySelector('.page-box')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 画像のプリロード
|
* 画像のプリロード
|
||||||
@ -68,7 +69,7 @@ export const setRingSize = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ナビゲーションボタンホバー時のイベント監視
|
* ナビゲーションボタンの各イベント監視
|
||||||
*/
|
*/
|
||||||
export const bindNav = () => {
|
export const bindNav = () => {
|
||||||
const navs = document.querySelectorAll('.top-page__global-nav a')
|
const navs = document.querySelectorAll('.top-page__global-nav a')
|
||||||
@ -84,6 +85,25 @@ export const bindNav = () => {
|
|||||||
nav.addEventListener('mouseout', e => {
|
nav.addEventListener('mouseout', e => {
|
||||||
top_page.setAttribute('data-color', '')
|
top_page.setAttribute('data-color', '')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/* click ----------------------------------------------------- */
|
||||||
|
nav.addEventListener('click', e => {
|
||||||
|
e.preventDefault()
|
||||||
|
const state = !(page_box.getAttribute('data-state') === 'true')
|
||||||
|
page_box.setAttribute('data-state', state)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ページを閉じるボタンのイベント監視
|
||||||
|
*/
|
||||||
|
export const bindCloseBtn = () => {
|
||||||
|
const close_btn = document.querySelector('.page-box__close-btn')
|
||||||
|
|
||||||
|
close_btn.addEventListener('click', e => {
|
||||||
|
e.preventDefault()
|
||||||
|
page_box.setAttribute('data-state', 'false')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user