diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index 7275c66873..d9d78846e5 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -156,6 +156,14 @@ export default defineComponent({ } return h(MkSparkle, {}, genEl(token.children)); } + case "fade": { + const direction = token.props.args.out + ? "alternate-reverse" + : "alternate"; + const speed = validTime(token.props.args.speed) || "1.5s"; + style = `animation: mfm-fade ${speed} linear infinite; animation-direction: ${direction};`; + break; + } case "flip": { const transform = token.props.args.h && token.props.args.v @@ -253,16 +261,6 @@ export default defineComponent({ style = `background-color: #${color};`; break; } - case "fade": { - const direction = token.props.args.out - ? "alternate-reverse" - : "alternate"; - const speed = validTime(token.props.args.speed) || "1.5s"; - style = - this.$store.state.animatedMfm && !reducedMotion() - ? `animation: mfm-fade ${speed} linear infinite; animation-direction: ${direction};` - : ""; - } } if (style == null) { return h("span", {}, [ diff --git a/packages/client/src/scripts/extract-mfm.ts b/packages/client/src/scripts/extract-mfm.ts index c70d1e7b83..c62547cdbc 100644 --- a/packages/client/src/scripts/extract-mfm.ts +++ b/packages/client/src/scripts/extract-mfm.ts @@ -9,6 +9,7 @@ const animatedMfm = [ "jump", "bounce", "rainbow", + "fade", ]; export function extractMfmWithAnimation(nodes: mfm.MfmNode[]): string[] {