update: ナビボタンのマウスイベントを監視する処理を実装
This commit is contained in:
parent
f081f07613
commit
c644125354
@ -8,6 +8,7 @@ import './components/app.tag'
|
||||
|
||||
// init
|
||||
util.setRingSize()
|
||||
util.bindNav()
|
||||
|
||||
// loading
|
||||
util.startLoading(() => {
|
||||
|
||||
@ -67,6 +67,26 @@ export const setRingSize = () => {
|
||||
top_page__wrap.style.transform = `scale(${ per })`
|
||||
}
|
||||
|
||||
/**
|
||||
* ナビゲーションボタンホバー時のイベント監視
|
||||
*/
|
||||
export const bindNav = () => {
|
||||
const navs = document.querySelectorAll('.top-page__global-nav a')
|
||||
|
||||
navs.forEach((nav, key) => {
|
||||
/* mouseover ------------------------------------------------- */
|
||||
nav.addEventListener('mouseover', e => {
|
||||
const color = e.target.getAttribute('data-color')
|
||||
top_page.setAttribute('data-color', color)
|
||||
})
|
||||
|
||||
/* mouseout -------------------------------------------------- */
|
||||
nav.addEventListener('mouseout', e => {
|
||||
top_page.setAttribute('data-color', '')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* ロードの開始タイミングを取得
|
||||
* @param fn : コールバック関数
|
||||
|
||||
Loading…
Reference in New Issue
Block a user