diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-01-27 16:18:04 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-01-27 16:18:04 +0900 |
| commit | e5d938150386b32d2aa49e1a825453309209d9e4 (patch) | |
| tree | e9f29f0cf0535f9464f1386a835743d6695e4dd3 /src/client | |
| parent | [Server] Introduce admin stream channel (diff) | |
| download | misskey-e5d938150386b32d2aa49e1a825453309209d9e4.tar.gz misskey-e5d938150386b32d2aa49e1a825453309209d9e4.tar.bz2 misskey-e5d938150386b32d2aa49e1a825453309209d9e4.zip | |
[MFM] Add spin syntax
Resolve #4003
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/animation.styl | 5 | ||||
| -rw-r--r-- | src/client/app/common/views/components/mfm.ts | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/client/app/animation.styl b/src/client/app/animation.styl index a629165207..9cbd3ec6c8 100644 --- a/src/client/app/animation.styl +++ b/src/client/app/animation.styl @@ -26,3 +26,8 @@ transform: translateY(0); } } + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} diff --git a/src/client/app/common/views/components/mfm.ts b/src/client/app/common/views/components/mfm.ts index 8ffa566666..f6f95deb24 100644 --- a/src/client/app/common/views/components/mfm.ts +++ b/src/client/app/common/views/components/mfm.ts @@ -124,6 +124,17 @@ export default Vue.component('misskey-flavored-markdown', { }, genEl(token.children)); } + case 'spin': { + motionCount++; + const isLong = sumTextsLength(token.children) > 5 || countNodesF(token.children) > 3; + const isMany = motionCount > 3; + return (createElement as any)('span', { + attrs: { + style: (this.$store.state.settings.disableAnimatedMfm || isLong || isMany) ? 'display: inline-block;' : 'display: inline-block; animation: spin 1.5s linear infinite;' + }, + }, genEl(token.children)); + } + case 'url': { return [createElement(MkUrl, { key: Math.random(), |