├── .babelrc
├── LICENSE
├── README.md
├── build
├── config.js
├── dev-client.js
├── dev-server.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
└── webpack.prod.conf.js
├── demo.gif
├── demo_1.gif
├── demo_2.gif
├── demo_3.gif
├── demo_4.gif
├── dist
├── pixelSwiper.js
├── pixelSwiper.js.map
├── pixelSwiper.worker.js
└── pixelSwiper.worker.js.map
├── package-lock.json
├── package.json
└── src
├── calc.js
├── calc.worker.js
├── index.js
└── particle.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015",
4 | "stage-2"
5 | ],
6 | "plugins": [
7 | "transform-runtime"
8 | ],
9 | "comments": false
10 | }
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 axi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # pixel-swiper
2 | > pixel picture or text effect by canvas
3 |
4 | [DEMO 1](https://jsbin.com/giwusop/edit?html,output)
5 |
6 | 
7 |
8 | [DEMO 2](https://jsbin.com/kunumik/edit?html,output)
9 |
10 | 
11 |
12 | [DEMO 3](http://jsbin.com/fifasax/edit?html,output)
13 |
14 | 
15 |
16 | [DEMO 4](http://jsbin.com/dehavaw/edit?html,output)
17 |
18 | 
19 |
20 |
21 | # Browser
22 | ```html
23 |
24 | ```
25 |
26 | # Default import
27 | ```
28 | npm install pixel-swiper
29 | ```
30 |
31 | ```js
32 | import pixelSwiper from 'pixel-swiper';
33 | ```
34 |
35 | # Usage
36 | ```js
37 | const swiper = new pixelSwiper('#c', {
38 | width: 250,
39 | height: 100,
40 | particleSize: 4,
41 | animation: true,
42 | randomPosition: true,
43 | velocity: 5,
44 | shape: 'square',
45 | swipeList: [
46 | {
47 | paddingTop: 10,
48 | url: 'data:image/jpeg;base64,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',
49 | duration: 3000,
50 | },
51 | {
52 | text: 'pixel',
53 | paddingLeft: 5,
54 | fontSize: 80,
55 | color: '#F56C6C',
56 | duration: 3000,
57 | },
58 | {
59 | text: 'swiper',
60 | fontSize: 80,
61 | randomParticleColor: true,
62 | duration: 3000,
63 | },
64 | ]
65 | });
66 | ```
67 | # API
68 | ## Constructor
69 | new pixelSwiper(htmlSelector, options);
70 |
71 | | Names | Required | Type | Description
72 | | --- | --- | --- | ---
73 | | htmlSelector | `true` | `String` | canvas selector
74 | | options | `true` | `Object` | initial options
75 |
76 | ## Options
77 | | Names | Defaults | Description
78 | | --- | --- | ---
79 | | width | `0` | canvas width
80 | | height | `0` | canvas height
81 | | particleSize | `20` | particle size
82 | | animation | `true` | `true` - use animation
83 | | randomPosition | `false` | `true` - use random position
84 | | velocity | `1` | particle animate velocity
85 | | shape | `square` | particle shape, `square` or `round`
86 | | swipeList | `[]` | swipe config
87 |
88 |
89 | ## swipeList Options
90 | | Names | Defaults | Description
91 | | --- | --- | ---
92 | | paddingLeft | `0` | canvas paddingLeft
93 | | paddingTop | `0` | canvas paddingTop
94 | | text | `''` | render text
95 | | fontSize | `12` | text font size
96 | | color | `''` | text color
97 | | duration | `0` | swipe duration, millisecond
98 | | randomParticleColor | `false` | `true` - use random color
99 | | url | `''` | image url
--------------------------------------------------------------------------------
/build/config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * ================================
3 | * dev config
4 | * ================================
5 | */
6 | module.exports = {
7 | /**
8 | * dev config
9 | */
10 | dev: {
11 | hostname: 'localhost',
12 | port: 8080,
13 | autoOpenBrowser: true,
14 | proxyTable: {},
15 | },
16 | };
--------------------------------------------------------------------------------
/build/dev-client.js:
--------------------------------------------------------------------------------
1 | require('eventsource-polyfill');
2 | const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true');
3 |
4 | hotClient.subscribe(function (event) {
5 | if (event.action === 'reload') {
6 | window.location.reload();
7 | }
8 | });
9 |
--------------------------------------------------------------------------------
/build/dev-server.js:
--------------------------------------------------------------------------------
1 | const opn = require('opn');
2 | const path = require('path');
3 | const express = require('express');
4 | const webpack = require('webpack');
5 | const proxyMiddleware = require('http-proxy-middleware');
6 | const chalk = require('chalk');
7 | const webpackConfig = require('./webpack.dev.conf');
8 | const devConf = require('./config').dev;
9 |
10 | const app = express();
11 | const compiler = webpack(webpackConfig);
12 |
13 | const port = devConf.port;
14 | const proxyTable = devConf.proxyTable; // https://github.com/chimurai/http-proxy-middleware
15 |
16 | const devMiddleware = require('webpack-dev-middleware')(compiler, {
17 | index: "index.html",
18 | publicPath: '/',
19 | noInfo: false,
20 | quiet: true
21 | });
22 |
23 | const hotMiddleware = require('webpack-hot-middleware')(compiler, {
24 | log: function () {
25 | const args = [].slice.call(arguments);
26 | console.log.apply(null, args.map(d => chalk.white(d)));
27 | },
28 | heartbeat: 2000
29 | });
30 |
31 | // force page reload when html-webpack-plugin template changes
32 | compiler.plugin('compilation', compilation => {
33 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
34 | hotMiddleware.publish({action: 'reload'});
35 | cb();
36 | })
37 | });
38 |
39 | // proxy api requests
40 | Object.keys(proxyTable).forEach(context => {
41 | let options = proxyTable[context];
42 | if (typeof options === 'string') {
43 | options = {target: options}
44 | }
45 | app.use(proxyMiddleware(options.filter || context, options));
46 | });
47 | app.get('/', (req, res) => res.redirect('/index.html'));
48 | app.use(require('connect-history-api-fallback')());
49 | app.use(devMiddleware);
50 | app.use(hotMiddleware);
51 | app.use(express.static(path.join(__dirname, '../static')));
52 |
53 | const uri = `http://${devConf.hostname}:${port}`;
54 |
55 | let _resolve;
56 | const readyPromise = new Promise(resolve => _resolve = resolve);
57 |
58 | console.log(chalk.bgBlue.bold('> Starting dev server...\n'));
59 | devMiddleware.waitUntilValid(() => {
60 | console.log(chalk.bgGreen.bold('> Listening at ' + uri + '\n'));
61 | if (devConf.autoOpenBrowser) {
62 | opn(uri);
63 | }
64 | _resolve();
65 | });
66 |
67 | const server = app.listen(port);
68 |
69 | module.exports = {
70 | ready: readyPromise,
71 | close: () => {
72 | server.close();
73 | }
74 | };
75 |
--------------------------------------------------------------------------------
/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 |
3 | module.exports = {
4 | resolve: {
5 | extensions: ['.js'],
6 | },
7 |
8 | module: {
9 | loaders: [
10 | {test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/},
11 | ],
12 | },
13 |
14 | plugins: [],
15 | };
16 |
--------------------------------------------------------------------------------
/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const webpack = require('webpack');
3 | const Merge = require('webpack-merge');
4 | const HtmlWebpackPlugin = require('html-webpack-plugin');
5 | const BaseConfig = require('./webpack.base.conf.js');
6 | const entry = {index: './demo/index.js'};
7 |
8 | // add hot-reload related code to entry chunks
9 | Object.keys(entry)
10 | .forEach(name => entry[name] = ['./build/dev-client'].concat(entry[name]));
11 |
12 | module.exports = Merge(BaseConfig, {
13 | entry: entry,
14 |
15 | output: {
16 | path: path.resolve(__dirname, '../'),
17 | filename: '[name].js?[hash:8]',
18 | },
19 |
20 | module: {
21 | loaders: [
22 | {test: /\.css$/, loader: 'style-loader!css-loader'},
23 | ]
24 | },
25 |
26 | devtool: '#cheap-module-eval-source-map',
27 |
28 | plugins: [
29 | new webpack.HotModuleReplacementPlugin(),
30 | new HtmlWebpackPlugin({
31 | cache: true,
32 | hash: false,
33 | inject: true,
34 | chunksSortMode: 'dependency',
35 | filename: 'index.html',
36 | template: './demo/index.html',
37 | chunks: ['index']
38 | })
39 | ]
40 |
41 | });
--------------------------------------------------------------------------------
/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const webpack = require('webpack');
3 | const Merge = require('webpack-merge');
4 | const BaseConfig = require('./webpack.base.conf.js');
5 | const CssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
6 | const ExtractTextPlugin = require('extract-text-webpack-plugin');
7 | const CleanWebpackPlugin = require('clean-webpack-plugin');
8 |
9 | module.exports = Merge(BaseConfig, {
10 | entry: {
11 | 'pixelSwiper': './src/index.js',
12 | 'pixelSwiper.worker': './src/calc.worker.js'
13 | },
14 |
15 | output: {
16 | path: path.resolve(__dirname, '../dist'),
17 | filename: '[name].js',
18 | libraryTarget: 'umd',
19 | library: 'pixelSwiper'
20 | },
21 |
22 | module: {
23 | loaders: [
24 | {test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/},
25 | ]
26 | },
27 |
28 | devtool: '#source-map',
29 |
30 | plugins: [
31 | new CleanWebpackPlugin([path.join(__dirname, '../dist')],
32 | {root: path.join(__dirname, '../'), verbose: true, dry: false}),
33 | new ExtractTextPlugin('[name].css'),
34 | new webpack.LoaderOptionsPlugin({minimize: true, debug: false}),
35 | new webpack.DefinePlugin({'process.env': {NODE_ENV: '"production"'}}),
36 | new CssAssetsPlugin({
37 | cssProcessorOptions: {autoprefixer: false, discardComments: {removeAll: true}, safe: true},
38 | }),
39 | new webpack.optimize.UglifyJsPlugin({
40 | compress: {warnings: false},
41 | sourceMap: true,
42 | mangle: false
43 | }),
44 | ]
45 |
46 | });
--------------------------------------------------------------------------------
/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kilohaty/pixel-swiper/5a406441f9ce3902dd1427712b59461b54b57659/demo.gif
--------------------------------------------------------------------------------
/demo_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kilohaty/pixel-swiper/5a406441f9ce3902dd1427712b59461b54b57659/demo_1.gif
--------------------------------------------------------------------------------
/demo_2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kilohaty/pixel-swiper/5a406441f9ce3902dd1427712b59461b54b57659/demo_2.gif
--------------------------------------------------------------------------------
/demo_3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kilohaty/pixel-swiper/5a406441f9ce3902dd1427712b59461b54b57659/demo_3.gif
--------------------------------------------------------------------------------
/demo_4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kilohaty/pixel-swiper/5a406441f9ce3902dd1427712b59461b54b57659/demo_4.gif
--------------------------------------------------------------------------------
/dist/pixelSwiper.js:
--------------------------------------------------------------------------------
1 | !function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.pixelSwiper=factory():root.pixelSwiper=factory()}("undefined"!=typeof self?self:this,function(){return function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=41)}([function(module,exports){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},function(module,exports,__webpack_require__){var store=__webpack_require__(29)("wks"),uid=__webpack_require__(30),Symbol=__webpack_require__(0).Symbol,USE_SYMBOL="function"==typeof Symbol;(module.exports=function(name){return store[name]||(store[name]=USE_SYMBOL&&Symbol[name]||(USE_SYMBOL?Symbol:uid)("Symbol."+name))}).store=store},function(module,exports){var core=module.exports={version:"2.5.3"};"number"==typeof __e&&(__e=core)},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8);module.exports=function(it){if(!isObject(it))throw TypeError(it+" is not an object!");return it}},function(module,exports,__webpack_require__){var global=__webpack_require__(0),core=__webpack_require__(2),ctx=__webpack_require__(10),hide=__webpack_require__(5),$export=function(type,name,source){var key,own,out,IS_FORCED=type&$export.F,IS_GLOBAL=type&$export.G,IS_STATIC=type&$export.S,IS_PROTO=type&$export.P,IS_BIND=type&$export.B,IS_WRAP=type&$export.W,exports=IS_GLOBAL?core:core[name]||(core[name]={}),expProto=exports.prototype,target=IS_GLOBAL?global:IS_STATIC?global[name]:(global[name]||{}).prototype;IS_GLOBAL&&(source=name);for(key in source)(own=!IS_FORCED&&target&&void 0!==target[key])&&key in exports||(out=own?target[key]:source[key],exports[key]=IS_GLOBAL&&"function"!=typeof target[key]?source[key]:IS_BIND&&own?ctx(out,global):IS_WRAP&&target[key]==out?function(C){var F=function(a,b,c){if(this instanceof C){switch(arguments.length){case 0:return new C;case 1:return new C(a);case 2:return new C(a,b)}return new C(a,b,c)}return C.apply(this,arguments)};return F.prototype=C.prototype,F}(out):IS_PROTO&&"function"==typeof out?ctx(Function.call,out):out,IS_PROTO&&((exports.virtual||(exports.virtual={}))[key]=out,type&$export.R&&expProto&&!expProto[key]&&hide(expProto,key,out)))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128,module.exports=$export},function(module,exports,__webpack_require__){var dP=__webpack_require__(7),createDesc=__webpack_require__(25);module.exports=__webpack_require__(6)?function(object,key,value){return dP.f(object,key,createDesc(1,value))}:function(object,key,value){return object[key]=value,object}},function(module,exports,__webpack_require__){module.exports=!__webpack_require__(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(module,exports,__webpack_require__){var anObject=__webpack_require__(3),IE8_DOM_DEFINE=__webpack_require__(52),toPrimitive=__webpack_require__(53),dP=Object.defineProperty;exports.f=__webpack_require__(6)?Object.defineProperty:function(O,P,Attributes){if(anObject(O),P=toPrimitive(P,!0),anObject(Attributes),IE8_DOM_DEFINE)try{return dP(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");return"value"in Attributes&&(O[P]=Attributes.value),O}},function(module,exports){module.exports=function(it){return"object"==typeof it?null!==it:"function"==typeof it}},function(module,exports){module.exports={}},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(11);module.exports=function(fn,that,length){if(aFunction(fn),void 0===that)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports){module.exports=function(it){if("function"!=typeof it)throw TypeError(it+" is not a function!");return it}},function(module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key)}},function(module,exports){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},function(module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}},function(module,exports){module.exports=function(it){if(void 0==it)throw TypeError("Can't call method on "+it);return it}},function(module,exports){module.exports=function(exec){try{return!!exec()}catch(e){return!0}}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8),document=__webpack_require__(0).document,is=isObject(document)&&isObject(document.createElement);module.exports=function(it){return is?document.createElement(it):{}}},function(module,exports,__webpack_require__){var IObject=__webpack_require__(27),defined=__webpack_require__(15);module.exports=function(it){return IObject(defined(it))}},function(module,exports,__webpack_require__){var shared=__webpack_require__(29)("keys"),uid=__webpack_require__(30);module.exports=function(key){return shared[key]||(shared[key]=uid(key))}},function(module,exports,__webpack_require__){var def=__webpack_require__(7).f,has=__webpack_require__(12),TAG=__webpack_require__(1)("toStringTag");module.exports=function(it,tag,stat){it&&!has(it=stat?it:it.prototype,TAG)&&def(it,TAG,{configurable:!0,value:tag})}},function(module,exports,__webpack_require__){"use strict";function PromiseCapability(C){var resolve,reject;this.promise=new C(function($$resolve,$$reject){if(void 0!==resolve||void 0!==reject)throw TypeError("Bad Promise constructor");resolve=$$resolve,reject=$$reject}),this.resolve=aFunction(resolve),this.reject=aFunction(reject)}var aFunction=__webpack_require__(11);module.exports.f=function(C){return new PromiseCapability(C)}},function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(48),__esModule:!0}},function(module,exports,__webpack_require__){"use strict";var LIBRARY=__webpack_require__(24),$export=__webpack_require__(4),redefine=__webpack_require__(54),hide=__webpack_require__(5),has=__webpack_require__(12),Iterators=__webpack_require__(9),$iterCreate=__webpack_require__(55),setToStringTag=__webpack_require__(20),getPrototypeOf=__webpack_require__(61),ITERATOR=__webpack_require__(1)("iterator"),BUGGY=!([].keys&&"next"in[].keys()),returnThis=function(){return this};module.exports=function(Base,NAME,Constructor,next,DEFAULT,IS_SET,FORCED){$iterCreate(Constructor,NAME,next);var methods,key,IteratorPrototype,getMethod=function(kind){if(!BUGGY&&kind in proto)return proto[kind];switch(kind){case"keys":case"values":return function(){return new Constructor(this,kind)}}return function(){return new Constructor(this,kind)}},TAG=NAME+" Iterator",DEF_VALUES="values"==DEFAULT,VALUES_BUG=!1,proto=Base.prototype,$native=proto[ITERATOR]||proto["@@iterator"]||DEFAULT&&proto[DEFAULT],$default=!BUGGY&&$native||getMethod(DEFAULT),$entries=DEFAULT?DEF_VALUES?getMethod("entries"):$default:void 0,$anyNative="Array"==NAME?proto.entries||$native:$native;if($anyNative&&(IteratorPrototype=getPrototypeOf($anyNative.call(new Base)))!==Object.prototype&&IteratorPrototype.next&&(setToStringTag(IteratorPrototype,TAG,!0),LIBRARY||has(IteratorPrototype,ITERATOR)||hide(IteratorPrototype,ITERATOR,returnThis)),DEF_VALUES&&$native&&"values"!==$native.name&&(VALUES_BUG=!0,$default=function(){return $native.call(this)}),LIBRARY&&!FORCED||!BUGGY&&!VALUES_BUG&&proto[ITERATOR]||hide(proto,ITERATOR,$default),Iterators[NAME]=$default,Iterators[TAG]=returnThis,DEFAULT)if(methods={values:DEF_VALUES?$default:getMethod("values"),keys:IS_SET?$default:getMethod("keys"),entries:$entries},FORCED)for(key in methods)key in proto||redefine(proto,key,methods[key]);else $export($export.P+$export.F*(BUGGY||VALUES_BUG),NAME,methods);return methods}},function(module,exports){module.exports=!0},function(module,exports){module.exports=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}}},function(module,exports,__webpack_require__){var $keys=__webpack_require__(58),enumBugKeys=__webpack_require__(31);module.exports=Object.keys||function(O){return $keys(O,enumBugKeys)}},function(module,exports,__webpack_require__){var cof=__webpack_require__(13);module.exports=Object("z").propertyIsEnumerable(0)?Object:function(it){return"String"==cof(it)?it.split(""):Object(it)}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(14),min=Math.min;module.exports=function(it){return it>0?min(toInteger(it),9007199254740991):0}},function(module,exports,__webpack_require__){var global=__webpack_require__(0),store=global["__core-js_shared__"]||(global["__core-js_shared__"]={});module.exports=function(key){return store[key]||(store[key]={})}},function(module,exports){var id=0,px=Math.random();module.exports=function(key){return"Symbol(".concat(void 0===key?"":key,")_",(++id+px).toString(36))}},function(module,exports){module.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(module,exports,__webpack_require__){var document=__webpack_require__(0).document;module.exports=document&&document.documentElement},function(module,exports,__webpack_require__){var defined=__webpack_require__(15);module.exports=function(it){return Object(defined(it))}},function(module,exports,__webpack_require__){var cof=__webpack_require__(13),TAG=__webpack_require__(1)("toStringTag"),ARG="Arguments"==cof(function(){return arguments}()),tryGet=function(it,key){try{return it[key]}catch(e){}};module.exports=function(it){var O,T,B;return void 0===it?"Undefined":null===it?"Null":"string"==typeof(T=tryGet(O=Object(it),TAG))?T:ARG?cof(O):"Object"==(B=cof(O))&&"function"==typeof O.callee?"Arguments":B}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(3),aFunction=__webpack_require__(11),SPECIES=__webpack_require__(1)("species");module.exports=function(O,D){var S,C=anObject(O).constructor;return void 0===C||void 0==(S=anObject(C)[SPECIES])?D:aFunction(S)}},function(module,exports,__webpack_require__){var defer,channel,port,ctx=__webpack_require__(10),invoke=__webpack_require__(72),html=__webpack_require__(32),cel=__webpack_require__(17),global=__webpack_require__(0),process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,MessageChannel=global.MessageChannel,Dispatch=global.Dispatch,counter=0,queue={},run=function(){var id=+this;if(queue.hasOwnProperty(id)){var fn=queue[id];delete queue[id],fn()}},listener=function(event){run.call(event.data)};setTask&&clearTask||(setTask=function(fn){for(var args=[],i=1;arguments.length>i;)args.push(arguments[i++]);return queue[++counter]=function(){invoke("function"==typeof fn?fn:Function(fn),args)},defer(counter),counter},clearTask=function(id){delete queue[id]},"process"==__webpack_require__(13)(process)?defer=function(id){process.nextTick(ctx(run,id,1))}:Dispatch&&Dispatch.now?defer=function(id){Dispatch.now(ctx(run,id,1))}:MessageChannel?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listener,defer=ctx(port.postMessage,port,1)):global.addEventListener&&"function"==typeof postMessage&&!global.importScripts?(defer=function(id){global.postMessage(id+"","*")},global.addEventListener("message",listener,!1)):defer="onreadystatechange"in cel("script")?function(id){html.appendChild(cel("script")).onreadystatechange=function(){html.removeChild(this),run.call(id)}}:function(id){setTimeout(ctx(run,id,1),0)}),module.exports={set:setTask,clear:clearTask}},function(module,exports){module.exports=function(exec){try{return{e:!1,v:exec()}}catch(e){return{e:!0,v:e}}}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(3),isObject=__webpack_require__(8),newPromiseCapability=__webpack_require__(21);module.exports=function(C,x){if(anObject(C),isObject(x)&&x.constructor===C)return x;var promiseCapability=newPromiseCapability.f(C);return(0,promiseCapability.resolve)(x),promiseCapability.promise}},function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(79),__esModule:!0}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0,exports.default=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function loadImage(src){return new _promise2.default(function(resolve,reject){var image=new Image;image.crossOrigin="",image.onload=resolve.bind(null,image),image.onerror=reject,image.src=src})}function randomInt(min,max){return~~(Math.random()*(max-min)+min)}function getRandomColor(){return"#"+Array.apply(null,new Array(3)).map(function(){return randomInt(0,255).toString(16).replace(/^(\w{1})$/,"0$1")}).join("")}var _stringify=__webpack_require__(42),_stringify2=_interopRequireDefault(_stringify),_regenerator=__webpack_require__(44),_regenerator2=_interopRequireDefault(_regenerator),_asyncToGenerator2=__webpack_require__(47),_asyncToGenerator3=_interopRequireDefault(_asyncToGenerator2),_assign=__webpack_require__(39),_assign2=_interopRequireDefault(_assign),_classCallCheck2=__webpack_require__(40),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_promise=__webpack_require__(22),_promise2=_interopRequireDefault(_promise),_particle=__webpack_require__(84),_particle2=_interopRequireDefault(_particle),_calc=__webpack_require__(89),_calc2=_interopRequireDefault(_calc);window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var PixelSwiper=function PixelSwiper(selector,options){(0,_classCallCheck3.default)(this,PixelSwiper),this.set(options),this.initialize(selector)};(0,_assign2.default)(PixelSwiper.prototype,{paused:!1,loop:!0,swipeCount:0,loopCount:0,width:0,height:0,paddingLeft:0,paddingTop:0,rowNum:0,colNum:0,swipeList:[],collections:[],lastIndex:-1,index:0,animation:!0,randomPosition:!1,shape:"square",velocity:1,particleSize:20,onIndexChange:null,workerPath:"",useWebWorker:!1,set:function(options){for(var key in options)options.hasOwnProperty(key)&&(this[key]=options[key])},initialize:function(selector){var canvas=document.querySelector(selector),cacheCanvas=document.createElement("canvas");this.canvas=canvas,this.cacheCanvas=cacheCanvas,this.ctx=canvas.getContext("2d"),this.cacheCtx=cacheCanvas.getContext("2d"),this.canvas.width=this.width,this.canvas.height=this.height,this.cacheCanvas.width=this.width,this.cacheCanvas.height=this.height,this.rowNum=Math.ceil(this.height/this.particleSize),this.colNum=Math.ceil(this.width/this.particleSize),this.run()},renderTextToCacheCanvas:function(_ref){var text=_ref.text,color=_ref.color,fontSize=_ref.fontSize,randomColor=_ref.randomColor,_ref$paddingTop=_ref.paddingTop,paddingTop=void 0===_ref$paddingTop?0:_ref$paddingTop,_ref$paddingLeft=_ref.paddingLeft,paddingLeft=void 0===_ref$paddingLeft?0:_ref$paddingLeft,ctx=this.cacheCtx;ctx.clearRect(0,0,this.width,this.height),ctx.save(),ctx.textBaseline="top",ctx.font=(fontSize||12)+"px 'microsoft yahei light'",ctx.fillStyle=randomColor?getRandomColor():color||"#000000",ctx.fillText(text,paddingLeft,paddingTop),ctx.restore()},renderImageToCacheCanvas:function(_ref2){var _this=this,url=_ref2.url,_ref2$paddingTop=_ref2.paddingTop,paddingTop=void 0===_ref2$paddingTop?0:_ref2$paddingTop,_ref2$paddingLeft=_ref2.paddingLeft,paddingLeft=void 0===_ref2$paddingLeft?0:_ref2$paddingLeft;return new _promise2.default(function(){var _ref3=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(resolve,reject){var image,w,h,scale,imgW,imgH,left,top,dstX,dstY,ctx;return _regenerator2.default.wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.prev=0,_context.next=3,loadImage(url);case 3:image=_context.sent,w=_this.width-(paddingLeft<<1),h=_this.height-(paddingTop<<1),scale=1,(image.width>w||image.height>h)&&(scale=image.width/image.height>w/h?w/image.width:h/image.height),image.widthw/h?w/image.width:h/image.height),imgW=image.width*scale,imgH=image.height*scale,left=_this.width-imgW>>1,top=_this.height-imgH>>1,dstX=left>paddingLeft?left/scale:paddingLeft/scale,dstY=top>paddingTop?top/scale:paddingTop/scale,ctx=_this.cacheCtx,ctx.clearRect(0,0,_this.width,_this.height),ctx.save(),ctx.scale(scale,scale),ctx.drawImage(image,dstX,dstY),ctx.restore(),resolve(),_context.next=28;break;case 24:_context.prev=24,_context.t0=_context.catch(0),console.error(_context.t0),reject(_context.t0);case 28:case"end":return _context.stop()}},_callee,_this,[[0,24]])}));return function(_x,_x2){return _ref3.apply(this,arguments)}}())},getPixelData:function(){var _this2=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _promise2.default(function(){var _ref4=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(resolve,reject){var imgData,postData,worker;return _regenerator2.default.wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:if(_context2.prev=0,!options.text){_context2.next=5;break}_this2.renderTextToCacheCanvas(options),_context2.next=7;break;case 5:return _context2.next=7,_this2.renderImageToCacheCanvas(options);case 7:imgData=_this2.cacheCtx.getImageData(0,0,_this2.width,_this2.height).data,postData={imageData:imgData,width:_this2.width,height:_this2.height,size:_this2.particleSize},_this2.useWebWorker?(worker=new Worker(_this2.workerPath),worker.onmessage=function(e){return resolve(e.data)},worker.postMessage(postData)):resolve((0,_calc2.default)(postData)),_context2.next=16;break;case 12:_context2.prev=12,_context2.t0=_context2.catch(0),console.error(_context2.t0),reject(_context2.t0);case 16:case"end":return _context2.stop()}},_callee2,_this2,[[0,12]])}));return function(_x4,_x5){return _ref4.apply(this,arguments)}}())},getCollectionData:function(){var _this3=this;return new _promise2.default(function(){var _ref5=(0,_asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(resolve,reject){var size,i,swipe,pixelData,res,m,n,data;return _regenerator2.default.wrap(function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:_context3.prev=0,size=_this3.particleSize,i=0;case 3:if(!(i<_this3.swipeList.length)){_context3.next=14;break}return swipe=_this3.swipeList[i],_context3.next=7,_this3.getPixelData(swipe);case 7:for(pixelData=_context3.sent,res=[],m=0;m<_this3.rowNum;m++)for(n=0;n<_this3.colNum;n++)data=pixelData[m]&&pixelData[m][n],swipe.randomParticleColor&&data.a&&(data={r:randomInt(0,255),g:randomInt(0,255),b:randomInt(0,255),a:255}),data&&res.push({ox:size*n+(size>>1),oy:size*m+(size>>1),size:size,bg:{r:data.r,g:data.g,b:data.b,a:data.a},row:m,col:n});_this3.swipeList[i].pixelData=res;case 11:i++,_context3.next=3;break;case 14:resolve(),_context3.next=21;break;case 17:_context3.prev=17,_context3.t0=_context3.catch(0),console.error(_context3.t0),reject(_context3.t0);case 21:case"end":return _context3.stop()}},_callee3,_this3,[[0,17]])}));return function(_x6,_x7){return _ref5.apply(this,arguments)}}())},nextIndex:function(){if(this.lastIndex=this.index,++this.index>=this.swipeList.length){if(!this.loop)return void(this.paused=!0);this.index=0,this.loopCount++}this.swipeCount++,this.onIndexChange&&this.onIndexChange({index:this.index})},next:function(){this.paused||(this.nextIndex(),this.updateCollections())},loopSwiper:function(){var _this4=this;if(!this.paused){var duration=this.swipeList[this.index].duration;duration&&setTimeout(function(){_this4.next(),_this4.loopSwiper()},duration)}},getSwipeConfig:function(){var animation=this.animation,randomPosition=this.randomPosition,subConfig=this.swipeList[this.index];return 0===this.swipeCount&&("boolean"==typeof subConfig.initialAnimation&&(animation=subConfig.initialAnimation),"boolean"==typeof subConfig.initialRandomPosition&&(randomPosition=subConfig.initialRandomPosition)),(0,_assign2.default)({},{width:this.width,height:this.height,particleSize:this.particleSize,velocity:this.velocity,shape:this.shape,animation:animation,randomPosition:randomPosition},subConfig)},updateCollections:function(){var _this5=this;if(!this.paused){var pixelData=this.swipeList[this.index].pixelData;if(this.getSwipeConfig().randomPosition){var getDataByPos=function(row,col){for(var res=null,i=0;i>1),oy:size*i+(size>>1),size:size,shape:_this6.shape,bg:{r:0,g:0,b:0,a:0},row:i,col:j,velocity:_this6.velocity}));_this6.updateCollections(),_this6.render(),_this6.loopSwiper(),_this6.loopAnim(),_context4.next=14;break;case 11:_context4.prev=11,_context4.t0=_context4.catch(0),console.error(_context4.t0);case 14:case"end":return _context4.stop()}},_callee4,_this6,[[0,11]])}))()},needUpdate:function(){return this.collections.some(function(p){return p.shouldUpdate()})},loopAnim:function(){if(!this.needUpdate())return void requestAnimationFrame(this.loopAnim.bind(this));this.render(),requestAnimationFrame(this.loopAnim.bind(this))},render:function(){var _this7=this,config=this.getSwipeConfig();this.cacheCtx.clearRect(0,0,this.width,this.height),this.collections.forEach(function(p){config.animation||p.set({bg:{r:p.tBg.r,g:p.tBg.g,b:p.tBg.b,a:p.tBg.a}}),_this7.cacheCtx.save(),p.update(),p.render({ctx:_this7.cacheCtx}),_this7.cacheCtx.restore()}),this.ctx.clearRect(0,0,this.width,this.height),this.ctx.drawImage(this.cacheCanvas,0,0)}}),module.exports=PixelSwiper},function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(43),__esModule:!0}},function(module,exports,__webpack_require__){var core=__webpack_require__(2),$JSON=core.JSON||(core.JSON={stringify:JSON.stringify});module.exports=function(it){return $JSON.stringify.apply($JSON,arguments)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(45)},function(module,exports,__webpack_require__){var g=function(){return this}()||Function("return this")(),hadRuntime=g.regeneratorRuntime&&Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime")>=0,oldRuntime=hadRuntime&&g.regeneratorRuntime;if(g.regeneratorRuntime=void 0,module.exports=__webpack_require__(46),hadRuntime)g.regeneratorRuntime=oldRuntime;else try{delete g.regeneratorRuntime}catch(e){g.regeneratorRuntime=void 0}},function(module,exports){!function(global){"use strict";function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=makeInvokeMethod(innerFn,self,context),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg)}})}function AsyncIterator(generator){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==typeof value&&hasOwn.call(value,"__await")?Promise.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):Promise.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},reject)}reject(record.arg)}function enqueue(method,arg){function callInvokeWithMethodAndArg(){return new Promise(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}var previousPromise;this._invoke=enqueue}function makeInvokeMethod(innerFn,self,context){var state=GenStateSuspendedStart;return function(method,arg){if(state===GenStateExecuting)throw new Error("Generator is already running");if(state===GenStateCompleted){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if(state===GenStateSuspendedStart)throw state=GenStateCompleted,context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state=GenStateExecuting;var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?GenStateCompleted:GenStateSuspendedYield,record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state=GenStateCompleted,context.method="throw",context.arg=record.arg)}}}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(method===undefined){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=undefined,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=undefined),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel}},catch:function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=undefined),ContinueSentinel}}}(function(){return this}()||Function("return this")())},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _promise=__webpack_require__(22),_promise2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_promise);exports.default=function(fn){return function(){var gen=fn.apply(this,arguments);return new _promise2.default(function(resolve,reject){function step(key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}if(!info.done)return _promise2.default.resolve(value).then(function(value){step("next",value)},function(err){step("throw",err)});resolve(value)}return step("next")})}}},function(module,exports,__webpack_require__){__webpack_require__(49),__webpack_require__(50),__webpack_require__(62),__webpack_require__(66),__webpack_require__(77),__webpack_require__(78),module.exports=__webpack_require__(2).Promise},function(module,exports){},function(module,exports,__webpack_require__){"use strict";var $at=__webpack_require__(51)(!0);__webpack_require__(23)(String,"String",function(iterated){this._t=String(iterated),this._i=0},function(){var point,O=this._t,index=this._i;return index>=O.length?{value:void 0,done:!0}:(point=$at(O,index),this._i+=point.length,{value:point,done:!1})})},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(14),defined=__webpack_require__(15);module.exports=function(TO_STRING){return function(that,pos){var a,b,s=String(defined(that)),i=toInteger(pos),l=s.length;return i<0||i>=l?TO_STRING?"":void 0:(a=s.charCodeAt(i),a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?TO_STRING?s.charAt(i):a:TO_STRING?s.slice(i,i+2):b-56320+(a-55296<<10)+65536)}}},function(module,exports,__webpack_require__){module.exports=!__webpack_require__(6)&&!__webpack_require__(16)(function(){return 7!=Object.defineProperty(__webpack_require__(17)("div"),"a",{get:function(){return 7}}).a})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(8);module.exports=function(it,S){if(!isObject(it))return it;var fn,val;if(S&&"function"==typeof(fn=it.toString)&&!isObject(val=fn.call(it)))return val;if("function"==typeof(fn=it.valueOf)&&!isObject(val=fn.call(it)))return val;if(!S&&"function"==typeof(fn=it.toString)&&!isObject(val=fn.call(it)))return val;throw TypeError("Can't convert object to primitive value")}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(5)},function(module,exports,__webpack_require__){"use strict";var create=__webpack_require__(56),descriptor=__webpack_require__(25),setToStringTag=__webpack_require__(20),IteratorPrototype={};__webpack_require__(5)(IteratorPrototype,__webpack_require__(1)("iterator"),function(){return this}),module.exports=function(Constructor,NAME,next){Constructor.prototype=create(IteratorPrototype,{next:descriptor(1,next)}),setToStringTag(Constructor,NAME+" Iterator")}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(3),dPs=__webpack_require__(57),enumBugKeys=__webpack_require__(31),IE_PROTO=__webpack_require__(19)("IE_PROTO"),Empty=function(){},createDict=function(){var iframeDocument,iframe=__webpack_require__(17)("iframe"),i=enumBugKeys.length;for(iframe.style.display="none",__webpack_require__(32).appendChild(iframe),iframe.src="javascript:",iframeDocument=iframe.contentWindow.document,iframeDocument.open(),iframeDocument.write("