mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-17 11:08:58 +01:00
40 lines
1,020 B
TypeScript
40 lines
1,020 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { Directive } from 'vue';
|
|
import { defaultStore } from '@/store.js';
|
|
|
|
export default {
|
|
mounted(el: HTMLElement, binding, vn) {
|
|
if (!defaultStore.state.animation) return;
|
|
|
|
const target = el.children[0];
|
|
|
|
if (target == null) return;
|
|
|
|
target.classList.add('_anime_bounce_standBy');
|
|
|
|
el.addEventListener('mousedown', () => {
|
|
target.classList.remove('_anime_bounce');
|
|
|
|
target.classList.add('_anime_bounce_standBy');
|
|
target.classList.add('_anime_bounce_ready');
|
|
|
|
target.addEventListener('mouseleave', () => {
|
|
target.classList.remove('_anime_bounce_ready');
|
|
});
|
|
});
|
|
|
|
el.addEventListener('click', () => {
|
|
target.classList.add('_anime_bounce');
|
|
target.classList.remove('_anime_bounce_ready');
|
|
});
|
|
|
|
el.addEventListener('animationend', () => {
|
|
target.classList.remove('_anime_bounce');
|
|
target.classList.add('_anime_bounce_standBy');
|
|
});
|
|
},
|
|
} as Directive;
|