summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-01-27 16:18:04 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-01-27 16:18:04 +0900
commite5d938150386b32d2aa49e1a825453309209d9e4 (patch)
treee9f29f0cf0535f9464f1386a835743d6695e4dd3 /src/client
parent[Server] Introduce admin stream channel (diff)
downloadmisskey-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.styl5
-rw-r--r--src/client/app/common/views/components/mfm.ts11
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(),