mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-18 15:50:35 +01:00
ce4ea5071f
Resolve #7826
29 lines
747 B
TypeScript
29 lines
747 B
TypeScript
import { Directive } from 'vue';
|
|
import { defaultStore } from '@client/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;
|