diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-11-02 15:37:42 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-11-02 15:37:42 +0900 |
| commit | d44cb7f2566dc16d75c0b32aa3fcea0d03d2f835 (patch) | |
| tree | 958b27740b8968e7bdb1d0545af1b61c3f4b214d /src/client | |
| parent | :art: (diff) | |
| download | misskey-d44cb7f2566dc16d75c0b32aa3fcea0d03d2f835.tar.gz misskey-d44cb7f2566dc16d75c0b32aa3fcea0d03d2f835.tar.bz2 misskey-d44cb7f2566dc16d75c0b32aa3fcea0d03d2f835.zip | |
Add new MFM animation syntax
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/components/mfm.ts | 6 | ||||
| -rw-r--r-- | src/client/style.scss | 63 |
2 files changed, 57 insertions, 12 deletions
diff --git a/src/client/components/mfm.ts b/src/client/components/mfm.ts index 7e4fec2848..e1216614a6 100644 --- a/src/client/components/mfm.ts +++ b/src/client/components/mfm.ts @@ -131,6 +131,12 @@ export default defineComponent({ }, genEl(token.children)); } + case 'shake': { + return h('span', { + style: this.$store.state.device.animatedMfm ? 'display: inline-block; animation: anime-shake 0.5s ease infinite;' : 'display: inline-block;' + }, genEl(token.children)); + } + case 'url': { return [h(MkUrl, { key: Math.random(), diff --git a/src/client/style.scss b/src/client/style.scss index be9e373291..07abbe0814 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -499,19 +499,58 @@ hr { 100% { transform: translateY(0); } } -// const gen = () => `translate(${Math.floor(Math.random() * 24) - 12}px, ${Math.floor(Math.random() * 24) - 12}px)` +// const val = () => `translate(${Math.floor(Math.random() * 20) - 10}px, ${Math.floor(Math.random() * 20) - 10}px)`; +// let css = ''; +// for (let i = 0; i <= 100; i += 5) { css += `${i}% { transform: ${val()} }\n`; } @keyframes anime-twitch { - 0% { transform: translate(0px, -9px); } - 10% { transform: translate(5px, -11px); } - 20% { transform: translate(-12px, 2px); } - 30% { transform: translate(10px, 4px); } - 40% { transform: translate(0px, 9px); } - 50% { transform: translate(-6px, 2px); } - 60% { transform: translate(-7px, 7px); } - 70% { transform: translate(14px, 7px); } - 80% { transform: translate(-5px, 10px); } - 90% { transform: translate(3px, -3px); } - 100% { transform: translate(10px, 8px); } + 0% { transform: translate(7px, -2px) } + 5% { transform: translate(-3px, 1px) } + 10% { transform: translate(-7px, -1px) } + 15% { transform: translate(0px, -1px) } + 20% { transform: translate(-8px, 6px) } + 25% { transform: translate(-4px, -3px) } + 30% { transform: translate(-4px, -6px) } + 35% { transform: translate(-8px, -8px) } + 40% { transform: translate(4px, 6px) } + 45% { transform: translate(-3px, 1px) } + 50% { transform: translate(2px, -10px) } + 55% { transform: translate(-7px, 0px) } + 60% { transform: translate(-2px, 4px) } + 65% { transform: translate(3px, -8px) } + 70% { transform: translate(6px, 7px) } + 75% { transform: translate(-7px, -2px) } + 80% { transform: translate(-7px, -8px) } + 85% { transform: translate(9px, 3px) } + 90% { transform: translate(-3px, -2px) } + 95% { transform: translate(-10px, 2px) } + 100% { transform: translate(-2px, -6px) } +} + +// const val = () => `translate(${Math.floor(Math.random() * 6) - 3}px, ${Math.floor(Math.random() * 6) - 3}px) rotate(${Math.floor(Math.random() * 24) - 12}deg)`; +// let css = ''; +// for (let i = 0; i <= 100; i += 5) { css += `${i}% { transform: ${val()} }\n`; } +@keyframes anime-shake { + 0% { transform: translate(-3px, -1px) rotate(-8deg) } + 5% { transform: translate(0px, -1px) rotate(-10deg) } + 10% { transform: translate(1px, -3px) rotate(0deg) } + 15% { transform: translate(1px, 1px) rotate(11deg) } + 20% { transform: translate(-2px, 1px) rotate(1deg) } + 25% { transform: translate(-1px, -2px) rotate(-2deg) } + 30% { transform: translate(-1px, 2px) rotate(-3deg) } + 35% { transform: translate(2px, 1px) rotate(6deg) } + 40% { transform: translate(-2px, -3px) rotate(-9deg) } + 45% { transform: translate(0px, -1px) rotate(-12deg) } + 50% { transform: translate(1px, 2px) rotate(10deg) } + 55% { transform: translate(0px, -3px) rotate(8deg) } + 60% { transform: translate(1px, -1px) rotate(8deg) } + 65% { transform: translate(0px, -1px) rotate(-7deg) } + 70% { transform: translate(-1px, -3px) rotate(6deg) } + 75% { transform: translate(0px, -2px) rotate(4deg) } + 80% { transform: translate(-2px, -1px) rotate(3deg) } + 85% { transform: translate(1px, -3px) rotate(-10deg) } + 90% { transform: translate(1px, 0px) rotate(3deg) } + 95% { transform: translate(-2px, 0px) rotate(-3deg) } + 100% { transform: translate(2px, 1px) rotate(2deg) } } @keyframes anime-tada { |