This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Application, Assets, loadNodeFont, utils, Text } from '@pixi/node'; | |
import { writeFileSync } from 'fs'; | |
import { Canvas, createImageData, createCanvas } from 'canvas'; | |
const data = this.app.renderer.extract.pixels(this.app.stage); | |
const { width, height } = this.app.stage; | |
const canvas = createCanvas(width, height); | |
const ctx = canvas.getContext('2d'); | |
const imagedata = createImageData(new Uint8ClampedArray(data), width, height); | |
ctx.putImageData(imagedata, 0, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//.context-menu形成透明层,点击。触发。mymenu消失 | |
.context-menu{ | |
.hidden-mask{ | |
position: fixed; | |
left: 0; | |
top:0; | |
width: 100%; | |
height: 100%; | |
z-index: 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url += (~url.indexOf('?') ? '&' : '?') + param + '=' + enc(id); | |
url = url.replace('?&', '?'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleChange(e){ | |
console.log('file',e.target.files) | |
let files = [...e.target.files] | |
let that = this | |
let fileList = [] | |
files.map((v,n)=>{ | |
let reader = new FileReader(e); | |
reader.onload = function () { | |
let url = event.target.result | |
fileList.push({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 去抖函数 | |
* @param func | |
* @param millisecond | |
*/ | |
module.exports = (func, millisecond)=>{ | |
//let timeId | |
let running = false | |
function debounced() { | |
if(running) return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parseHmtlToJson(html,cnt_attr) { | |
//timeline 处理 | |
let timeLineJson = [] | |
html = html.replace(/<!--TIMELINE-->(.*?)<!--\/TIMELINE-->/,(match)=>{ | |
//console.log(match) | |
timeLineJson = match.match(/<!--(TIME|EVENT)-->(.*?)<!--\/(TIME|EVENT)-->/g).map(v=>{ | |
let r = v.match(/<!--(TIME|EVENT)-->(?:<P>)*(.*?)(?:<\/P>)*<!--\/(TIME|EVENT)-->/) | |
return r?{ | |
type:r[1], | |
value:r[2] |