2021-04-23 00:33:33 -06:00
|
|
|
import { Directive } from 'vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
mounted(el, binding, vn) {
|
2021-04-24 03:38:38 -06:00
|
|
|
el.classList.add('_anime_bounce_standBy');
|
|
|
|
|
2021-04-23 00:33:33 -06:00
|
|
|
el.addEventListener('mousedown', () => {
|
2021-04-24 03:38:38 -06:00
|
|
|
el.classList.add('_anime_bounce_standBy');
|
2021-04-23 00:33:33 -06:00
|
|
|
el.classList.add('_anime_bounce_ready');
|
|
|
|
|
|
|
|
el.addEventListener('mouseleave', () => {
|
|
|
|
el.classList.remove('_anime_bounce_ready');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
el.addEventListener('click', () => {
|
|
|
|
el.classList.add('_anime_bounce');
|
|
|
|
});
|
|
|
|
|
|
|
|
el.addEventListener('animationend', () => {
|
|
|
|
el.classList.remove('_anime_bounce_ready');
|
|
|
|
el.classList.remove('_anime_bounce');
|
2021-04-24 03:38:38 -06:00
|
|
|
el.classList.add('_anime_bounce_standBy');
|
2021-04-23 00:33:33 -06:00
|
|
|
});
|
|
|
|
}
|
|
|
|
} as Directive;
|