-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.es.js.map
1 lines (1 loc) · 28.8 KB
/
index.es.js.map
1
{"version":3,"file":"index.es.js","sources":["src/index.js"],"sourcesContent":["import karas from 'karas';\nimport { version } from '../package.json';\n\nconst {\n enums: {\n STYLE_KEY: {\n DISPLAY,\n VISIBILITY,\n OPACITY,\n },\n },\n refresh: {\n level: {\n REPAINT,\n },\n },\n util: {\n isNil,\n isFunction,\n },\n math: {\n geom: {\n d2r,\n },\n matrix: {\n identity,\n multiply,\n },\n },\n mode: {\n CANVAS,\n WEBGL,\n },\n} = karas;\n\nlet uuid = 0;\n\nclass FallingFlower extends karas.Component {\n constructor(props) {\n super(props);\n this.count = 0;\n this.time = 0;\n this.playbackRate = props.playbackRate || 1;\n this.interval = props.interval || 300;\n this.intervalNum = props.intervalNum || 1;\n this.num = props.num || 0;\n }\n\n shouldComponentUpdate() {\n return false;\n }\n\n componentWillUnmount() {\n Object.keys(this.hashImg || {}).forEach(k => {\n this.hashImg[k].release();\n });\n this.hashCache = {};\n this.hashMatrix = {};\n this.hashImg = {};\n this.hashOpacity = {};\n this.hashTfo = {};\n }\n\n componentDidMount() {\n let { props } = this;\n let { list = [], initNum = 0, delay = 0, autoPlay } = props;\n let dataList = [];\n let i = 0, length = list.length;\n let lastTime = 0, count = 0;\n let fake = this.ref.fake;\n let root = this.root;\n let hashCache = this.hashCache = {};\n let hashMatrix = this.hashMatrix = {};\n let hashImg = this.hashImg = {};\n let hashOpacity = this.hashOpacity = {};\n let hashTfo = this.hashTfo = {};\n let currentTime = 0, maxTime = 0;\n let hasStart;\n let self = this;\n let cb = this.cb = diff => {\n diff *= this.playbackRate;\n currentTime += diff;\n if(delay > 0) {\n delay -= diff;\n }\n if(delay <= 0) {\n diff += delay;\n this.time += diff;\n delay = 0;\n // 如果有初始粒子\n if(initNum > 0) {\n lastTime = this.time;\n while(initNum-- > 0) {\n i++;\n i %= length;\n count++;\n let o = this.genItem(list[i]);\n maxTime = Math.max(maxTime, currentTime + o.duration);\n dataList.push(o);\n }\n }\n // 已有的每个粒子时间增加计算位置,结束的则消失\n for(let j = dataList.length - 1; j >= 0; j--) {\n let item = dataList[j];\n item.time += diff;\n if(item.time >= item.duration) {\n dataList.splice(j, 1);\n delete hashCache[item.id];\n delete hashMatrix[item.id];\n }\n else if(item.source) {\n let { x, y, width, height, distance, direction, iterations = 1, time, duration } = item;\n let percent = time / duration;\n let dy = distance * percent;\n let per = duration / iterations;\n let count = Math.floor(time / per);\n item.nowPercent = (time % per) / per;\n item.nowDirection = (count % 2 === 0) ? direction : !direction;\n item.nowX = x - width * 0.5;\n item.nowY = y + dy - height * 0.5;\n item.loaded = true;\n hasStart = true;\n }\n }\n // 开始后每次都刷新,即便数据已空,要变成空白初始状态\n if(hasStart) {\n // fake.clearCache();\n // let p = fake.domParent;\n // while (p) {\n // p.clearCache(true);\n // p = p.domParent;\n // }\n root.__addUpdate(fake, {\n focus: REPAINT,\n cb() {\n self.emit('frame');\n },\n });\n }\n if(count >= this.num) {\n if(currentTime >= maxTime) {\n fake.removeFrameAnimate(cb);\n }\n return;\n }\n // 每隔interval开始生成这一阶段的粒子数据\n if(this.time >= lastTime + this.interval) {\n lastTime = this.time;\n for(let j = 0; j < this.intervalNum; j++) {\n i++;\n i %= length;\n count++;\n let o = this.genItem(list[i]);\n maxTime = Math.max(maxTime, currentTime + o.duration);\n dataList.push(o);\n if(count >= this.num) {\n break;\n }\n }\n }\n }\n };\n if(autoPlay !== false) {\n fake.frameAnimate(cb);\n }\n let shadowRoot = this.shadowRoot;\n let texCache = this.root.texCache;\n fake.render = (renderMode, ctx, dx = 0, dy = 0) => {\n let time = currentTime - delay;\n if(time < 0) {\n return;\n }\n let computedStyle = shadowRoot.computedStyle;\n if(computedStyle[DISPLAY] === 'none'\n || computedStyle[VISIBILITY] === 'hidden'\n || computedStyle[OPACITY] <= 0) {\n return;\n }\n let { sx, sy } = fake;\n let globalAlpha;\n if(renderMode === CANVAS) {\n globalAlpha = ctx.globalAlpha;\n }\n else if(renderMode === WEBGL) {\n globalAlpha = computedStyle[OPACITY];\n }\n dataList.forEach(item => {\n if(item.loaded) {\n let opacity = globalAlpha;\n opacity *= item.opacity;\n // 计算位置\n let x = item.nowX + sx + dx;\n let y = item.nowY + sy + dy;\n let m = identity();\n let tfo = [x, y + item.origin];\n if(renderMode === CANVAS) {\n m = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tfo[0], tfo[1], 0, 1], m);\n }\n let r;\n // 左右摇摆为一个时期,前半在一侧后半在另一侧\n if(item.nowPercent >= 0.5) {\n r = d2r(item.deg * (item.nowPercent - 0.5) * (item.nowDirection ? -1 : 1));\n }\n else {\n r = d2r(item.deg * (0.5 - item.nowPercent) * (item.nowDirection ? 1 : -1));\n }\n let t = identity();\n let sin = Math.sin(r);\n let cos = Math.cos(r);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n m = multiply(m, t);\n if(renderMode === WEBGL) {\n // webgl特殊记录,其tfo如果在局部缓存下偏移量要特殊计算,canvas无感知\n // hashTfo[item.id] = tfo;\n // let cache = hashCache[item.id];\n // if(!cache) {\n // let url = item.url;\n // if(!hashImg[url]) {\n // cache = hashCache[item.id] = Cache.getInstance(\n // [x - 1, y - 1, x + item.sourceWidth + 1, y + item.sourceHeight + 1],\n // x, y\n // );\n // cache.ctx.drawImage(item.source, x + cache.dx, y + cache.dy)\n // hashImg[url] = cache;\n // }\n // else {\n // let c = hashImg[url];\n // cache = hashCache[item.id] = new karas.refresh.Cache(\n // c.width, c.height,\n // [x - 1, y - 1, x + item.sourceWidth + 1, y + item.sourceHeight + 1],\n // c.page, c.pos, x, y\n // );\n // }\n // }\n // else {\n // cache.__bbox = [x - 1, y - 1, x + item.sourceWidth + 1, y + item.sourceHeight + 1];\n // cache.__sx = x;\n // cache.__sy = y;\n // }\n // if(item.width !== item.sourceWidth && item.height !== item.sourceHeight) {\n // let t2 = identity();\n // t2[0] = item.width / item.sourceWidth;\n // t2[5] = item.height / item.sourceHeight;\n // m = multiply(m, t2);\n // }\n // hashMatrix[item.id] = m;\n // hashOpacity[item.id] = opacity;\n }\n else if(renderMode === CANVAS) {\n ctx.globalAlpha = opacity;\n // canvas处理方式不一样,render的dx和dy包含了total的偏移计算考虑,可以无感知\n m = multiply(m, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -tfo[0], -tfo[1], 0, 1]);\n // 父级的m\n let pm = this.matrixEvent;\n if(pm) {\n m = multiply(pm, m);\n }\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n ctx.drawImage(item.source, x, y, item.width, item.height);\n }\n }\n });\n if(renderMode === CANVAS) {\n ctx.globalAlpha = globalAlpha;\n }\n };\n // fake.hookGlRender = function(gl, opacity, matrix, cx, cy, dx, dy, revertY) {\n // let computedStyle = shadowRoot.computedStyle;\n // if(computedStyle[DISPLAY] === 'none'\n // || computedStyle[VISIBILITY] === 'hidden'\n // || computedStyle[OPACITY] <= 0) {\n // return;\n // }\n // dataList.forEach(item => {\n // if(item.loaded) {\n // let id = item.id;\n // let tfo = hashTfo[id].slice(0);\n // tfo[0] += dx;\n // tfo[1] += dy;\n // let m = hashMatrix[id];\n // m = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tfo[0], tfo[1], 0, 1], m);\n // m = multiply(m, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -tfo[0], -tfo[1], 0, 1]);\n // // 父级的m\n // if(matrix) {\n // m = multiply(matrix, m);\n // }\n // texCache.addTexAndDrawWhenLimit(gl, hashCache[id], hashOpacity[id], m, cx, cy, dx, dy, revertY);\n // }\n // });\n // };\n }\n\n genItem(item) {\n let { width, height, props } = this;\n let o = {\n id: uuid++,\n time: 0,\n url: item.url,\n };\n if(Array.isArray(item.x)) {\n o.x = (item.x[0] + Math.random() * (item.x[1] - item.x[0])) * width;\n }\n else {\n o.x = item.x * width;\n }\n if(Array.isArray(item.y)) {\n o.y = (item.y[0] + Math.random() * (item.y[1] - item.y[0])) * height;\n }\n else {\n o.y = item.y * height;\n }\n if(Array.isArray(item.duration)) {\n o.duration = (item.duration[0] + Math.random() * (item.duration[1] - item.duration[0]));\n }\n else {\n o.duration = item.duration;\n }\n if(Array.isArray(item.width)) {\n o.width = item.width[0] + Math.random() * (item.width[1] - item.width[0]);\n }\n else if(!isNil(item.width)) {\n o.width = item.width;\n }\n if(Array.isArray(item.height)) {\n o.height = item.height[0] + Math.random() * (item.height[1] - item.height[0]);\n }\n else if(!isNil(item.height)) {\n o.height = item.height;\n }\n let distance = 0;\n if(Array.isArray(item.distance)) {\n distance = (item.distance[0] + Math.random() * (item.distance[1] - item.distance[0])) * height;\n }\n else if(distance) {\n distance = item.distance * height;\n }\n o.distance = distance;\n if(Array.isArray(item.deg)) {\n o.deg = item.deg[0] + Math.random() * (item.deg[1] - item.deg[0]);\n }\n else if(!isNil(item.deg)) {\n o.deg = item.deg;\n }\n else {\n o.deg = 0;\n }\n if(Array.isArray(item.origin)) {\n o.origin = item.origin[0] + Math.random() * (item.origin[1] - item.origin[0]);\n }\n else if(!isNil(item.origin)) {\n o.origin = item.origin;\n }\n else {\n o.origin = 0;\n }\n // 随机左右\n o.direction = Math.random() > 0.5;\n if(Array.isArray(item.iterations)) {\n o.iterations = item.iterations[0] + Math.round(Math.random() * (item.iterations[1] - item.iterations[0]));\n }\n else if(!isNil(item.iterations)) {\n o.iterations = item.iterations;\n }\n if(item.url) {\n karas.inject.measureImg(item.url, function(res) {\n if(res.success) {\n o.source = res.source;\n o.sourceWidth = res.width;\n o.sourceHeight = res.height;\n if(!(isNil(o.width) && isNil(o.height))) {\n if(isNil(o.width)) {\n o.width = res.width / res.height * o.height;\n }\n else if(isNil(o.height)) {\n o.height = o.width * res.height / res.width;\n }\n }\n else {\n o.width = res.width;\n o.height = res.height;\n }\n if(o.height) {\n o.origin *= o.height;\n }\n }\n });\n }\n if(props.hookData && isFunction(props.hookData)) {\n o = props.hookData(o);\n }\n return o;\n }\n\n pause() {\n this.ref.fake.removeFrameAnimate(this.cb);\n }\n\n resume() {\n this.ref.fake.frameAnimate(this.cb);\n }\n\n play() {\n this.count = 0;\n this.time = 0;\n this.ref.fake.removeFrameAnimate(this.cb);\n this.ref.fake.frameAnimate(this.cb);\n }\n\n get playbackRate() {\n return this.__playbackRate;\n }\n\n set playbackRate(v) {\n this.__playbackRate = parseFloat(v) || 1;\n }\n\n get interval() {\n return this.__interval;\n }\n\n get intervalNum() {\n return this.__intervalNum;\n }\n\n set intervalNum(v) {\n this.__intervalNum = parseInt(v) || 1;\n }\n\n set interval(v) {\n this.__interval = parseInt(v) || 300;\n }\n\n get num() {\n return this.__num;\n }\n\n set num(v) {\n if(v === Infinity || /infinity/i.test(v)) {\n this.__num = Infinity;\n }\n else {\n this.__num = parseInt(v) || 0;\n }\n }\n\n render() {\n return <div>\n <$polyline ref=\"fake\" style={{width:0,height:0,visibility:'hidden'}}/>\n </div>;\n }\n}\n\nFallingFlower.version = version;\n\nexport default FallingFlower;\n"],"names":["karas","enums","STYLE_KEY","DISPLAY","VISIBILITY","OPACITY","REPAINT","refresh","level","util","isNil","isFunction","math","d2r","geom","matrix","identity","multiply","mode","CANVAS","WEBGL","uuid","FallingFlower","props","count","time","playbackRate","interval","intervalNum","num","Object","keys","hashImg","forEach","k","release","hashCache","hashMatrix","hashOpacity","hashTfo","list","initNum","delay","autoPlay","dataList","i","length","lastTime","fake","ref","root","currentTime","maxTime","hasStart","self","cb","diff","o","genItem","Math","max","duration","push","j","item","splice","id","source","x","y","width","height","distance","direction","iterations","percent","dy","per","floor","nowPercent","nowDirection","nowX","nowY","loaded","__addUpdate","focus","emit","removeFrameAnimate","frameAnimate","shadowRoot","texCache","render","renderMode","ctx","dx","computedStyle","sx","sy","globalAlpha","opacity","m","tfo","origin","r","deg","t","sin","cos","pm","matrixEvent","setTransform","drawImage","url","Array","isArray","random","round","inject","measureImg","res","success","sourceWidth","sourceHeight","hookData","__playbackRate","v","par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