forked from mirror/misskey
Implemented a rotate MFM (#8016)
Co-authored-by: Richard Bowey <me@epickitty.uk>
This commit is contained in:
parent
aaba43e754
commit
dec7c4f722
@ -931,6 +931,8 @@ _mfm:
|
|||||||
rainbowDescription: "Makes the content appear in rainbow colors."
|
rainbowDescription: "Makes the content appear in rainbow colors."
|
||||||
sparkle: "Sparkle"
|
sparkle: "Sparkle"
|
||||||
sparkleDescription: "Gives content a sparkling particle effect."
|
sparkleDescription: "Gives content a sparkling particle effect."
|
||||||
|
rotate: "Rotate"
|
||||||
|
rotateDescription: "Rotates the content by 90 degrees"
|
||||||
_reversi:
|
_reversi:
|
||||||
reversi: "Reversi"
|
reversi: "Reversi"
|
||||||
gameSettings: "Game settings"
|
gameSettings: "Game settings"
|
||||||
|
@ -184,6 +184,11 @@ export default defineComponent({
|
|||||||
count, speed,
|
count, speed,
|
||||||
}, genEl(token.children));
|
}, genEl(token.children));
|
||||||
}
|
}
|
||||||
|
case 'rotate': {
|
||||||
|
const degrees = parseInt(token.props.args.deg) || '90';
|
||||||
|
style = `transform: rotate(${degrees}deg); transform-origin: center center;`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children), ']']);
|
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children), ']']);
|
||||||
|
@ -281,6 +281,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="section _block">
|
||||||
|
<div class="title">{{ $ts._mfm.rotate }}</div>
|
||||||
|
<div class="content">
|
||||||
|
<p>{{ $ts._mfm.rotateDescription }}</p>
|
||||||
|
<div class="preview">
|
||||||
|
<Mfm :text="preview_rotate"/>
|
||||||
|
<MkTextarea v-model="preview_rotate"><span>MFM</span></MkTextarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -328,6 +338,7 @@ export default defineComponent({
|
|||||||
preview_blur: `$[blur ${this.$ts._mfm.dummy}]`,
|
preview_blur: `$[blur ${this.$ts._mfm.dummy}]`,
|
||||||
preview_rainbow: `$[rainbow 🍮]`,
|
preview_rainbow: `$[rainbow 🍮]`,
|
||||||
preview_sparkle: `$[sparkle 🍮]`,
|
preview_sparkle: `$[sparkle 🍮]`,
|
||||||
|
preview_rotate: `$[rotate 🍮]`,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1 +1 @@
|
|||||||
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle'];
|
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate'];
|
||||||
|
Loading…
Reference in New Issue
Block a user