{{ $ts._mfm.sparkleDescription }}
+diff --git a/assets/client/sparkle-spritesheet.png b/assets/client/sparkle-spritesheet.png
new file mode 100644
index 0000000000..0defccaf07
Binary files /dev/null and b/assets/client/sparkle-spritesheet.png differ
diff --git a/locales/en-US.yml b/locales/en-US.yml
index 5d33e35f5e..4d11ac1f45 100644
--- a/locales/en-US.yml
+++ b/locales/en-US.yml
@@ -899,6 +899,8 @@ _mfm:
fontDescription: "Sets the font to display contents in."
rainbow: "Rainbow"
rainbowDescription: "Makes the content appear in rainbow colors."
+ sparkle: "Sparkle"
+ sparkleDescription: "Infuses a sparkling animation"
_reversi:
reversi: "Reversi"
gameSettings: "Game settings"
diff --git a/src/client/components/mfm.ts b/src/client/components/mfm.ts
index c248f934df..a228ca4b8d 100644
--- a/src/client/components/mfm.ts
+++ b/src/client/components/mfm.ts
@@ -8,6 +8,7 @@ import { concat } from '@client/../prelude/array';
import MkFormula from '@client/components/formula.vue';
import MkCode from '@client/components/code.vue';
import MkGoogle from '@client/components/google.vue';
+import MkSparkle from '@client/components/sparkle.vue';
import MkA from '@client/components/global/a.vue';
import { host } from '@client/config';
@@ -169,6 +170,19 @@ export default defineComponent({
style = this.$store.state.animatedMfm ? 'animation: mfm-rainbow 1s linear infinite;' : '';
break;
}
+ case 'sparkle': {
+ if (!this.$store.state.animatedMfm) {
+ return genEl(token.children);
+ }
+ let count = token.props.args.count ? parseInt(token.props.args.count) : 10;
+ if (count > 100) {
+ count = 100;
+ }
+ const speed = token.props.args.speed ? parseFloat(token.props.args.speed) : 1;
+ return h(MkSparkle, {
+ count, speed,
+ }, genEl(token.children));
+ }
}
if (style == null) {
return h('span', {}, ['[', token.props.name, ...genEl(token.children), ']']);
diff --git a/src/client/components/sparkle.vue b/src/client/components/sparkle.vue
new file mode 100644
index 0000000000..942412b445
--- /dev/null
+++ b/src/client/components/sparkle.vue
@@ -0,0 +1,180 @@
+
+
+
+
{{ $ts._mfm.sparkleDescription }}
+