mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-24 02:47:35 -07:00
14148f6c4a
Resolve #7779
29 lines
741 B
TypeScript
29 lines
741 B
TypeScript
import { Directive } from 'vue';
|
|
import { defaultStore } from '@/store';
|
|
|
|
export default {
|
|
mounted(el, binding, vn) {
|
|
if (!defaultStore.state.animation) return;
|
|
|
|
el.classList.add('_anime_bounce_standBy');
|
|
|
|
el.addEventListener('mousedown', () => {
|
|
el.classList.add('_anime_bounce_standBy');
|
|
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');
|
|
el.classList.add('_anime_bounce_standBy');
|
|
});
|
|
}
|
|
} as Directive;
|