MSKY-77 (MisskeyIO#947)

This commit is contained in:
まっちゃてぃー。 2025-03-28 20:24:37 +09:00 committed by GitHub
parent abdaa18666
commit 1d6ea09aac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 91 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { defaultStore } from '@/store.js';
import { MisskeyEntity } from '@/types/date-separated-list.js';
import { isAprilFoolsDay } from '@/scripts/seasonal-events';
export default defineComponent({
props: {
@ -119,12 +120,16 @@ export default defineComponent({
};
function onBeforeLeave(element: Element) {
if (isAprilFoolsDay()) return;
const el = element as HTMLElement;
el.style.top = `${el.offsetTop}px`;
el.style.left = `${el.offsetLeft}px`;
}
function onLeaveCancelled(element: Element) {
if (isAprilFoolsDay()) return;
const el = element as HTMLElement;
el.style.top = '';
el.style.left = '';
@ -136,6 +141,7 @@ export default defineComponent({
[$style['date-separated-list-nogap']]: props.noGap,
[$style['direction-down']]: props.direction === 'down',
[$style['direction-up']]: props.direction === 'up',
[$style['april-fool']]: isAprilFoolsDay(),
};
return () => defaultStore.state.animation ? h(TransitionGroup, {
@ -210,6 +216,14 @@ export default defineComponent({
}
}
.direction-up.april-fool ,
.direction-down.april-fool {
&:global > .list-enter-from,
&:global > .list-leave-to {
animation: components-MkDateSeparatedList-spin-shrink 3s ease-in forwards;
}
}
.separator {
text-align: center;
}
@ -240,5 +254,16 @@ export default defineComponent({
.date-2-icon {
margin-left: 8px;
}
@keyframes spin-shrink {
0% {
transform: rotate(0deg) scale(1);
opacity: 1;
}
100% {
transform: rotate(2160deg) scale(0);
opacity: 0;
}
}
</style>