update: end-animationの開始〜終了処理を実装

This commit is contained in:
yuki540 2018-04-17 21:00:42 +09:00
parent 9f992d41fc
commit f540cfa143

View File

@ -6,6 +6,8 @@ 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')
/**
* 画像のプリロード
@ -98,6 +100,18 @@ export const startCalling = () => {
calling__end.addEventListener('animationend', e => {
if(e.animationName === 'calling__end') {
root.removeChild(calling)
startEndAnimation()
}
})
}
/**
* end-animationの開始
*/
export const startEndAnimation = () => {
end_animation.setAttribute('data-state', 'start')
end_animation__end.addEventListener('animationend', e => {
root.removeChild(end_animation)
})
}