This commit is contained in:
Henry Jameson 2026-07-13 17:41:20 +03:00
commit c5d273eb01
2 changed files with 18 additions and 19 deletions

View file

@ -20,7 +20,9 @@
:show-ratio="true" :show-ratio="true"
:contrast="contrast[key]" :contrast="contrast[key]"
/> />
<div v-else>{{ '&nbsp;' }}</div> <div v-else>
{{ '&nbsp;' }}
</div>
</div> </div>
</div> </div>
<div class="buttons"> <div class="buttons">
@ -59,10 +61,12 @@ import { computed } from 'vue'
import ColorInput from 'src/components/color_input/color_input.vue' import ColorInput from 'src/components/color_input/color_input.vue'
import ContrastRatio from 'src/components/contrast_ratio/contrast_ratio.vue' import ContrastRatio from 'src/components/contrast_ratio/contrast_ratio.vue'
import { getContrastRatio, hex2rgb } from 'src/services/color_convert/color_convert.js'
import { useInterfaceStore } from 'src/stores/interface.js' import { useInterfaceStore } from 'src/stores/interface.js'
import {
getContrastRatio,
hex2rgb,
} from 'src/services/color_convert/color_convert.js'
import { import {
newExporter, newExporter,
newImporter, newImporter,

View file

@ -334,9 +334,11 @@ export default {
'mfm', 'mfm',
this.pauseMfm ? '-pause' : '', this.pauseMfm ? '-pause' : '',
this.scaleMfm ? '-scale' : '', this.scaleMfm ? '-scale' : '',
].filter(x => x).join(' ') ]
.filter((x) => x)
.join(' ')
newAttrs['data-mfm-operator'] = mfmOperator newAttrs['data-mfm-operator'] = mfmOperator
switch(mfmOperator) { switch (mfmOperator) {
case 'position': { case 'position': {
const x = Number.parseFloat(fullAttrs['data-mfm-x']) || 0 const x = Number.parseFloat(fullAttrs['data-mfm-x']) || 0
const y = Number.parseFloat(fullAttrs['data-mfm-y']) || 0 const y = Number.parseFloat(fullAttrs['data-mfm-y']) || 0
@ -350,10 +352,7 @@ export default {
case 'scale': { case 'scale': {
const x = Number.parseFloat(fullAttrs['data-mfm-x']) || 1 const x = Number.parseFloat(fullAttrs['data-mfm-x']) || 1
const y = Number.parseFloat(fullAttrs['data-mfm-y']) || 1 const y = Number.parseFloat(fullAttrs['data-mfm-y']) || 1
newAttrs.style = [ newAttrs.style = ['transform:', `scale(${x}, ${y})`].join(' ')
'transform:',
`scale(${x}, ${y})`,
].join(' ')
break break
} }
case 'rotate': { case 'rotate': {
@ -366,16 +365,12 @@ export default {
} }
case 'bg': { case 'bg': {
const color = fullAttrs['data-mfm-color'] || 0 const color = fullAttrs['data-mfm-color'] || 0
newAttrs.style = [ newAttrs.style = [`background-color: #${color}`].join(' ')
`background-color: #${color}`,
].join(' ')
break break
} }
case 'fg': { case 'fg': {
const color = fullAttrs['data-mfm-color'] || 0 const color = fullAttrs['data-mfm-color'] || 0
newAttrs.style = [ newAttrs.style = [`color: #${color}`].join(';')
`color: #${color}`,
].join(';')
break break
} }
case 'spin': { case 'spin': {
@ -389,14 +384,14 @@ export default {
const anim = [ const anim = [
x ? 'mfm-spinX' : null, x ? 'mfm-spinX' : null,
y ? 'mfm-spinY' : null, y ? 'mfm-spinY' : null,
'mfm-spin' 'mfm-spin',
].filter(a => a)[0] ].filter((a) => a)[0]
const direction = [ const direction = [
alternate ? 'alternate' : null, alternate ? 'alternate' : null,
left ? 'reverse' : null, left ? 'reverse' : null,
'normal', 'normal',
].filter(a => a)[0] ].filter((a) => a)[0]
newAttrs.style = [ newAttrs.style = [
`animation-name: ${anim}`, `animation-name: ${anim}`,
@ -423,7 +418,7 @@ export default {
newAttrs.style = [ newAttrs.style = [
`border: ${width} ${style} ${color}`, `border: ${width} ${style} ${color}`,
`border-radius: ${radius}`, `border-radius: ${radius}`,
`overflow: ${noclip ? 'visible' : 'clip'}` `overflow: ${noclip ? 'visible' : 'clip'}`,
].join(';') ].join(';')
break break
} }