diff options
| author | futchitwo <74236683+futchitwo@users.noreply.github.com> | 2022-05-05 22:52:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-05 22:52:33 +0900 |
| commit | 3ea351d8a2f50f68dc695317062ba7f471ad7542 (patch) | |
| tree | e2d099950fa94adfeaad6238110a1f85c1bcc408 /packages/client/src/components | |
| parent | refactor(client): refactor settings/word-mute to use Composition API (#8597) (diff) | |
| download | sharkey-3ea351d8a2f50f68dc695317062ba7f471ad7542.tar.gz sharkey-3ea351d8a2f50f68dc695317062ba7f471ad7542.tar.bz2 sharkey-3ea351d8a2f50f68dc695317062ba7f471ad7542.zip | |
Enhance(MFM): Allow speed changes in all animated MFMs (#8551)
* MFM: Allow speed changes in all animated MFMs
* Feature(MFM): Add speed property to cheat sheet
* Use template literal
Oops!
* Remove unnecessary template string
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/mfm.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index 37076652fd..6ac410762d 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -91,7 +91,8 @@ export default defineComponent({ let style; switch (token.props.name) { case 'tada': { - style = `font-size: 150%;` + (this.$store.state.animatedMfm ? 'animation: tada 1s linear infinite both;' : ''); + const speed = validTime(token.props.args.speed) || '1s'; + style = 'font-size: 150%;' + (this.$store.state.animatedMfm ? `animation: tada ${speed} linear infinite both;` : ''); break; } case 'jelly': { @@ -123,11 +124,13 @@ export default defineComponent({ break; } case 'jump': { - style = this.$store.state.animatedMfm ? 'animation: mfm-jump 0.75s linear infinite;' : ''; + const speed = validTime(token.props.args.speed) || '0.75s'; + style = this.$store.state.animatedMfm ? `animation: mfm-jump ${speed} linear infinite;` : ''; break; } case 'bounce': { - style = this.$store.state.animatedMfm ? 'animation: mfm-bounce 0.75s linear infinite; transform-origin: center bottom;' : ''; + const speed = validTime(token.props.args.speed) || '0.75s'; + style = this.$store.state.animatedMfm ? `animation: mfm-bounce ${speed} linear infinite; transform-origin: center bottom;` : ''; break; } case 'flip': { @@ -168,7 +171,8 @@ export default defineComponent({ }, genEl(token.children)); } case 'rainbow': { - style = this.$store.state.animatedMfm ? 'animation: mfm-rainbow 1s linear infinite;' : ''; + const speed = validTime(token.props.args.speed) || '1s'; + style = this.$store.state.animatedMfm ? `animation: mfm-rainbow ${speed} linear infinite;` : ''; break; } case 'sparkle': { |