This commit is contained in:
ThatOneCalculator 2023-05-22 17:26:27 -07:00
parent 79fe1dcd61
commit b5eb374e62
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 9 additions and 10 deletions

View file

@ -156,6 +156,14 @@ export default defineComponent({
} }
return h(MkSparkle, {}, genEl(token.children)); 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": { case "flip": {
const transform = const transform =
token.props.args.h && token.props.args.v token.props.args.h && token.props.args.v
@ -253,16 +261,6 @@ export default defineComponent({
style = `background-color: #${color};`; style = `background-color: #${color};`;
break; 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) { if (style == null) {
return h("span", {}, [ return h("span", {}, [

View file

@ -9,6 +9,7 @@ const animatedMfm = [
"jump", "jump",
"bounce", "bounce",
"rainbow", "rainbow",
"fade",
]; ];
export function extractMfmWithAnimation(nodes: mfm.MfmNode[]): string[] { export function extractMfmWithAnimation(nodes: mfm.MfmNode[]): string[] {