yumechi-no-kuni/packages/client/src/directives/click-anime.ts

32 lines
751 B
TypeScript
Raw Normal View History

2021-04-23 01:33:33 -05:00
import { Directive } from 'vue';
2021-11-11 11:02:25 -06:00
import { defaultStore } from '@/store';
2021-04-23 01:33:33 -05:00
export default {
mounted(el, binding, vn) {
2022-03-06 08:21:19 -06:00
/*
if (!defaultStore.state.animation) return;
2021-04-24 04:38:38 -05:00
el.classList.add('_anime_bounce_standBy');
2021-04-23 01:33:33 -05:00
el.addEventListener('mousedown', () => {
2021-04-24 04:38:38 -05:00
el.classList.add('_anime_bounce_standBy');
2021-04-23 01:33:33 -05: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 04:38:38 -05:00
el.classList.add('_anime_bounce_standBy');
2021-04-23 01:33:33 -05:00
});
2022-03-06 08:21:19 -06:00
*/
2021-04-23 01:33:33 -05:00
}
} as Directive;