mirror of
https://akkoma.dev/lamp/akkoma-fe.git
synced 2026-06-05 06:40:04 -04:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 261a9da374 | |||
| ca8689fc88 |
@@ -1,13 +1,12 @@
|
|||||||
import { defineComponent, h } from 'vue'
|
import { defineComponent, h } from 'vue'
|
||||||
import * as mfm from 'mfm-js'
|
import * as mfm from 'mfm-js'
|
||||||
import MentionLink from '../mention_link/mention_link.vue'
|
import MentionLink from '../mention_link/mention_link.vue'
|
||||||
import mention_link from '../mention_link/mention_link'
|
|
||||||
|
|
||||||
function concat (xss) {
|
function concat (xss) {
|
||||||
return ([]).concat(...xss)
|
return ([]).concat(...xss)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate']
|
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'rotate']
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
@@ -138,9 +137,6 @@ export default defineComponent({
|
|||||||
style = 'animation: mfm-rainbow 1s linear infinite;'
|
style = 'animation: mfm-rainbow 1s linear infinite;'
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'sparkle': {
|
|
||||||
return h(MkSparkle, {}, genEl(token.children))
|
|
||||||
}
|
|
||||||
case 'rotate': {
|
case 'rotate': {
|
||||||
const degrees = parseInt(token.props.args.deg) || '90'
|
const degrees = parseInt(token.props.args.deg) || '90'
|
||||||
style = `transform: rotate(${degrees}deg); transform-origin: center center;`
|
style = `transform: rotate(${degrees}deg); transform-origin: center center;`
|
||||||
@@ -234,16 +230,21 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
case 'emojiCode': {
|
case 'emojiCode': {
|
||||||
return [h('div', {
|
const emoj = this.status.emojis.find((emoji) => emoji.shortcode === token.props.name)
|
||||||
class: 'still-image emoji img'
|
if (emoj) {
|
||||||
},
|
return [h('div', {
|
||||||
[h('img', {
|
class: 'still-image emoji img'
|
||||||
key: Math.random(),
|
},
|
||||||
title: token.props.name,
|
[h('img', {
|
||||||
alt: token.props.name,
|
key: Math.random(),
|
||||||
src: this.status.emojis.find((emoji) => emoji.shortcode === token.props.name).static_url
|
title: token.props.name,
|
||||||
})]
|
alt: token.props.name,
|
||||||
)]
|
src: this.status.emojis.find((emoji) => emoji.shortcode === token.props.name).static_url
|
||||||
|
})]
|
||||||
|
)]
|
||||||
|
} else {
|
||||||
|
return `:${token.props.name}:`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'unicodeEmoji': {
|
case 'unicodeEmoji': {
|
||||||
|
|||||||
Reference in New Issue
Block a user