Add rainbow function for MFM

This commit is contained in:
syuilo
2021-08-05 21:55:41 +09:00
parent e410e22980
commit 62ccb53c24
4 changed files with 24 additions and 0 deletions

View File

@ -117,6 +117,11 @@ export default defineComponent({
75% { transform: scale3d(1.05, 0.95, 1); }
to { transform: scale3d(1, 1, 1); }
}
@keyframes mfm-rainbow {
0% { filter: hue-rotate(0deg) contrast(150%) saturate(150%); }
100% { filter: hue-rotate(360deg) contrast(150%) saturate(150%); }
}
</style>
<style lang="scss" scoped>

View File

@ -165,6 +165,10 @@ export default defineComponent({
class: '_mfm_blur_',
}, genEl(token.children));
}
case 'rainbow': {
style = this.$store.state.animatedMfm ? 'animation: mfm-rainbow 1s linear infinite;' : '';
break;
}
}
if (style == null) {
return h('span', {}, ['[', token.props.name, ...genEl(token.children), ']']);