From 6ddf3d2a86284a3302c9aeefaf6fd58092e429f2 Mon Sep 17 00:00:00 2001 From: Lee EC Date: Wed, 14 Aug 2019 20:50:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/bundle-parallax.js | 4 ++-- dist/config-parallax.js | 2 +- dist/control-parallax.js | 2 +- dist/index.html | 4 ++-- dist/index_demo.html | 4 ++-- info.json | 6 +++--- package.json | 1 + src/index.js | 5 +++++ 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dist/bundle-parallax.js b/dist/bundle-parallax.js index 57cfacd..2be3acb 100644 --- a/dist/bundle-parallax.js +++ b/dist/bundle-parallax.js @@ -1,3 +1,3 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="//storage.jd.com/ambient/",n(n.s=98)}([function(t,e){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){t.exports=!n(7)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(1),r=n(0),o=n(24),a=n(10),c=n(3),s=function(t,e,n){var u,l,h,f=t&s.F,d=t&s.G,p=t&s.S,v=t&s.P,m=t&s.B,x=t&s.W,g=d?r:r[e]||(r[e]={}),y=g.prototype,_=d?i:p?i[e]:(i[e]||{}).prototype;for(u in d&&(n=e),n)(l=!f&&_&&void 0!==_[u])&&c(g,u)||(h=l?_[u]:n[u],g[u]=d&&"function"!=typeof _[u]?n[u]:m&&l?o(h,i):x&&_[u]==h?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):v&&"function"==typeof h?o(Function.call,h):h,v&&((g.virtual||(g.virtual={}))[u]=h,t&s.R&&y&&!y[u]&&a(y,u,h)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var i=n(11),r=n(25),o=n(22),a=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(29),r=n(12);t.exports=function(t){return i(r(t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i="parallax",r=i.toUpperCase();e.O2_AMBIENT_MAIN="O2_AMBIENT_"+r+"_MAIN",e.O2_AMBIENT_INIT="O2_AMBIENT_"+r+"_INIT",e.O2_AMBIENT_CONFIG="O2_AMBIENT_"+r+"_CONFIG",e.O2_AMBIENT_CLASSNAME="o2_ambient_"+i,e.O2_AMBIENT_CONFIG_KEY="O2_AMBIENT_CONFIG_KEY",e.O2_AMBIENT_IS_CONFIG_RESET="O2_AMBIENT_IS_CONFIG_RESET"},function(t,e,n){var i=n(5),r=n(15);t.exports=n(2)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(6);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!0},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(28),r=n(23);t.exports=Object.keys||function(t){return i(t,r)}},,function(t,e,n){var i=n(12);t.exports=function(t){return Object(i(t))}},function(t,e,n){var i=n(21)("keys"),r=n(14);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e,n){var i=n(0),r=n(1),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:i.version,mode:n(13)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var i=n(6);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(34);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(2)&&!n(7)(function(){return 7!=Object.defineProperty(n(26)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(6),r=n(1).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){"use strict";e.__esModule=!0;var i,r=n(35),o=(i=r)&&i.__esModule?i:{default:i};e.default=function(){function t(t,e){for(var n=0;ns;)i(c,n=e[s++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(30);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},,function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){var i=n(4),r=n(0),o=n(7);t.exports=function(t,e){var n=(r.Object||{})[t]||Object[t],a={};a[t]=e(n),i(i.S+i.F*o(function(){n(1)}),"Object",a)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){t.exports={default:n(36),__esModule:!0}},function(t,e,n){n(37);var i=n(0).Object;t.exports=function(t,e,n){return i.defineProperty(t,e,n)}},function(t,e,n){var i=n(4);i(i.S+i.F*!n(2),"Object",{defineProperty:n(5).f})},,,function(t,e,n){var i=n(8),r=n(41),o=n(42);t.exports=function(t){return function(e,n,a){var c,s=i(e),u=r(s.length),l=o(a,u);if(t&&n!=n){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var i=n(16),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){var i=n(16),r=Math.max,o=Math.min;t.exports=function(t,e){return(t=i(t))<0?r(t+e,0):o(t,e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){t.exports=n(99)},function(t,e,n){"use strict";n(100),n(101)},function(t,e){},function(t,e,n){"use strict";n(102);var i,r=n(9),o=n(103),a=(i=o)&&i.__esModule?i:{default:i};var c=document.querySelector(".o2team_ambient_main");function s(){var t=new a.default({});window[r.O2_AMBIENT_MAIN]=t}c.addEventListener("click",function(){c.style.display="none"}),window[r.O2_AMBIENT_INIT]=s;try{var u=setInterval(function(){window[r.O2_AMBIENT_CONFIG]&&(clearInterval(u),s())},1e3)}catch(t){console.log(t)}},function(t,e,n){"use strict";!function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;nr;r++)this.elements.push(n[r]);return this.elements.sort(t),this},remove:function(t){var e=this.elements.indexOf(t);return e>-1&&this.elements.splice(e,1),this},render:function(){var t=this,e=0,i=t.elements.length,r=0,o=0,c=t.fullscreen||"pointer"!==t.tracking;for(t.animating&&(t.animating=a(t.render.bind(t))),t.tracking&&("scroll"===t.tracking?(u||(u=!0,f(),n.addEventListener("scroll",f),n.addEventListener("touchmove",f)),t.x=l,t.y=h):"pointer"===t.tracking&&(d||(d=!0,n.addEventListener("mousemove",m),n.addEventListener("touchmove",m)),c||(r=t.canvas.offsetLeft,o=t.canvas.offsetTop,c=p>=r&&p<=r+t.width&&v>=o&&v<=o+t.height),c&&(t.x=-p+r,t.y=-v+o)),t.x=!c||!0!==t.trackingInvert&&"invertx"!==t.trackingInvert?t.x:-t.x,t.y=!c||!0!==t.trackingInvert&&"inverty"!==t.trackingInvert?t.y:-t.y),t._x+=(-t.x-t._x)/t.damping,t._y+=(-t.y-t._y)/t.damping,t.ctx.clearRect(0,0,t.width,t.height),t.preRender(t.ctx,t);i>e;e++)t.ctx.save(),t.elements[e]._render(t.ctx,t),t.ctx.restore();return t.postRender(t.ctx,t),this},resize:function(t,e){return this.width=this.canvas.width=t,this.height=this.canvas.height=e,this},resizeFullscreen:function(){return this.resize(n.innerWidth,n.innerHeight)},play:function(){return this.animating=!0,this.render()},pause:function(){return this.animating=!1,this}},Canvallax.createElement=function(){var t=Math.PI/180,e={x:0,y:0,distance:1,fixed:!1,opacity:1,fill:!1,stroke:!1,lineWidth:!1,transformOrigin:"center center",scale:1,rotation:0,preRender:c,render:c,postRender:c,init:c,crop:!1,getTransformPoint:function(){var t=this,e=t.transformOrigin.split(" "),n={x:t.x,y:t.y};return"center"===e[0]?n.x+=t.width?t.width/2:t.size:"right"===e[0]&&(n.x+=t.width?t.width:2*t.size),"center"===e[1]?n.y+=t.height?t.height/2:t.size:"bottom"===e[1]&&(n.y+=t.height?t.height:2*t.size),n},_render:function(e,n){var i=this,r=i.distance||1,o=n._x,a=n._y,c=function(t){var e=function(t){return[t.transformOrigin,t.x,t.y,t.width,t.height,t.size].join(" ")}(t);return t._pointCache&&t._pointChecksum===e||(t._pointCache=t.getTransformPoint(),t._pointChecksum=e),t._pointCache}(i);return i.preRender.call(i,e,n),i.blend&&(n.ctx.globalCompositeOperation=i.blend),n.ctx.globalAlpha=i.opacity,n.ctx.translate(c.x,c.y),!1===i.scale?(o*=r,a*=r):n.ctx.scale(r,r),i.fixed||n.ctx.translate(o,a),!1!==i.scale&&n.ctx.scale(i.scale,i.scale),i.rotation&&n.ctx.rotate(i.rotation*t),n.ctx.translate(-c.x,-c.y),i.crop&&(e.beginPath(),"function"==typeof i.crop?i.crop.call(i,e,n):e.rect(i.crop.x,i.crop.y,i.crop.width,i.crop.height),e.clip(),e.closePath()),i.outline&&(e.beginPath(),e.rect(i.x,i.y,i.width||2*i.size,i.height||2*i.size),e.closePath(),e.strokeStyle=i.outline,e.stroke()),i.render.call(i,e,n),this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(this.lineWidth&&(e.lineWidth=this.lineWidth),e.strokeStyle=this.stroke,e.stroke()),i.postRender.call(i,e,n),i},clone:function(t){t=Canvallax.extend({},this,t);return new this.constructor(t)}};return function(t){function n(t){return this instanceof n?(Canvallax.extend(this,t),this.init.apply(this,arguments),this):new n(t)}return n.prototype=Canvallax.extend({},e,t),n.prototype.constructor=n,n.clone=n.prototype.clone,n}}(),Canvallax.extend=function(t){t=t||{};var e=arguments.length,n=1;for(1===arguments.length&&(t=this,n=0);e>n;n++)if(arguments[n])for(var i in arguments[n])arguments[n].hasOwnProperty(i)&&(t[i]=arguments[n][i]);return t};var x=2*Math.PI;Canvallax.Circle=Canvallax.createElement({size:20,render:function(t){t.beginPath(),t.arc(this.x+this.size,this.y+this.size,this.size,0,x),t.closePath()}}),Canvallax.Element=Canvallax.createElement(),Canvallax.Image=Canvallax.createElement({src:null,image:null,width:null,height:null,init:function(t){this.image=this.image&&1===this.image.nodeType?this.image:t&&1===t.nodeType?t:new Image,e.bind(this)(),this.image.onload=e.bind(this),this.image.src=this.image.src||t.src||t},render:function(t){this.image&&t.drawImage(this.image,this.x,this.y,this.width,this.height)}});x=2*Math.PI;Canvallax.Polygon=Canvallax.createElement({sides:6,size:20,render:function(t){var e=this.sides;for(t.translate(this.x+this.size,this.y+this.size),t.beginPath(),t.moveTo(this.size,0);e--;)t.lineTo(this.size*Math.cos(e*x/this.sides),this.size*Math.sin(e*x/this.sides));t.closePath()}}),Canvallax.Rectangle=Canvallax.createElement({width:100,height:100,render:function(t){t.beginPath(),t.rect(this.x,this.y,this.width,this.height),t.closePath()}})}()}]); \ No newline at end of file +!function(){function e(e,t){return e.zIndex===t.zIndex?0:e.zIndexa;a++)this.elements.push(n[a]);return this.elements.sort(e),this},remove:function(e){var t=this.elements.indexOf(e);return t>-1&&this.elements.splice(t,1),this},render:function(){var e=this,t=0,i=e.elements.length,a=0,r=0,o=e.fullscreen||"pointer"!==e.tracking;for(e.animating&&(e.animating=s(e.render.bind(e))),e.tracking&&("scroll"===e.tracking?(l||(l=!0,d(),n.addEventListener("scroll",d),n.addEventListener("touchmove",d)),e.x=h,e.y=u):"pointer"===e.tracking&&(m||(m=!0,n.addEventListener("mousemove",p),n.addEventListener("touchmove",p)),o||(a=e.canvas.offsetLeft,r=e.canvas.offsetTop,o=f>=a&&f<=a+e.width&&v>=r&&v<=r+e.height),o&&(e.x=-f+a,e.y=-v+r)),e.x=!o||!0!==e.trackingInvert&&"invertx"!==e.trackingInvert?e.x:-e.x,e.y=!o||!0!==e.trackingInvert&&"inverty"!==e.trackingInvert?e.y:-e.y),e._x+=(-e.x-e._x)/e.damping,e._y+=(-e.y-e._y)/e.damping,e.ctx.clearRect(0,0,e.width,e.height),e.preRender(e.ctx,e);i>t;t++)e.ctx.save(),e.elements[t]._render(e.ctx,e),e.ctx.restore();return e.postRender(e.ctx,e),this},resize:function(e,t){return this.width=this.canvas.width=e,this.height=this.canvas.height=t,this},resizeFullscreen:function(){return this.resize(n.innerWidth,n.innerHeight)},play:function(){return this.animating=!0,this.render()},pause:function(){return this.animating=!1,this}},Canvallax.createElement=function(){var e=Math.PI/180,t={x:0,y:0,distance:1,fixed:!1,opacity:1,fill:!1,stroke:!1,lineWidth:!1,transformOrigin:"center center",scale:1,rotation:0,preRender:o,render:o,postRender:o,init:o,crop:!1,getTransformPoint:function(){var e=this,t=e.transformOrigin.split(" "),n={x:e.x,y:e.y};return"center"===t[0]?n.x+=e.width?e.width/2:e.size:"right"===t[0]&&(n.x+=e.width?e.width:2*e.size),"center"===t[1]?n.y+=e.height?e.height/2:e.size:"bottom"===t[1]&&(n.y+=e.height?e.height:2*e.size),n},_render:function(t,n){var i=this,a=i.distance||1,r=n._x,s=n._y,o=function(e){var t=function(e){return[e.transformOrigin,e.x,e.y,e.width,e.height,e.size].join(" ")}(e);return e._pointCache&&e._pointChecksum===t||(e._pointCache=e.getTransformPoint(),e._pointChecksum=t),e._pointCache}(i);return i.preRender.call(i,t,n),i.blend&&(n.ctx.globalCompositeOperation=i.blend),n.ctx.globalAlpha=i.opacity,n.ctx.translate(o.x,o.y),!1===i.scale?(r*=a,s*=a):n.ctx.scale(a,a),i.fixed||n.ctx.translate(r,s),!1!==i.scale&&n.ctx.scale(i.scale,i.scale),i.rotation&&n.ctx.rotate(i.rotation*e),n.ctx.translate(-o.x,-o.y),i.crop&&(t.beginPath(),"function"==typeof i.crop?i.crop.call(i,t,n):t.rect(i.crop.x,i.crop.y,i.crop.width,i.crop.height),t.clip(),t.closePath()),i.outline&&(t.beginPath(),t.rect(i.x,i.y,i.width||2*i.size,i.height||2*i.size),t.closePath(),t.strokeStyle=i.outline,t.stroke()),i.render.call(i,t,n),this.fill&&(t.fillStyle=this.fill,t.fill()),this.stroke&&(this.lineWidth&&(t.lineWidth=this.lineWidth),t.strokeStyle=this.stroke,t.stroke()),i.postRender.call(i,t,n),i},clone:function(e){e=Canvallax.extend({},this,e);return new this.constructor(e)}};return function(e){function n(e){return this instanceof n?(Canvallax.extend(this,e),this.init.apply(this,arguments),this):new n(e)}return n.prototype=Canvallax.extend({},t,e),n.prototype.constructor=n,n.clone=n.prototype.clone,n}}(),Canvallax.extend=function(e){e=e||{};var t=arguments.length,n=1;for(1===arguments.length&&(e=this,n=0);t>n;n++)if(arguments[n])for(var i in arguments[n])arguments[n].hasOwnProperty(i)&&(e[i]=arguments[n][i]);return e};var g=2*Math.PI;Canvallax.Circle=Canvallax.createElement({size:20,render:function(e){e.beginPath(),e.arc(this.x+this.size,this.y+this.size,this.size,0,g),e.closePath()}}),Canvallax.Element=Canvallax.createElement(),Canvallax.Image=Canvallax.createElement({src:null,image:null,width:null,height:null,init:function(e){this.image=this.image&&1===this.image.nodeType?this.image:e&&1===e.nodeType?e:new Image,t.bind(this)(),this.image.onload=t.bind(this),this.image.src=this.image.src||e.src||e},render:function(e){this.image&&e.drawImage(this.image,this.x,this.y,this.width,this.height)}});g=2*Math.PI;Canvallax.Polygon=Canvallax.createElement({sides:6,size:20,render:function(e){var t=this.sides;for(e.translate(this.x+this.size,this.y+this.size),e.beginPath(),e.moveTo(this.size,0);t--;)e.lineTo(this.size*Math.cos(t*g/this.sides),this.size*Math.sin(t*g/this.sides));e.closePath()}}),Canvallax.Rectangle=Canvallax.createElement({width:100,height:100,render:function(e){e.beginPath(),e.rect(this.x,this.y,this.width,this.height),e.closePath()}})}()}]); \ No newline at end of file diff --git a/dist/config-parallax.js b/dist/config-parallax.js index 926828c..0346c13 100644 --- a/dist/config-parallax.js +++ b/dist/config-parallax.js @@ -1 +1 @@ -!function(e){var t={};function r(_){if(t[_])return t[_].exports;var n=t[_]={i:_,l:!1,exports:{}};return e[_].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,_){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:_})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="//storage.jd.com/ambient/",r(r.s=54)}({54:function(e,t,r){e.exports=r(55)},55:function(e,t,r){"use strict";var _=r(9);window[_.O2_AMBIENT_CONFIG]={particleNumber:400,fullScreen:!0,textures:["","","","","","","",""]}},9:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var _="parallax",n=_.toUpperCase();t.O2_AMBIENT_MAIN="O2_AMBIENT_"+n+"_MAIN",t.O2_AMBIENT_INIT="O2_AMBIENT_"+n+"_INIT",t.O2_AMBIENT_CONFIG="O2_AMBIENT_"+n+"_CONFIG",t.O2_AMBIENT_CLASSNAME="o2_ambient_"+_,t.O2_AMBIENT_CONFIG_KEY="O2_AMBIENT_CONFIG_KEY",t.O2_AMBIENT_IS_CONFIG_RESET="O2_AMBIENT_IS_CONFIG_RESET"}}); \ No newline at end of file +!function(e){var _={};function t(r){if(_[r])return _[r].exports;var n=_[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=e,t.c=_,t.d=function(e,_,r){t.o(e,_)||Object.defineProperty(e,_,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var _=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(_,"a",_),_},t.o=function(e,_){return Object.prototype.hasOwnProperty.call(e,_)},t.p="//storage.jd.com/ambient/",t(t.s=5)}([function(e,_,t){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.O2_AMBIENT_IS_CONFIG_RESET=_.O2_AMBIENT_CONFIG_KEY=_.O2_AMBIENT_CLASSNAME=_.O2_AMBIENT_CONFIG=_.O2_AMBIENT_INIT=_.O2_AMBIENT_MAIN=void 0;var r="parallax",n=r.toUpperCase(),o="O2_AMBIENT_".concat(n,"_MAIN");_.O2_AMBIENT_MAIN=o;var I="O2_AMBIENT_".concat(n,"_INIT");_.O2_AMBIENT_INIT=I;var a="O2_AMBIENT_".concat(n,"_CONFIG");_.O2_AMBIENT_CONFIG=a;var N="o2_ambient_".concat(r);_.O2_AMBIENT_CLASSNAME=N;_.O2_AMBIENT_CONFIG_KEY="O2_AMBIENT_CONFIG_KEY";_.O2_AMBIENT_IS_CONFIG_RESET="O2_AMBIENT_IS_CONFIG_RESET"},,,,,function(e,_,t){e.exports=t(6)},function(e,_,t){"use strict";var r=t(0);window[r.O2_AMBIENT_CONFIG]={particleNumber:20,fullScreen:!0,textures:["//storage.jd.com/o2images/34cafbecea6d24c062ea5177adbb42d1.png","//storage.jd.com/o2images/92da6c3db10b3984491a6089f58da2bb.png"]}}]); \ No newline at end of file diff --git a/dist/control-parallax.js b/dist/control-parallax.js index 2b98bcd..8efb677 100644 --- a/dist/control-parallax.js +++ b/dist/control-parallax.js @@ -1 +1 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="//storage.jd.com/ambient/",n(n.s=56)}([function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){e.exports=!n(7)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var o=n(1),i=n(0),r=n(24),a=n(10),s=n(3),u=function(e,t,n){var l,c,d,f=e&u.F,p=e&u.G,h=e&u.S,_=e&u.P,m=e&u.B,g=e&u.W,b=p?i:i[t]||(i[t]={}),v=b.prototype,y=p?o:h?o[t]:(o[t]||{}).prototype;for(l in p&&(n=t),n)(c=!f&&y&&void 0!==y[l])&&s(b,l)||(d=c?y[l]:n[l],b[l]=p&&"function"!=typeof y[l]?n[l]:m&&c?r(d,o):g&&y[l]==d?function(e){var t=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):_&&"function"==typeof d?r(Function.call,d):d,_&&((b.virtual||(b.virtual={}))[l]=d,e&u.R&&v&&!v[l]&&a(v,l,d)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var o=n(11),i=n(25),r=n(22),a=Object.defineProperty;t.f=n(2)?Object.defineProperty:function(e,t,n){if(o(e),t=r(t,!0),o(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var o=n(29),i=n(12);e.exports=function(e){return o(i(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="parallax",i=o.toUpperCase();t.O2_AMBIENT_MAIN="O2_AMBIENT_"+i+"_MAIN",t.O2_AMBIENT_INIT="O2_AMBIENT_"+i+"_INIT",t.O2_AMBIENT_CONFIG="O2_AMBIENT_"+i+"_CONFIG",t.O2_AMBIENT_CLASSNAME="o2_ambient_"+o,t.O2_AMBIENT_CONFIG_KEY="O2_AMBIENT_CONFIG_KEY",t.O2_AMBIENT_IS_CONFIG_RESET="O2_AMBIENT_IS_CONFIG_RESET"},function(e,t,n){var o=n(5),i=n(15);e.exports=n(2)?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var o=n(6);e.exports=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=!0},function(e,t){var n=0,o=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+o).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=Math.ceil,o=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?o:n)(e)}},function(e,t,n){var o=n(28),i=n(23);e.exports=Object.keys||function(e){return o(e,i)}},function(e,t,n){var o=n(21)("wks"),i=n(14),r=n(1).Symbol,a="function"==typeof r;(e.exports=function(e){return o[e]||(o[e]=a&&r[e]||(a?r:i)("Symbol."+e))}).store=o},function(e,t,n){var o=n(12);e.exports=function(e){return Object(o(e))}},function(e,t,n){var o=n(21)("keys"),i=n(14);e.exports=function(e){return o[e]||(o[e]=i(e))}},function(e,t,n){var o=n(0),i=n(1),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:o.version,mode:n(13)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var o=n(6);e.exports=function(e,t){if(!o(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!o(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!o(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var o=n(34);e.exports=function(e,t,n){if(o(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,i){return e.call(t,n,o,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){e.exports=!n(2)&&!n(7)(function(){return 7!=Object.defineProperty(n(26)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var o=n(6),i=n(1).document,r=o(i)&&o(i.createElement);e.exports=function(e){return r?i.createElement(e):{}}},function(e,t,n){"use strict";t.__esModule=!0;var o,i=n(35),r=(o=i)&&o.__esModule?o:{default:o};t.default=function(){function e(e,t){for(var n=0;nu;)o(s,n=t[u++])&&(~r(l,n)||l.push(n));return l}},function(e,t,n){var o=n(30);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==o(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var o=n(4),i=n(0),r=n(7);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),o(o.S+o.F*r(function(){n(1)}),"Object",a)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports={default:n(36),__esModule:!0}},function(e,t,n){n(37);var o=n(0).Object;e.exports=function(e,t,n){return o.defineProperty(e,t,n)}},function(e,t,n){var o=n(4);o(o.S+o.F*!n(2),"Object",{defineProperty:n(5).f})},function(e,t){e.exports={}},function(e,t,n){var o=n(11),i=n(68),r=n(23),a=n(20)("IE_PROTO"),s=function(){},u=function(){var e,t=n(26)("iframe"),o=r.length;for(t.style.display="none",n(69).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write(" + \ No newline at end of file diff --git a/dist/index_demo.html b/dist/index_demo.html index 86321ac..ee35ae9 100644 --- a/dist/index_demo.html +++ b/dist/index_demo.html @@ -8,7 +8,7 @@ - +
@@ -17,5 +17,5 @@ - + \ No newline at end of file diff --git a/info.json b/info.json index 82c7f51..4a743b3 100755 --- a/info.json +++ b/info.json @@ -5,8 +5,8 @@ "title": "parallax", "ambName": "视差滚动", "github": "https://github.com/o2team-ambient/parallax", - "demoSnippet": "\n
\n
\n ", - "controlUrl": "//storage.jd.com/ambient/control-parallax.js?t=1552544273000", - "configUrl": "//storage.jd.com/ambient/config-parallax.js?t=1552544273000", + "demoSnippet": "\n
\n
\n ", + "controlUrl": "//storage.jd.com/ambient/control-parallax.js?t=1565787044000", + "configUrl": "//storage.jd.com/ambient/config-parallax.js?t=1565787044000", "placeholderImg": "//storage.jd.com/ambient/parallax_placeholder.png?t=1554088450000" } diff --git a/package.json b/package.json index f34bd64..4551c84 100755 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "license": "ISC", "dependencies": { "@o2team/ambient-dat.gui": "^0.7.9", + "@o2team/ambient-report": "^1.0.3", "canvallax": "^1.2.0" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index 68634a0..79bb3ae 100755 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,8 @@ import './css/base.scss' import './css/package.scss' +import Report from '@o2team/ambient-report' + import { O2_AMBIENT_CONFIG } from './js/utils/const' import initAmbient from './js/ambient' @@ -14,3 +16,6 @@ try { } catch (e) { console.log(e) } + +Report.init({}) +Report.processPV()