-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js.map
1 lines (1 loc) · 28.8 KB
/
index.js.map
1
{"version":3,"file":"index.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","parseFloat","__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