2024-08-23 10:19:02 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="editFrontBack_center">
|
2025-02-25 15:32:55 +08:00
|
|
|
<!-- <div class="editFrontBack_center_btn editFrontBack_center_item" :class="{spread:spreadState}">
|
2024-09-11 16:36:08 +08:00
|
|
|
<i class="icon iconfont icon-chehui" @click="historyState('')"></i>
|
|
|
|
|
<i class="icon iconfont icon-fanchehui" @click="historyState('reverse')"></i>
|
|
|
|
|
<i class="icon iconfont icon-bianji" @click="setOperation('pencil')" :class="{active:canvasState == 'pencil'}"></i>
|
2024-09-30 17:59:24 +08:00
|
|
|
<div class="editFrontBack_center_btn_colorRed" @click="setOperationColor('rgb(255,0,0)')" :class="{active:(canvasState != 'eraser' && rgba == 'rgb(255,0,0)')}" title="front">front</div>
|
|
|
|
|
<div class="editFrontBack_center_btn_colorGreen" @click="setOperationColor('rgb(0,255,0)')" :class="{active:(canvasState != 'eraser' && rgba == 'rgb(0,255,0)')}" title="back">back</div>
|
2024-09-30 15:43:37 +08:00
|
|
|
<div class="editFrontBack_center_btn_colorWhite" @click="setOperation('eraser')" :class="{active:canvasState == 'eraser'}" title="background">background</div>
|
2024-09-11 16:36:08 +08:00
|
|
|
<input type="range" v-show="canvasState != 'move'" @input="setPencilWidth" min="1" max="50" v-model="canvasPencilWidth[canvasState]">
|
2025-02-25 15:32:55 +08:00
|
|
|
</div> -->
|
2024-09-25 11:07:49 +08:00
|
|
|
<div class="exportCanvasBox_center_box">
|
|
|
|
|
<div class="exportCanvasBox_center">
|
|
|
|
|
<div class="editFrontBack_bgImg" v-show="loadingShow">
|
|
|
|
|
<img :src="imgData?.undividedLayer" alt="">
|
|
|
|
|
</div>
|
2025-02-25 15:32:55 +08:00
|
|
|
<div class="editFrontBack_pencilbtn" v-show="loadingShow" :style="frontBackCanvasObj.pencilbtnStyle" style="display: block;"></div>
|
|
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
</div>
|
2025-02-25 15:32:55 +08:00
|
|
|
<!-- <div class="editFrontBack_pencilbtn" v-show="loadingShow" :style="pencilbtnStyle"></div> -->
|
|
|
|
|
<!--
|
|
|
|
|
<div class="editFrontBack_pencilbtn" v-show="loadingShow" :style="frontBackCanvasObj.pencilbtnStyle" style="display: block;"></div>
|
|
|
|
|
{{frontBackCanvasObj.pencilbtnStyle}} -->
|
2024-08-23 10:19:02 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2025-02-25 15:32:55 +08:00
|
|
|
import { defineComponent, ref, reactive, inject, onMounted, nextTick, toRefs, onBeforeUnmount, watch, computed } from "vue";
|
2024-08-23 10:19:02 +08:00
|
|
|
import { formatTime,segmentImage } from "@/tool/util";
|
|
|
|
|
import { exportSele,JSRectUpdata,JSchangeType,JScanvasMouseDown,JSSetRemoveImage,JScreateCheck,JSSetTexture } from "@/tool/canvasDrawing";
|
2024-09-25 11:07:49 +08:00
|
|
|
import { getMousePosition } from "@/tool/mdEvent";
|
2025-02-25 15:32:55 +08:00
|
|
|
import { useStore } from "vuex";
|
2024-08-23 10:19:02 +08:00
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
components: {
|
|
|
|
|
},
|
|
|
|
|
// emits: ['setSloganData'],
|
|
|
|
|
props:['patchData','imgDomIndex'],
|
|
|
|
|
setup(props,{emit}) {
|
2025-02-25 15:32:55 +08:00
|
|
|
const store = useStore();
|
2024-08-23 10:19:02 +08:00
|
|
|
let presentState = ref('paypal');
|
|
|
|
|
let loadingShow = ref(false);
|
|
|
|
|
let { t } = useI18n();
|
2025-02-25 15:32:55 +08:00
|
|
|
// let canvas = new frontBackCanvasObjCopy();
|
|
|
|
|
let canvas = null;
|
|
|
|
|
let frontBackCanvasObj = inject('frontBackCanvasObj')
|
2024-08-23 10:19:02 +08:00
|
|
|
let ratio = [1,1]
|
|
|
|
|
let exportWH = 0
|
2024-09-11 16:36:08 +08:00
|
|
|
let imgData = ref()
|
|
|
|
|
let pencilbtnStyle = ref({
|
|
|
|
|
background:'',
|
|
|
|
|
width:0+'px',
|
|
|
|
|
height:0+'px',
|
|
|
|
|
display:'none',
|
|
|
|
|
left:0+'px',
|
|
|
|
|
top:0+'px',
|
|
|
|
|
})
|
2025-02-25 15:32:55 +08:00
|
|
|
let selectDetail = computed(()=>store.state.DesignDetailCopy.selectDetail)
|
|
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
// let a = computed(()=>{
|
|
|
|
|
// console.log(123);
|
|
|
|
|
// return props.patchData
|
|
|
|
|
// })
|
2025-02-25 15:32:55 +08:00
|
|
|
watch(()=>pencilbtnStyle.value.background,(newVal)=>{
|
|
|
|
|
frontBackCanvasObj.brushwork.color = newVal
|
|
|
|
|
frontBackCanvasObj.setPencilColor()
|
|
|
|
|
})
|
|
|
|
|
onMounted(()=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
props.patchData.front.imageUrl= ''
|
2024-09-27 16:31:33 +08:00
|
|
|
clearTimeout(setTimeSubmit)
|
2025-02-25 15:32:55 +08:00
|
|
|
// init(props.patchData.front[props.imgDomIndex],'')
|
2024-08-23 10:19:02 +08:00
|
|
|
})
|
|
|
|
|
let canvasBtn = reactive({
|
|
|
|
|
canvasState:'move',
|
|
|
|
|
canvasPencilWidth:{
|
2024-09-30 15:43:37 +08:00
|
|
|
pencil:20,
|
|
|
|
|
eraser:20,
|
2024-08-23 10:19:02 +08:00
|
|
|
},
|
|
|
|
|
spreadState:false,
|
|
|
|
|
})
|
|
|
|
|
let canvasWH = ref(0);
|
|
|
|
|
|
|
|
|
|
let reverseCanvasState = ref([])//存放canvas操作
|
|
|
|
|
let normalCanvasState = ref([])//存放canvas操作
|
2025-02-25 15:32:55 +08:00
|
|
|
|
|
|
|
|
let down = false
|
2024-08-23 10:19:02 +08:00
|
|
|
let init = (data,index)=>{
|
|
|
|
|
normalCanvasState.value = []
|
|
|
|
|
reverseCanvasState.value = []
|
|
|
|
|
ratio = [1,1]
|
2024-09-11 16:36:08 +08:00
|
|
|
imgData.value = data
|
2024-08-23 10:19:02 +08:00
|
|
|
nextTick(()=>{
|
2024-09-11 16:36:08 +08:00
|
|
|
let canvasBox = document.querySelector(".editFrontBack_center .exportCanvasBox_center");
|
2024-10-10 17:01:15 +08:00
|
|
|
let editFrontBack_bgImg = document.querySelector(".editFrontBack_center .editFrontBack_bgImg");
|
2024-09-25 11:07:49 +08:00
|
|
|
document.removeEventListener('mousemove', mouseMove);
|
|
|
|
|
document.removeEventListener('touchmove', touchmove);
|
2024-08-23 10:19:02 +08:00
|
|
|
let img = new Image();
|
2024-09-27 16:31:33 +08:00
|
|
|
img.onload = async function(){
|
2024-09-11 16:36:08 +08:00
|
|
|
loadingShow.value = true
|
2025-03-03 14:52:05 +08:00
|
|
|
let scale = img.width/img.height
|
2024-09-11 16:36:08 +08:00
|
|
|
let height = canvasBox.offsetHeight;
|
|
|
|
|
canvasWH.value = height
|
2025-03-03 14:52:05 +08:00
|
|
|
canvasBox.style.width = height * scale+'px'
|
2024-10-10 17:01:15 +08:00
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
let wScale = 1
|
|
|
|
|
let hScale = 1
|
|
|
|
|
let styleWidth = Number(data.style.width.split('px')[0])
|
|
|
|
|
let styleHeight = Number(data.style.height.split('px')[0])
|
|
|
|
|
if(styleWidth>styleHeight){
|
|
|
|
|
hScale = styleHeight/styleWidth
|
|
|
|
|
exportWH = img.width
|
|
|
|
|
}else{
|
|
|
|
|
wScale = styleWidth/styleHeight
|
|
|
|
|
exportWH = img.height
|
|
|
|
|
}
|
2024-10-10 17:01:15 +08:00
|
|
|
editFrontBack_bgImg.style.width = canvasWH.value * wScale+'px'
|
|
|
|
|
editFrontBack_bgImg.style.height = canvasWH.value * hScale+'px'
|
2024-08-23 10:19:02 +08:00
|
|
|
ratio = [wScale,hScale]
|
2025-02-25 15:32:55 +08:00
|
|
|
// canvas = frontBackCanvasObj.canvasInit(canvasBox,{
|
|
|
|
|
// width:canvasWH.value * wScale,
|
|
|
|
|
// height:canvasWH.value * hScale,
|
|
|
|
|
// })
|
|
|
|
|
await frontBackCanvasObj.canvasInit(canvasBox,{
|
2024-09-25 11:07:49 +08:00
|
|
|
width:canvasWH.value * wScale,
|
|
|
|
|
height:canvasWH.value * hScale,
|
2025-03-03 14:52:05 +08:00
|
|
|
},data.maskUrl,'',{})
|
|
|
|
|
// undividedLayer
|
2025-02-25 15:32:55 +08:00
|
|
|
canvas = frontBackCanvasObj.canvas
|
|
|
|
|
|
|
|
|
|
frontBackCanvasObj.setOperation('pencil')
|
2024-09-11 16:36:08 +08:00
|
|
|
pencilbtnStyle.value.background = rgba.value
|
2025-03-03 14:52:05 +08:00
|
|
|
// console.log(frontBackCanvasObj,frontBackCanvasObj.setPencilWidth);
|
2025-02-25 15:32:55 +08:00
|
|
|
frontBackCanvasObj.setPencilWidth()
|
2024-08-23 10:19:02 +08:00
|
|
|
fabric.Object.prototype.cornerSize = 10
|
|
|
|
|
fabric.Object.prototype.transparentCorners = false
|
2025-03-03 14:52:05 +08:00
|
|
|
// await frontBackCanvasObj.addPartImg({minioUrl:data.maskUrl},'',{opacity: 0.5})
|
|
|
|
|
|
2025-02-25 15:32:55 +08:00
|
|
|
// await new Promise((resolve, reject) => {
|
|
|
|
|
// fabric.Image.fromURL(data.maskUrl, function(img) {
|
|
|
|
|
// // 设置背景图对象的宽度和高度与 canvas 相同
|
|
|
|
|
// canvas.add(img)
|
|
|
|
|
// resolve('')
|
|
|
|
|
// },{ crossOrigin: "Anonymous" });
|
2024-10-03 14:16:23 +08:00
|
|
|
// })
|
2024-09-27 16:31:33 +08:00
|
|
|
|
2024-09-03 16:39:06 +08:00
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
//画布上移动
|
2024-09-25 11:07:49 +08:00
|
|
|
// canvas.on("mouse:move", event =>setCanvasMove(event));
|
2025-02-25 15:32:55 +08:00
|
|
|
canvas.on('mouse:up', (event)=> {
|
|
|
|
|
updateCanvasState('mouseUp')
|
|
|
|
|
});
|
2024-09-25 11:07:49 +08:00
|
|
|
document.addEventListener('mousemove', mouseMove);
|
|
|
|
|
document.addEventListener('touchmove', touchmove);
|
2024-09-03 16:39:06 +08:00
|
|
|
createSetTimeSubmit()
|
2024-08-23 10:19:02 +08:00
|
|
|
img.remove()
|
|
|
|
|
}
|
2024-09-03 16:39:06 +08:00
|
|
|
img.src = data.maskUrl
|
2024-08-23 10:19:02 +08:00
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
const setBackground = (value)=>{
|
|
|
|
|
if(value == 'background'){
|
|
|
|
|
frontBackCanvasObj.setOperation('eraser')
|
2024-08-23 10:19:02 +08:00
|
|
|
}else{
|
2025-02-25 15:32:55 +08:00
|
|
|
frontBackCanvasObj.setOperation('pencil')
|
|
|
|
|
frontBackCanvasObj.brushwork.color = value
|
|
|
|
|
frontBackCanvasObj.pencilColor()
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
|
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
let updateCanvasState = (str) =>{
|
|
|
|
|
if(str != 'mouseUp'){
|
|
|
|
|
// editFrontBackPencilbtn.value.style.display = 'none'
|
|
|
|
|
}else{
|
|
|
|
|
clearTimeout(setTimeSubmit)
|
|
|
|
|
setTimeSubmit = setTimeout(()=>{
|
|
|
|
|
createSetTimeSubmit()
|
|
|
|
|
},1000)
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
}
|
2024-09-03 16:39:06 +08:00
|
|
|
let setClone = ()=>{
|
2024-09-11 16:36:08 +08:00
|
|
|
let canvasBox = document.querySelector(".editFrontBack_center .exportCanvasBox_center");
|
2024-09-03 16:39:06 +08:00
|
|
|
let oldCanvasDom = canvasBox.querySelector('.canvas-container')
|
|
|
|
|
let oldCanvasDom1 = canvasBox.querySelector('canvas')
|
|
|
|
|
if(oldCanvasDom)oldCanvasDom.remove()
|
|
|
|
|
if(oldCanvasDom1)oldCanvasDom1.remove()
|
2024-09-11 16:36:08 +08:00
|
|
|
loadingShow.value = false
|
2024-09-03 16:39:06 +08:00
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
let rgba = ref('#ff0000')
|
2024-09-25 11:07:49 +08:00
|
|
|
let mouseMove = (event)=>{
|
|
|
|
|
let e = getMousePosition(event,false)
|
|
|
|
|
setCanvasMove(e)
|
|
|
|
|
}
|
|
|
|
|
let touchmove = (event)=>{
|
|
|
|
|
let e = getMousePosition(event,true)
|
|
|
|
|
setCanvasMove(e)
|
|
|
|
|
}
|
2024-08-23 10:19:02 +08:00
|
|
|
let setCanvasMove = (event)=>{
|
2025-02-25 15:32:55 +08:00
|
|
|
if(canvas.isDrawingMode && canvas){
|
2024-08-23 10:19:02 +08:00
|
|
|
canvas.setCursor('none');
|
|
|
|
|
}
|
2024-09-25 11:07:49 +08:00
|
|
|
let canvasCenterBox = document.querySelector(".editFrontBack_center .exportCanvasBox_center_box");
|
|
|
|
|
if(!canvasCenterBox)return
|
|
|
|
|
let parentX = event.clientX - canvasCenterBox.getBoundingClientRect().left
|
|
|
|
|
let parentY = event.clientY - canvasCenterBox.getBoundingClientRect().top
|
|
|
|
|
pencilbtnStyle.value.left = parentX + "px"
|
|
|
|
|
pencilbtnStyle.value.top = parentY+'px'
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
let mousedown = (e)=>{
|
|
|
|
|
if(e.target instanceof HTMLCanvasElement){
|
|
|
|
|
down = true
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
|
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
let mouseup = (e)=>{
|
|
|
|
|
if(down){
|
|
|
|
|
nextTick(()=>{
|
|
|
|
|
createSetTimeSubmit()
|
2024-08-23 10:19:02 +08:00
|
|
|
})
|
2025-02-25 15:32:55 +08:00
|
|
|
}
|
|
|
|
|
down = false
|
|
|
|
|
}
|
2024-09-03 16:39:06 +08:00
|
|
|
let setTimeSubmit = null
|
|
|
|
|
let createSetTimeSubmit = ()=>{
|
2024-09-27 16:31:33 +08:00
|
|
|
setSubmit()
|
2024-09-03 16:39:06 +08:00
|
|
|
}
|
2024-08-23 10:19:02 +08:00
|
|
|
//撤回
|
2025-02-25 15:32:55 +08:00
|
|
|
|
|
|
|
|
let setSubmit = async ()=>{
|
|
|
|
|
// let data = await frontBackCanvasObj.allExport()
|
|
|
|
|
let data = await frontBackCanvasObj.detailSubmit()
|
|
|
|
|
// props.props.patchData.front[imgDomIndex].imageUrl = data
|
|
|
|
|
let mark = data
|
|
|
|
|
let full = props.patchData.front[props.imgDomIndex].undividedLayer
|
|
|
|
|
let size = {
|
|
|
|
|
width: Math.round(exportWH * ratio[0]),
|
|
|
|
|
height: Math.round(exportWH * ratio[1]),
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
segmentImage(mark,full,size).then((rv)=>{
|
|
|
|
|
props.patchData.front[props.imgDomIndex].imageUrl = rv.targetFrontUrl
|
|
|
|
|
props.patchData.back[props.imgDomIndex].imageUrl = rv.targetBackUrl
|
|
|
|
|
props.patchData.front[props.imgDomIndex].maskUrl = data
|
|
|
|
|
store.commit('DesignDetailCopy/updataDetailItem',{maskUrl:data})
|
2024-08-23 10:19:02 +08:00
|
|
|
})
|
|
|
|
|
}
|
2025-02-25 15:32:55 +08:00
|
|
|
onBeforeUnmount(()=>{
|
|
|
|
|
frontBackCanvasObj.canvasClear()
|
|
|
|
|
document.removeEventListener('mousemove', mouseMove);
|
|
|
|
|
document.removeEventListener('touchmove', touchmove);
|
|
|
|
|
document.removeEventListener('mousedown', mousedown);
|
|
|
|
|
document.removeEventListener('mouseup', mouseup);
|
|
|
|
|
})
|
2024-08-23 10:19:02 +08:00
|
|
|
return {
|
2025-02-25 15:32:55 +08:00
|
|
|
frontBackCanvasObj,
|
2024-08-23 10:19:02 +08:00
|
|
|
presentState,
|
|
|
|
|
loadingShow,
|
2024-09-11 16:36:08 +08:00
|
|
|
imgData,
|
|
|
|
|
pencilbtnStyle,
|
2024-08-23 10:19:02 +08:00
|
|
|
t,
|
|
|
|
|
...toRefs(canvasBtn),
|
2025-02-25 15:32:55 +08:00
|
|
|
setBackground,
|
2024-08-23 10:19:02 +08:00
|
|
|
init,
|
|
|
|
|
setSubmit,
|
2024-09-03 16:39:06 +08:00
|
|
|
setClone,
|
2024-08-23 10:19:02 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.editFrontBack_center{
|
|
|
|
|
position: relative;
|
|
|
|
|
// width: calc(512px / 2);
|
|
|
|
|
// width: 256px;
|
|
|
|
|
height: 100%;
|
2024-09-25 11:07:49 +08:00
|
|
|
width: 100%;
|
2024-08-23 10:19:02 +08:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
// height: calc(512px / 2);
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
.editFrontBack_center_item{
|
|
|
|
|
// position: relative;
|
2025-03-03 14:52:05 +08:00
|
|
|
background: #ffffff;
|
2024-08-23 10:19:02 +08:00
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
border: 0.2rem solid #c4c4c4;
|
2024-09-03 16:39:06 +08:00
|
|
|
width: 35rem;
|
2024-08-23 10:19:02 +08:00
|
|
|
border-radius: 4px; /* 设置圆角半径 */
|
|
|
|
|
flex-wrap: wrap;
|
2024-09-03 16:39:06 +08:00
|
|
|
align-items: center;
|
2024-08-23 10:19:02 +08:00
|
|
|
.editFrontBack_center_btn_item{
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 1rem 0;
|
2024-09-03 16:39:06 +08:00
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-09-11 16:36:08 +08:00
|
|
|
.editFrontBack_center_btn{
|
|
|
|
|
z-index: 2;
|
|
|
|
|
left: 50%;
|
|
|
|
|
// transform: translate(-50%,-135%);
|
|
|
|
|
// transition: all .3s;
|
|
|
|
|
padding: 1rem 1.5rem;
|
|
|
|
|
transform: translate(-50%,0);
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
input{
|
|
|
|
|
// width: 100%;
|
|
|
|
|
flex: 1;
|
2024-09-30 15:43:37 +08:00
|
|
|
max-width: 30%;
|
2024-09-11 16:36:08 +08:00
|
|
|
}
|
|
|
|
|
.icon-xiala{
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 2rem;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
transform: translate(-50%, 90%);
|
|
|
|
|
left: 50%;
|
|
|
|
|
width: 6rem;
|
|
|
|
|
background: #fff;
|
|
|
|
|
text-align: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
&.icon-xiala::before{
|
|
|
|
|
transition: all .3s;
|
|
|
|
|
}
|
|
|
|
|
&.btnRotate::before{
|
|
|
|
|
transform: rotate(180deg);
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-30 15:43:37 +08:00
|
|
|
.editFrontBack_center_btn_colorRed,.editFrontBack_center_btn_colorGreen,.editFrontBack_center_btn_colorWhite{
|
2024-09-30 16:07:35 +08:00
|
|
|
width: 9rem;
|
2024-09-30 15:43:37 +08:00
|
|
|
line-height: 3rem;
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 3rem;
|
2024-09-11 16:36:08 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
|
margin: 0 .5rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
padding: .5rem 1;
|
2024-09-30 15:43:37 +08:00
|
|
|
border: 1px solid rgba(0,0,0,.5);
|
2024-09-11 16:36:08 +08:00
|
|
|
&.active{
|
|
|
|
|
border: 2px solid;
|
|
|
|
|
border-radius: .4rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.editFrontBack_center_btn_colorRed{
|
|
|
|
|
background: rgba(255,0,0);
|
|
|
|
|
}
|
|
|
|
|
.editFrontBack_center_btn_colorGreen{
|
|
|
|
|
background: rgba(0,255,0);
|
|
|
|
|
}
|
2024-09-30 15:43:37 +08:00
|
|
|
.editFrontBack_center_btn_colorWhite{
|
|
|
|
|
background: rgba(255,255,255);
|
|
|
|
|
}
|
2024-09-11 16:36:08 +08:00
|
|
|
i{
|
|
|
|
|
font-size: 2.5rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
width: 4rem;
|
|
|
|
|
height: 4rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
&.active{
|
|
|
|
|
border: 1px solid;
|
|
|
|
|
border-radius: .4rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
&.spread{
|
|
|
|
|
transform: translate(-50%,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-25 11:07:49 +08:00
|
|
|
.exportCanvasBox_center_box{
|
2024-08-23 10:19:02 +08:00
|
|
|
height: 100%;
|
|
|
|
|
flex: 1;
|
|
|
|
|
position: relative;
|
2024-09-27 16:31:33 +08:00
|
|
|
overflow: hidden;
|
2024-09-25 11:07:49 +08:00
|
|
|
width: 100%;
|
|
|
|
|
background: #e6e6e6;
|
2025-02-25 15:32:55 +08:00
|
|
|
cursor: auto;
|
2024-09-25 11:07:49 +08:00
|
|
|
&:hover{
|
|
|
|
|
cursor: none;
|
|
|
|
|
}
|
|
|
|
|
.editFrontBack_pencilbtn{
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
border: 1px solid #000;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
transform: translate(-50%,-50%);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.exportCanvasBox_center{
|
2024-08-23 10:19:02 +08:00
|
|
|
margin: 0 auto;
|
|
|
|
|
overflow: hidden;
|
2024-09-25 11:07:49 +08:00
|
|
|
height: 100%;
|
|
|
|
|
position: relative;
|
2024-08-23 10:19:02 +08:00
|
|
|
// overflow: scroll;
|
2025-02-25 15:32:55 +08:00
|
|
|
cursor: none;
|
2024-09-11 16:36:08 +08:00
|
|
|
:deep(.canvas-container){
|
2024-08-23 10:19:02 +08:00
|
|
|
left: 50%;
|
2024-09-11 16:36:08 +08:00
|
|
|
top: 50%;
|
|
|
|
|
transform: translate(-50%,-50%);
|
2025-02-25 15:32:55 +08:00
|
|
|
// opacity: .5;
|
2024-09-11 16:36:08 +08:00
|
|
|
// background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC);
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
2024-09-11 16:36:08 +08:00
|
|
|
.editFrontBack_bgImg{
|
|
|
|
|
position: absolute;
|
2024-08-23 10:19:02 +08:00
|
|
|
left: 50%;
|
|
|
|
|
top: 50%;
|
|
|
|
|
transform: translate(-50%,-50%);
|
2024-09-11 16:36:08 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
2025-03-03 14:52:05 +08:00
|
|
|
z-index: 2;
|
|
|
|
|
pointer-events:none;
|
|
|
|
|
opacity: .5;
|
2024-09-11 16:36:08 +08:00
|
|
|
img{
|
|
|
|
|
height: 100%;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-25 11:07:49 +08:00
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
}
|
|
|
|
|
.exportCanvasBox_center:hover{
|
|
|
|
|
.editFrontBack_center_btn{
|
|
|
|
|
transform: translate(-50%,-101%);
|
|
|
|
|
&.spread{
|
|
|
|
|
transform: translate(-50%,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|