Commit b5048aee authored by rockyl's avatar rockyl

init

parent 659c4e39
......@@ -9,7 +9,7 @@
<script src="//yun.duiba.com.cn/js-libs/psd.js/3.2.0/psd.min.js"></script>
<!--<script src="http://0.0.0.0:4002/debug/engine.js"></script>-->
<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.da36f120e2f6937ed9812bb9538770e4505478d9.js"></script>
<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.05f3077c3940b59dd921a937fbc7ff93018d02dc.js"></script>
<script src="//yun.duiba.com.cn/editor/zeroing/libs/svga.469e6ae1d98c9017953cf9375559c2575b293b59.js"></script>
</head>
<body>
......
......@@ -6,8 +6,7 @@ export let API_HOST;
if (process.env.NODE_ENV === 'development') {
//API_HOST = '//10.10.95.74:7777';
//API_HOST = '//192.168.1.16:7777';
API_HOST = '//0.0.0.0:3000';
//API_HOST = '//192.168.0.105:7777';
API_HOST = '//10.10.92.233:3000';
//API_HOST = '//localhost:8080';
//API_HOST = window.__data.apiHost;
//API_HOST = 'http://beacon.duiba.com.cn';
......
.zero-playground-body-center{
.pane-playground {
flex: 1;
display: flex;
flex-direction: column;
.playground-ctrl {
width: 100%;
border-bottom: 1px solid $--border-color-base;
.stage-set-label {
white-space: nowrap;
padding-left: 10px;
}
}
.draw-body {
width: 100%;
flex: 1;
overflow: auto;
padding: 5px 0;
.zero-playground-body-center{
position: relative;
width: 750px;
height: 1624px;
......@@ -21,27 +42,27 @@
.active {
border: 2px dashed rgb(20, 100, 206);
}
}
// .zero-playground-draw-panel{
// min-height: 1200px;
// height: 100%;
// /*overflow-y: auto;
// overflow-x: hidden;*/
// }
.zero-draw-panel-container {
}
// .zero-playground-draw-panel{
// min-height: 1200px;
// height: 100%;
// /*overflow-y: auto;
// overflow-x: hidden;*/
// }
.zero-draw-panel-container {
position: relative;
width: 100%;
height: 100%;
}
.zero-draw-panel-container.scroll {
}
.zero-draw-panel-container.scroll {
height: 1200px;
}
/* 重置background相关属性*/
.zero-draw-panel-container * {
}
/* 重置background相关属性*/
.zero-draw-panel-container * {
background-repeat: no-repeat;
}
}
.zero-draw-panel-body {
.zero-draw-panel-body {
position: absolute;
top: 0;
left: 0;
......@@ -49,18 +70,21 @@
bottom: 0;
z-index: 1;
background: transparent;
}
.zero-components-container {
}
.zero-components-container {
width: 100%;
height: 100%;
}
.zero-components-container.playingAnime {
}
.zero-components-container.playingAnime {
position: absolute;
z-index: 2;
}
}
.zero-custom-wrapper {
.zero-custom-wrapper {
position: absolute;
cursor: default;
user-select: none;
}
}
}
......@@ -142,7 +142,7 @@ export async function packImages(assets, options = {}) {
async function deal(assets, urls, getSheetUrlByUUID, name, blob, frames) {
//const sheetUUID = sha256(urls.sort().join()).toString();
const sheetUUID = sha256(Object.keys(frames).sort().join()).toString();
const sheetUUID = sha256(urls.sort().join() + Object.keys(frames).sort().join()).toString();
let url;
if (getSheetUrlByUUID) {
......
......@@ -389,7 +389,11 @@
previewUrl.hash = '#/preview/' + projectID;
setTimeout(() => {
window.open(previewUrl.href, 'blank');
if(this.previewWindow && this.previewWindow.reloadPreview && this.previewWindow.reloadPreview()){
this.previewWindow.reloadPreview();
}else{
this.previewWindow = open(previewUrl.href, 'blank');
}
}, 300);
},
showMissingPackages(missingPackages) {
......
<template>
<pane icon="el-icon-s-open" class="pane-playground" :title="$t('panes.Playground')">
<div class="draw-body">
<div class="playground-con">
<pane icon="el-icon-s-open" :title="$t('panes.Playground')">
<div class="pane-playground">
<div class="playground-ctrl">
<!-- <label class="el-form-item__label">滑动滚轮进行缩放</label> -->
<el-form :inline="true" class="filter-bar" style="padding:10px 10px;" size="mini" @submit.native.prevent>
<el-form :inline="true" class="filter-bar" style="padding:3px 6px;" size="mini" @submit.native.prevent>
<!-- <el-form-item>
<el-checkbox
v-model="overFlowState"
......@@ -21,135 +17,135 @@
</el-checkbox>
</el-form-item>
<el-form-item>
<span class="stage-set-label">舞台宽度(只读):</span>
<el-input class="el-input el-input--mini" v-model="designWidth" style="width:60px" readonly=""/>
<span class="stage-set-label">舞台高度:</span>
<el-input class="el-input el-input--mini" v-model="designHeight" style="width:60px"/>
<span class="stage-set-label">宽度:</span>
<el-input class="el-input el-input--mini" v-model="designWidth" style="width:50px" readonly=""/>
<span class="stage-set-label">高度:</span>
<el-input class="el-input el-input--mini" v-model="designHeight" style="width:50px"/>
</el-form-item>
<el-form-item>
<span class="stage-set-label">舞台缩放:</span>
<span class="stage-set-label">缩放:</span>
<el-button size="mini" @click="setZoom(true)"><i class="el-icon-plus"></i></el-button>
<el-input class="el-input el-input--mini" :value="parseInt(zoom*100)+'%'" style="width:60px" readonly/>
<el-button size="mini" @click="setZoom(false)"><i class="el-icon-minus"></i></el-button>
</el-form-item>
</el-form>
</div>
<div class="draw-body">
<div class="zero-playground-body-center" :style="playgroundStyle">
<!-- <div class="zero-playground-draw-panel"> -->
<draw-canvas-panel></draw-canvas-panel>
<!-- </div> -->
</div>
</div>
</div>
</pane>
</template>
<script>
import Pane from '../../components/Pane';
import DrawPanel from './components/drawPanel';
import DrawCanvasPanel from './components/drawCanvasPanel';
import events from "@/global-events.js"
import Pane from '../../components/Pane';
import DrawPanel from './components/drawPanel';
import DrawCanvasPanel from './components/drawCanvasPanel';
import events from "@/global-events.js"
export default {
export default {
name: 'Playground',
components: { Pane, DrawPanel,DrawCanvasPanel},
props: {
},
components: {Pane, DrawPanel, DrawCanvasPanel},
props: {},
data () {
data() {
return {
zoom:0.5,
hasCtrlState:false,
overFlowState:false,
autoSelectState:true,
designWidth:750,
designHeight:1624
zoom: 0.5,
hasCtrlState: false,
overFlowState: false,
autoSelectState: true,
designWidth: 750,
designHeight: 1624
}
},
methods: {
mouseWheel(e){
if(!this.hasCtrlState){
mouseWheel(e) {
if (!this.hasCtrlState) {
return;
}
if(e.deltaY>0){
if (e.deltaY > 0) {
this.setZoom(false)
}else if(e.deltaY<0){
} else if (e.deltaY < 0) {
this.setZoom(true)
}
//console.log(this.zoom)
},
setZoom(state){
if(state){
if(this.zoom>=1.4){
this.zoom=1.4
}else{
this.zoom+=0.05
setZoom(state) {
if (state) {
if (this.zoom >= 1.4) {
this.zoom = 1.4
} else {
this.zoom += 0.05
}
}else{
if(this.zoom<=0.2){
this.zoom=0.2
}else{
this.zoom-=0.05
} else {
if (this.zoom <= 0.2) {
this.zoom = 0.2
} else {
this.zoom -= 0.05
}
}
// this.zoom=this.zoom.toFixed(2)
events.$emit('setPlaygroundZoom', {zoom:this.zoom});
events.$emit('setPlaygroundZoom', {zoom: this.zoom});
},
keyDo(state){
keyDo(state) {
//console.log(state)
this.hasCtrlState=state;
this.hasCtrlState = state;
},
overFlowCon(){}
overFlowCon() {
}
},
computed: {
playgroundStyle(){
playgroundStyle() {
//this.zoom=0.5;
let style={
zoom:`${this.zoom}`,
width:`${this.designWidth}px`,
height:`${this.designHeight}px`
let style = {
zoom: `${this.zoom}`,
width: `${this.designWidth}px`,
height: `${this.designHeight}px`
}
if(this.overFlowState){
style.overflow="hidden"
}else{
style.overflow="initial"
if (this.overFlowState) {
style.overflow = "hidden"
} else {
style.overflow = "initial"
}
// console.log(1213,style)
return style
},
},
created(){
created() {
//alert()
this.zoom=0.5;
this.zoom = 0.5;
events.$emit('autoSelectState', this.autoSelectState)
if(localStorage.designHeight){
this.designHeight=parseInt(localStorage.designHeight)
if (localStorage.designHeight) {
this.designHeight = parseInt(localStorage.designHeight)
}
if(localStorage.designWidth){
this.designWidth=parseInt(localStorage.designWidth)
if (localStorage.designWidth) {
this.designWidth = parseInt(localStorage.designWidth)
}
events.$emit('designWidth', this.designWidth);
events.$emit('designHeight', this.designHeight);
document.body.addEventListener('mousewheel',(e)=>{
document.body.addEventListener('mousewheel', (e) => {
this.mouseWheel(e)
},false)
}, false)
document.onkeydown = (e)=>{
document.onkeydown = (e) => {
let key = window.event.keyCode;
if (key == 18) {
this.keyDo(true);
}
};
document.onkeyup = (e)=>{
document.onkeyup = (e) => {
let key = window.event.keyCode;
if (key == 18) {
this.keyDo(false);
......@@ -158,45 +154,26 @@ export default {
},
mounted(){
events.$emit('setPlaygroundZoom', {zoom:this.zoom});
mounted() {
events.$emit('setPlaygroundZoom', {zoom: this.zoom});
//console.log(123)
},
watch: {
autoSelectState() {
events.$emit('autoSelectState', this.autoSelectState);
},
designWidth(){
localStorage.designWidth=this.designWidth
designWidth() {
localStorage.designWidth = this.designWidth
events.$emit('designWidth', this.designWidth);
},
designHeight(){
localStorage.designHeight= this.designHeight
designHeight() {
localStorage.designHeight = this.designHeight
events.$emit('designHeight', this.designHeight);
}
},
};
};
</script>
<style scoped>
</style>
<style lang="scss">
.pane-playground{
}
.draw-body{
width:100%;
height: 100%;
overflow: auto;
}
.playground-con{
width: 100%;
height: 50px;
}
.stage-set-label{
color: #606266;
white-space: nowrap;
font-weight: 500;
padding-left:10px ;
}
</style>
......@@ -22,6 +22,10 @@
computed: {
transPath() {
const {prev, next, outputType, outputIndex} = this.data;
let t = prev.design.output[outputType];
if(!t){
debugger
}
const from = prev.design.output[outputType][outputIndex];
const to = next.design.input['default'][0];
const fromPos = {
......
......@@ -38,6 +38,9 @@
this.ts = localStorage.getItem('preview-ts');
}
window.reloadPreview = ()=>{
this.reload();
};
document.addEventListener("visibilitychange", this.onVisibilityChange);
await db.open();
......@@ -65,7 +68,7 @@
setTimeout(() => {
this.flag = true;
this.buildPage();
}, 300);
}, 500);
},
onCommand(command) {
switch (command) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment