diff --git a/.babelrc b/.babelrc index fe69307..8d60791 100755 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,4 @@ { "presets": ["@babel/env"], - "plugins": ["babel-plugin-add-module-exports"] + "plugins": ["babel-plugin-add-module-exports", "@babel/plugin-proposal-class-properties"] } \ No newline at end of file diff --git a/lib/lazy-line-painter-1.9.2.js b/lib/lazy-line-painter-1.9.2.js index 773016c..f925541 100644 --- a/lib/lazy-line-painter-1.9.2.js +++ b/lib/lazy-line-painter-1.9.2.js @@ -316,6 +316,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + var LazyLinePainter = /*#__PURE__*/ function () { @@ -326,8 +328,18 @@ function () { * @param {object} opts user defined options */ function LazyLinePainter(el, config) { + var _this = this; + _classCallCheck(this, LazyLinePainter); + _defineProperty(this, "_onVisibilityChange", function () { + if (document.hidden) { + _this.pause(); + } else { + _this.resume(); + } + }); + this.el = el; this.el.classList.add('lazy-line-painter'); this.config = Object.assign({ @@ -360,6 +372,8 @@ function () { this._updateDuration(); this._setupPaths(); + + document.addEventListener('visibilitychange', this._onVisibilityChange); } _createClass(LazyLinePainter, [{ @@ -452,11 +466,11 @@ function () { }, { key: "resume", value: function resume() { - var _this = this; + var _this2 = this; if (this.config.paused) { requestAnimationFrame(function () { - _this.adjustStartTime(); + _this2.adjustStartTime(); }); this.config.paused = false; this.emit('resume'); @@ -712,12 +726,12 @@ function () { * @param {object} data contains options set on init() and paint() */ value: function adjustStartTime() { - var _this2 = this; + var _this3 = this; var timestamp = performance.now(); this.config.startTime = timestamp - this.config.elapsedTime; requestAnimationFrame(function () { - _this2._paint(); + _this3._paint(); }); } /** @@ -732,7 +746,7 @@ function () { }, { key: "_paint", value: function _paint() { - var _this3 = this; + var _this4 = this; if (!this.config) { return; @@ -754,7 +768,7 @@ function () { if (this.config.linearProgress >= 0 && this.config.linearProgress <= 1) { this.__raf = requestAnimationFrame(function () { - _this3._paint(); + _this4._paint(); }); } else { this.emit('complete'); diff --git a/lib/lazy-line-painter-1.9.2.js.map b/lib/lazy-line-painter-1.9.2.js.map index b4d7b74..4042fd6 100644 --- a/lib/lazy-line-painter-1.9.2.js.map +++ b/lib/lazy-line-painter-1.9.2.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://lazy-line-painter/webpack/universalModuleDefinition","webpack://lazy-line-painter/webpack/bootstrap","webpack://lazy-line-painter/./src/easing.js","webpack://lazy-line-painter/./src/events.js","webpack://lazy-line-painter/./src/index.js"],"names":["Easing","easeLinear","n","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","Math","cos","PI","easeOutSine","sin","easeInOutSine","easeInExpo","pow","easeOutExpo","easeInOutExpo","easeInCirc","sqrt","easeOutCirc","easeInOutCirc","easeInBounce","easeOutBounce","easeInOutBounce","EventEmitter","on","name","callback","_eventEmitterCallbacks","push","addListener","off","i","indexOf","splice","removeListener","emit","evt","trigger","LazyLinePainter","el","config","classList","add","Object","assign","strokeWidth","strokeDash","strokeColor","strokeOverColor","strokeCap","strokeJoin","strokeOpacity","delay","ease","drawSequential","speedMultiplier","reverse","paused","progress","longestDuration","log","offset","getBoundingClientRect","Events","__raf","__paths","_generatePaths","_parseDataAttrs","_updateDuration","_setupPaths","paths","composed","Boolean","dataset","llpComposed","querySelectorAll","_uncomposed","length","path","id","replace","llpId","llpDuration","llpDelay","console","erase","_paint","cancelAnimationFrame","requestAnimationFrame","adjustStartTime","startTime","elapsedTime","onStrokeCompleteDone","style","strokeDashoffset","onStrokeStartDone","remove","prop","value","_setProgress","_setDelay","_setReverse","_setEase","pause","_getProgress","_updatePaths","totalDuration","_getTotalDuration","_getLongestDuration","_calcPathDurations","duration","startProgress","durationProgress","positions","_getPathPoints","_updatePosition","Number","llpReverse","llpEase","llpStrokeDash","_setStyleAttrs","llpStrokeColor","stroke","llpStrokeOpacity","llpStrokeWidth","llpStrokeCap","strokeLinecap","llpStrokeJoin","strokeLinejoin","index","_getPathLength","strokeDasharray","_getStrokeDashArray","timestamp","performance","now","linearProgress","pathProgress","_getElapsedProgress","_setLine","_updateStrokeCallbacks","elapsedProgress","round","position","x","left","y","top","pathDelay","pathTotalDuration","ceil","_getTotalLength","p1","p2","getAttribute","rx","parseInt","ry","h","totalLength","_getDistance","points","previousPos","numberOfItems","currentPos","getItem","_getPolylineLength","getTotalLength","tagName","toLowerCase","_getCircleLength","_getEllipseLength","_getRectLength","_getLineLength","_getPolygonLength","arr","getPointAtLength","_getStrokeDashString","dashArray","strokeDashString","strokeDashArray","split","strokeDashTotal","strokeDashNum","strokeDashRemainder","floor","preArray","join","window"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;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C,IAAzC,IAAiD3G,SAAS,CAA1D,CAAf;AAEA,aAAO6G,SAASL,KAAT,CAAe,GAAf,EAAoBM,IAApB,CAAyB,KAAzB,IAAkC,IAAzC;AACD;;;;;;AAGHC,OAAOtJ,eAAP,GAAyBA,eAAzB;eACeA,e","file":"lazy-line-painter-1.9.2.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"lazy-line-painter\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"lazy-line-painter\"] = factory();\n\telse\n\t\troot[\"lazy-line-painter\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","\nlet Easing = {\n\n easeLinear(n) {\n return n;\n },\n\n easeInQuad(n) {\n return n * n;\n },\n\n easeOutQuad(n) {\n return n * (2 - n);\n },\n\n easeInOutQuad(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n;\n return -0.5 * (--n * (n - 2) - 1);\n },\n\n easeInCubic(n) {\n return n * n * n;\n },\n\n easeOutCubic(n) {\n return --n * n * n + 1;\n },\n\n easeInOutCubic(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n;\n return 0.5 * ((n -= 2) * n * n + 2);\n },\n\n easeInQuart(n) {\n return n * n * n * n;\n },\n\n easeOutQuart(n) {\n return 1 - --n * n * n * n;\n },\n\n easeInOutQuart(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n;\n return -0.5 * ((n -= 2) * n * n * n - 2);\n },\n\n easeInQuint(n) {\n return n * n * n * n * n;\n },\n\n easeOutQuint(n) {\n return --n * n * n * n * n + 1;\n },\n\n easeInOutQuint(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n * n;\n return 0.5 * ((n -= 2) * n * n * n * n + 2);\n },\n\n easeInSine(n) {\n return 1 - Math.cos(n * Math.PI / 2);\n },\n\n easeOutSine(n) {\n return Math.sin(n * Math.PI / 2);\n },\n\n easeInOutSine(n) {\n return 0.5 * (1 - Math.cos(Math.PI * n));\n },\n\n easeInExpo(n) {\n return n === 0 ? 0 : Math.pow(1024, n - 1);\n },\n\n easeOutExpo(n) {\n return n === 1 ? n : 1 - Math.pow(2, -10 * n);\n },\n\n easeInOutExpo(n) {\n if (n === 0) return 0;\n if (n === 1) return 1;\n if ((n *= 2) < 1) return 0.5 * Math.pow(1024, n - 1);\n return 0.5 * (-Math.pow(2, -10 * (n - 1)) + 2);\n },\n\n easeInCirc(n) {\n return 1 - Math.sqrt(1 - n * n);\n },\n\n easeOutCirc(n) {\n return Math.sqrt(1 - --n * n);\n },\n\n easeInOutCirc(n) {\n n *= 2;\n if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1);\n return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);\n },\n\n easeInBounce(n) {\n return 1 - this.easeOutBounce(1 - n);\n },\n\n easeOutBounce(n) {\n if (n < 1 / 2.75) {\n return 7.5625 * n * n;\n } else if (n < 2 / 2.75) {\n return 7.5625 * (n -= 1.5 / 2.75) * n + 0.75;\n } else if (n < 2.5 / 2.75) {\n return 7.5625 * (n -= 2.25 / 2.75) * n + 0.9375;\n }\n return 7.5625 * (n -= 2.625 / 2.75) * n + 0.984375;\n\n },\n\n easeInOutBounce(n) {\n if (n < 0.5) return this.easeInBounce(n * 2) * 0.5;\n return this.easeOutBounce(n * 2 - 1) * 0.5 + 0.5;\n }\n};\n\nexport default Easing;\n\n","let EventEmitter = {};\n\nEventEmitter.on = function (name, callback) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n this._eventEmitterCallbacks[name] = this._eventEmitterCallbacks[name] || [];\n this._eventEmitterCallbacks[name].push(callback);\n};\nEventEmitter.addListener = EventEmitter.on;\n\nEventEmitter.off = function (name, callback) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n if (!(name in this._eventEmitterCallbacks)) return;\n const i = this._eventEmitterCallbacks[name].indexOf(callback);\n\n if (i < 0) return;\n this._eventEmitterCallbacks[name].splice(i, 1);\n};\nEventEmitter.removeListener = EventEmitter.off;\n\nEventEmitter.emit = function (name, evt) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n if (!(name in this._eventEmitterCallbacks)) return;\n for (let callback of this._eventEmitterCallbacks[name]) {\n if (typeof callback !== 'function') return;\n callback(evt);\n }\n};\nEventEmitter.trigger = EventEmitter.emit;\n\nexport default EventEmitter;\n","/*\n * Lazy Line Painter\n * SVG Stroke animation.\n *\n * https://github.com/camoconnell/lazy-line-painter\n * http://www.camoconnell.com\n *\n * Copyright 2013-2018 Cam O'Connell\n * All rights reserved.\n *\n * Licensed under the MIT license.\n *\n */\n\nimport Events from './events';\nimport Easing from './easing';\n\nclass LazyLinePainter {\n\n /**\n * init\n * Responsible for caching user options,\n * @public\n * @param {object} opts user defined options\n */\n\n constructor(el, config) {\n\n this.el = el;\n this.el.classList.add('lazy-line-painter');\n\n this.config = Object.assign({\n\n strokeWidth: null,\n strokeDash: null,\n strokeColor: null,\n strokeOverColor: null,\n strokeCap: null,\n strokeJoin: null,\n strokeOpacity: null,\n\n delay: 0,\n ease: null,\n drawSequential: false,\n speedMultiplier: 1,\n reverse: false,\n paused: false,\n progress: 0,\n\n longestDuration: 0,\n log: true,\n offset: this.el.getBoundingClientRect()\n\n }, config, {});\n\n Object.assign(this, Events, {});\n\n this.__raf = null;\n this.__paths = [];\n\n this._generatePaths();\n this._parseDataAttrs();\n this._updateDuration();\n this._setupPaths();\n\n }\n\n _generatePaths() {\n\n let paths;\n let composed = Boolean(this.el.dataset.llpComposed);\n\n if (composed) {\n paths = this.el.querySelectorAll('[data-llp-id]');\n } else {\n paths = this._uncomposed();\n }\n\n for (let i = 0; i < paths.length; i++) {\n\n let path = {\n el: paths[i]\n };\n\n this.__paths.push(path);\n }\n }\n\n _uncomposed() {\n let paths = this.el.querySelectorAll('path, polygon, circle, ellipse, polyline, line, rect');\n let i;\n\n for (i = 0; i < paths.length; i++) {\n let id = this.el.id.replace(/ /g, '');\n\n id = id.replace('.', '');\n id = id.replace('-', '');\n paths[i].dataset.llpId = id + '-' + i;\n\n if (!paths[i].dataset.llpDuration) {\n paths[i].dataset.llpDuration = 5000;\n }\n if (!paths[i].dataset.llpDuration) {\n paths[i].dataset.llpDelay = 0;\n }\n }\n\n if (this.config.log) {\n console.log('This lazy line is uncomposed! Visit http://lazylinepainter.info to compose your masterpiece!');\n }\n\n return paths;\n }\n\n /**\n * paint\n * Responsible for drawing path.\n * @public\n */\n\n paint(config) {\n\n // update playback arguments\n Object.assign(this.config, config);\n this._updateDuration();\n\n this.erase();\n\n // begin animation\n this._paint();\n\n // fire start callback\n this.emit('start');\n }\n\n /**\n * pause\n * Responsible for pausing path animation.\n * @public\n */\n pause() {\n this.config.paused = true;\n cancelAnimationFrame(this.__raf);\n this.emit('pause');\n }\n\n /**\n * resume\n * Responsible for resuming path animation.\n * @public\n */\n resume() {\n if (this.config.paused) {\n requestAnimationFrame(() => {\n this.adjustStartTime();\n });\n this.config.paused = false;\n this.emit('resume');\n }\n }\n\n /**\n * erase\n * Responsible for clearing path,\n * paint can still be called on the element after it has been erased.\n * @public\n */\n erase() {\n\n // reset / cancel rAF\n this.config.startTime = null;\n this.config.elapsedTime = null;\n cancelAnimationFrame(this.__raf);\n\n // reset callback\n this.config.onStrokeCompleteDone = false;\n\n // reset paused\n this.config.paused = false;\n\n // empty contents of svg\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.style.strokeDashoffset = path.length;\n path.onStrokeCompleteDone = false;\n path.onStrokeStartDone = false;\n }\n\n this.emit('erase');\n }\n\n /**\n * destroy\n * Responsible for removing lazyline data and element from DOM\n * @public\n */\n destroy() {\n\n // retrieve / remove data object\n this.config = null;\n\n // empty container element\n this.el.remove();\n this.el = null;\n\n }\n\n /**\n * set\n * @public\n */\n set(prop, value) {\n switch (prop) {\n case 'progress':\n this._setProgress(value);\n break;\n case 'delay':\n this._setDelay(value);\n break;\n case 'reverse':\n this._setReverse(value);\n break;\n case 'ease':\n this._setEase(value);\n break;\n default:\n if (this.config.log) {\n console.log('property ' + prop + ' can not be set');\n }\n }\n }\n\n _setEase(ease) {\n this.config.ease = ease;\n }\n\n _setProgress(progress) {\n this.pause();\n this.config.progress = this._getProgress(progress, this.config.ease);\n this._updatePaths();\n this.config.elapsedTime = this.config.progress * this.config.totalDuration;\n }\n\n _setDelay(delay) {\n this.config.delay = delay;\n this._updateDuration();\n }\n\n _setReverse(reverse) {\n this.config.reverse = reverse;\n this._updateDuration();\n }\n\n _updateDuration() {\n\n let totalDuration = this._getTotalDuration();\n let longestDuration = this._getLongestDuration();\n\n this.config.totalDuration = this.config.drawSequential ? totalDuration : longestDuration;\n this.config.totalDuration += this.config.delay;\n\n this._calcPathDurations();\n }\n\n _calcPathDurations() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n let startTime;\n\n path.progress = 0;\n\n if (this.config.reverse) {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.totalDuration - (path.delay + path.duration);\n }\n } else {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.delay + path.delay;\n }\n }\n\n path.startTime = startTime;\n path.startProgress = (path.startTime / this.config.totalDuration);\n path.durationProgress = (path.duration / this.config.totalDuration);\n }\n }\n\n /**\n * get\n * @public\n */\n get() {\n return this.config;\n }\n\n /**\n * resize\n * @public\n */\n resize() {\n\n this.config.offset = this.el.getBoundingClientRect();\n // this.config.scale = this.config.offset.width / this.config.width;\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.getBoundingClientRect();\n path.positions = this._getPathPoints(path.el, path.length);\n this._updatePosition(path);\n }\n }\n\n _parseDataAttrs() {\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.id = path.el.dataset.llpId;\n path.delay = Number(path.el.dataset.llpDelay) || 0;\n path.duration = Number(path.el.dataset.llpDuration) || 0;\n path.reverse = Boolean(path.el.dataset.llpReverse) || false;\n path.ease = Number(path.el.dataset.llpEase) || null;\n path.strokeDash = path.el.dataset.llpStrokeDash || null;\n path.delay *= this.config.speedMultiplier;\n path.duration *= this.config.speedMultiplier;\n\n this._setStyleAttrs(path);\n }\n }\n\n _setStyleAttrs(path) {\n\n path.strokeColor = (path.el.dataset.llpStrokeColor || this.config.strokeColor);\n if (path.strokeColor) {\n path.el.style.stroke = path.strokeColor;\n }\n\n path.strokeOpacity = (path.el.dataset.llpStrokeOpacity || this.config.strokeOpacity);\n if (path.strokeOpacity) {\n path.el.style.strokeOpacity = path.strokeOpacity;\n }\n\n path.strokeWidth = (path.el.dataset.llpStrokeWidth || this.config.strokeWidth);\n if (path.strokeWidth) {\n path.el.style.strokeWidth = path.strokeWidth;\n }\n\n path.strokeCap = (path.el.dataset.llpStrokeCap || this.config.strokeCap);\n if (path.strokeCap) {\n path.el.style.strokeLinecap = path.strokeCap;\n }\n\n path.strokeJoin = (path.el.dataset.llpStrokeJoin || this.config.strokeJoin);\n if (path.strokeJoin) {\n path.el.style.strokeLinejoin = path.strokeJoin;\n }\n }\n\n _setupPaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n\n path.index = i;\n path.length = this._getPathLength(path.el);\n path.positions = this._getPathPoints(path.el, path.length);\n\n path.el.style.strokeDasharray = this._getStrokeDashArray(path, path.length);\n path.el.style.strokeDashoffset = path.length;\n\n path.onStrokeStartDone = false;\n path.onStrokeCompleteDone = false;\n }\n };\n\n /**\n * adjustStartTime\n * Responsible for managing time.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n adjustStartTime() {\n let timestamp = performance.now();\n\n this.config.startTime = timestamp - this.config.elapsedTime;\n requestAnimationFrame(() => {\n this._paint();\n });\n }\n\n /**\n * _paint\n * Responsible for animating paths.\n * Path incrementation is performed using requestAnimationFrame.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n _paint() {\n\n if (!this.config) {\n return;\n }\n\n // set startTime\n if (!this.config.startTime) {\n this.config.startTime = performance.now(); // new Date()\n }\n\n this.emit('update');\n\n // set elapsedTime\n let timestamp = performance.now();\n\n this.config.elapsedTime = (timestamp - this.config.startTime);\n this.config.linearProgress = (this.config.elapsedTime / this.config.totalDuration);\n\n this.config.progress = this._getProgress(this.config.linearProgress, this.config.ease);\n // console.log(this.config.elapsedTime, ' ', this.config.totalDuration);\n\n this._updatePaths();\n\n if (this.config.linearProgress >= 0 && this.config.linearProgress <= 1) {\n this.__raf = requestAnimationFrame(() => {\n this._paint();\n });\n } else {\n this.emit('complete');\n }\n }\n\n _updatePaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n let pathProgress = this._getElapsedProgress(path);\n\n path.progress = this._getProgress(pathProgress, path.ease);\n this._setLine(path);\n this._updatePosition(path);\n this._updateStrokeCallbacks(path);\n }\n }\n\n _getElapsedProgress(path) {\n\n let elapsedProgress;\n\n if (\n this.config.progress >= path.startProgress &&\n this.config.progress <= (path.startProgress + path.durationProgress)\n ) {\n elapsedProgress = (this.config.progress - path.startProgress) / path.durationProgress;\n } else if (this.config.progress >= (path.startProgress + path.durationProgress)) {\n elapsedProgress = 1;\n } else if (this.config.progress <= path.startProgress) {\n elapsedProgress = 0;\n }\n\n return elapsedProgress;\n }\n\n _getProgress(linearProgress, ease) {\n\n let progress = linearProgress;\n\n if (ease) {\n progress = Easing[ease](linearProgress);\n }\n return progress;\n }\n\n _setLine(path) {\n\n let el = path.el;\n let length = path.progress * path.length;\n\n if (path.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else if (this.config.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else {\n el.style.strokeDashoffset = (path.length - length) + 0.1;\n }\n }\n\n _updateStrokeCallbacks(path) {\n\n if (path.progress === 1) {\n\n if (!path.onStrokeCompleteDone) {\n path.onStrokeCompleteDone = true;\n\n this.emit('complete:' + path.id, path);\n this.emit('complete:all', path);\n }\n\n } else if (path.progress > 0.00001) {\n\n if (!path.onStrokeStartDone) {\n this.emit('start:' + path.id, path);\n this.emit('start:all', path);\n path.onStrokeStartDone = true;\n }\n\n this.emit('update:' + path.id, path);\n this.emit('update:all', path);\n }\n }\n\n /**\n * _updatePosition\n * Responsible for updating the paths x / y position.\n * @private\n */\n _updatePosition(path) {\n let index = Math.round((path.progress * (path.length - 1)));\n let position = path.positions[index];\n\n if (position) {\n path.position = {\n x: this.config.offset.left + position.x,\n y: this.config.offset.top + position.y\n };\n }\n\n }\n\n _getTotalDuration() {\n\n let totalDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathDelay = paths[i].delay || 0;\n\n totalDuration += (paths[i].duration + pathDelay);\n }\n\n return totalDuration;\n }\n\n _getLongestDuration() {\n\n let longestDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathTotalDuration = paths[i].delay + paths[i].duration;\n\n if (pathTotalDuration > longestDuration) {\n longestDuration = pathTotalDuration;\n }\n }\n\n return longestDuration;\n };\n\n /**\n * _getPathLength\n * Responsible for returning a svg path length.\n * @return {number} path length\n */\n _getPathLength(el) {\n return Math.ceil(this._getTotalLength(el)); // Math.ceil(el.getTotalLength());\n }\n\n _getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n }\n\n _getCircleLength(el) {\n return Math.PI * 2 * el.getAttribute('r');\n }\n\n _getEllipseLength(el) {\n let rx = parseInt(el.getAttribute('rx'), 1);\n let ry = parseInt(el.getAttribute('ry'), 1);\n let h = Math.pow((rx - ry), 2) / Math.pow((rx + ry), 2);\n let totalLength = (Math.PI * (rx + ry)) * (1 + ((3 * h) / (Math.sqrt(4 - (3 * h)))));\n\n return totalLength;\n }\n\n _getRectLength(el) {\n return (el.getAttribute('width') * 2) + (el.getAttribute('height') * 2);\n }\n\n _getLineLength(el) {\n return this._getDistance(\n {\n x: el.getAttribute('x1'),\n y: el.getAttribute('y1')\n },\n {\n x: el.getAttribute('x2'),\n y: el.getAttribute('y2')\n }\n );\n }\n\n _getPolylineLength(el) {\n const points = el.points;\n let totalLength = 0;\n let previousPos;\n\n for (let i = 0 ; i < points.numberOfItems; i++) {\n const currentPos = points.getItem(i);\n\n if (i > 0) {\n totalLength += this._getDistance(previousPos, currentPos);\n }\n previousPos = currentPos;\n }\n return totalLength;\n }\n\n _getPolygonLength(el) {\n const points = el.points;\n\n return this._getPolylineLength(el) + this._getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n }\n\n _getTotalLength(el) {\n\n let length = el.getTotalLength();\n\n if (!el.getTotalLength || length === 0) {\n let tagName = el.tagName.toLowerCase();\n\n switch (tagName) {\n case 'circle':\n length = this._getCircleLength(el);\n break;\n case 'ellipse':\n length = this._getEllipseLength(el);\n break;\n case 'rect':\n length = this._getRectLength(el);\n break;\n case 'line':\n length = this._getLineLength(el);\n break;\n case 'polyline':\n length = this._getPolylineLength(el);\n break;\n case 'polygon':\n length = this._getPolygonLength(el);\n break;\n }\n }\n return length;\n }\n\n /**\n * _getPathPoints\n * Responsible for returning a svg path coords.\n * @return {array} path coords\n */\n _getPathPoints(el, length) {\n\n let arr = [];\n\n for (let i = 0; i < length; i++) {\n let position = el.getPointAtLength(i);\n\n arr.push({\n x: position.x,\n y: position.y\n });\n };\n return arr;\n }\n\n /**\n * _getStrokeDashArray\n * @private\n */\n _getStrokeDashArray(path, length) {\n let strokeDash;\n\n if (path.strokeDash) {\n strokeDash = this._getStrokeDashString(path.strokeDash, length);\n } else if (this.config.strokeDash) {\n strokeDash = this._getStrokeDashString(this.config.strokeDash, length);\n } else {\n strokeDash = length + ' ' + length;\n };\n return strokeDash;\n }\n\n /**\n * _getStrokeDashString\n * @private\n */\n _getStrokeDashString(dashArray, length) {\n let strokeDashString = '';\n let strokeDashArray = dashArray.split(',');\n\n let strokeDashTotal = 0;\n let strokeDashNum;\n let strokeDashRemainder;\n\n for (let i = strokeDashArray.length - 1; i >= 0; i--) {\n strokeDashTotal += Number(strokeDashArray[i]);\n };\n strokeDashNum = Math.floor(length / strokeDashTotal);\n strokeDashRemainder = length - (strokeDashNum * strokeDashTotal);\n for (let i = 0; i < strokeDashNum ; i++) {\n strokeDashString += (dashArray + ', ');\n };\n let preArray = strokeDashString + strokeDashRemainder + ', ' + (length + 2);\n\n return preArray.split(',').join('px,') + 'px';\n }\n\n}\nwindow.LazyLinePainter = LazyLinePainter;\nexport default LazyLinePainter;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://lazy-line-painter/webpack/universalModuleDefinition","webpack://lazy-line-painter/webpack/bootstrap","webpack://lazy-line-painter/./src/easing.js","webpack://lazy-line-painter/./src/events.js","webpack://lazy-line-painter/./src/index.js"],"names":["Easing","easeLinear","n","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","Math","cos","PI","easeOutSine","sin","easeInOutSine","easeInExpo","pow","easeOutExpo","easeInOutExpo","easeInCirc","sqrt","easeOutCirc","easeInOutCirc","easeInBounce","easeOutBounce","easeInOutBounce","EventEmitter","on","name","callback","_eventEmitterCallbacks","push","addListener","off","i","indexOf","splice","removeListener","emit","evt","trigger","LazyLinePainter","el","config","document","hidden","pause","resume","classList","add","Object","assign","strokeWidth","strokeDash","strokeColor","strokeOverColor","strokeCap","strokeJoin","strokeOpacity","delay","ease","drawSequential","speedMultiplier","reverse","paused","progress","longestDuration","log","offset","getBoundingClientRect","Events","__raf","__paths","_generatePaths","_parseDataAttrs","_updateDuration","_setupPaths","addEventListener","_onVisibilityChange","paths","composed","Boolean","dataset","llpComposed","querySelectorAll","_uncomposed","length","path","id","replace","llpId","llpDuration","llpDelay","console","erase","_paint","cancelAnimationFrame","requestAnimationFrame","adjustStartTime","startTime","elapsedTime","onStrokeCompleteDone","style","strokeDashoffset","onStrokeStartDone","remove","prop","value","_setProgress","_setDelay","_setReverse","_setEase","_getProgress","_updatePaths","totalDuration","_getTotalDuration","_getLongestDuration","_calcPathDurations","duration","startProgress","durationProgress","positions","_getPathPoints","_updatePosition","Number","llpReverse","llpEase","llpStrokeDash","_setStyleAttrs","llpStrokeColor","stroke","llpStrokeOpacity","llpStrokeWidth","llpStrokeCap","strokeLinecap","llpStrokeJoin","strokeLinejoin","index","_getPathLength","strokeDasharray","_getStrokeDashArray","timestamp","performance","now","linearProgress","pathProgress","_getElapsedProgress","_setLine","_updateStrokeCallbacks","elapsedProgress","round","position","x","left","y","top","pathDelay","pathTotalDuration","ceil","_getTotalLength","p1","p2","getAttribute","rx","parseInt","ry","h","totalLength","_getDistance","points","previousPos","numberOfItems","currentPos","getItem","_getPolylineLength","getTotalLength","tagName","toLowerCase","_getCircleLength","_getEllipseLength","_getRectLength","_getLineLength","_getPolygonLength","arr","getPointAtLength","_getStrokeDashString","dashArray","strokeDashString","strokeDashArray","split","strokeDashTotal","strokeDashNum","strokeDashRemainder","floor","preArray","join","window"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AA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;AAED;;;;;;;yCAIqBqI,S,EAAWpG,M,EAAQ;AACtC,UAAIqG,mBAAmB,EAAvB;AACA,UAAIC,kBAAkBF,UAAUG,KAAV,CAAgB,GAAhB,CAAtB;AAEA,UAAIC,kBAAkB,CAAtB;AACA,UAAIC,aAAJ;AACA,UAAIC,mBAAJ;;AAEA,WAAK,IAAI9J,IAAI0J,gBAAgBtG,MAAhB,GAAyB,CAAtC,EAAyCpD,KAAK,CAA9C,EAAiDA,GAAjD,EAAsD;AACpD4J,2BAAmBlE,OAAOgE,gBAAgB1J,CAAhB,CAAP,CAAnB;AACD;;AAAA;AACD6J,sBAAgBtL,KAAKwL,KAAL,CAAW3G,SAASwG,eAApB,CAAhB;AACAE,4BAAsB1G,SAAUyG,gBAAgBD,eAAhD;;AACA,WAAK,IAAI5J,KAAI,CAAb,EAAgBA,KAAI6J,aAApB,EAAoC7J,IAApC,EAAyC;AACvCyJ,4BAAqBD,YAAY,IAAjC;AACD;;AAAA;AACD,UAAIQ,WAAWP,mBAAmBK,mBAAnB,GAAyC,IAAzC,IAAiD1G,SAAS,CAA1D,CAAf;AAEA,aAAO4G,SAASL,KAAT,CAAe,GAAf,EAAoBM,IAApB,CAAyB,KAAzB,IAAkC,IAAzC;AACD;;;;;;AAWHC,OAAO3J,eAAP,GAAyBA,eAAzB;eACeA,e","file":"lazy-line-painter-1.9.2.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"lazy-line-painter\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"lazy-line-painter\"] = factory();\n\telse\n\t\troot[\"lazy-line-painter\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","\nlet Easing = {\n\n easeLinear(n) {\n return n;\n },\n\n easeInQuad(n) {\n return n * n;\n },\n\n easeOutQuad(n) {\n return n * (2 - n);\n },\n\n easeInOutQuad(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n;\n return -0.5 * (--n * (n - 2) - 1);\n },\n\n easeInCubic(n) {\n return n * n * n;\n },\n\n easeOutCubic(n) {\n return --n * n * n + 1;\n },\n\n easeInOutCubic(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n;\n return 0.5 * ((n -= 2) * n * n + 2);\n },\n\n easeInQuart(n) {\n return n * n * n * n;\n },\n\n easeOutQuart(n) {\n return 1 - --n * n * n * n;\n },\n\n easeInOutQuart(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n;\n return -0.5 * ((n -= 2) * n * n * n - 2);\n },\n\n easeInQuint(n) {\n return n * n * n * n * n;\n },\n\n easeOutQuint(n) {\n return --n * n * n * n * n + 1;\n },\n\n easeInOutQuint(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n * n;\n return 0.5 * ((n -= 2) * n * n * n * n + 2);\n },\n\n easeInSine(n) {\n return 1 - Math.cos(n * Math.PI / 2);\n },\n\n easeOutSine(n) {\n return Math.sin(n * Math.PI / 2);\n },\n\n easeInOutSine(n) {\n return 0.5 * (1 - Math.cos(Math.PI * n));\n },\n\n easeInExpo(n) {\n return n === 0 ? 0 : Math.pow(1024, n - 1);\n },\n\n easeOutExpo(n) {\n return n === 1 ? n : 1 - Math.pow(2, -10 * n);\n },\n\n easeInOutExpo(n) {\n if (n === 0) return 0;\n if (n === 1) return 1;\n if ((n *= 2) < 1) return 0.5 * Math.pow(1024, n - 1);\n return 0.5 * (-Math.pow(2, -10 * (n - 1)) + 2);\n },\n\n easeInCirc(n) {\n return 1 - Math.sqrt(1 - n * n);\n },\n\n easeOutCirc(n) {\n return Math.sqrt(1 - --n * n);\n },\n\n easeInOutCirc(n) {\n n *= 2;\n if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1);\n return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);\n },\n\n easeInBounce(n) {\n return 1 - this.easeOutBounce(1 - n);\n },\n\n easeOutBounce(n) {\n if (n < 1 / 2.75) {\n return 7.5625 * n * n;\n } else if (n < 2 / 2.75) {\n return 7.5625 * (n -= 1.5 / 2.75) * n + 0.75;\n } else if (n < 2.5 / 2.75) {\n return 7.5625 * (n -= 2.25 / 2.75) * n + 0.9375;\n }\n return 7.5625 * (n -= 2.625 / 2.75) * n + 0.984375;\n\n },\n\n easeInOutBounce(n) {\n if (n < 0.5) return this.easeInBounce(n * 2) * 0.5;\n return this.easeOutBounce(n * 2 - 1) * 0.5 + 0.5;\n }\n};\n\nexport default Easing;\n\n","let EventEmitter = {};\n\nEventEmitter.on = function (name, callback) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n this._eventEmitterCallbacks[name] = this._eventEmitterCallbacks[name] || [];\n this._eventEmitterCallbacks[name].push(callback);\n};\nEventEmitter.addListener = EventEmitter.on;\n\nEventEmitter.off = function (name, callback) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n if (!(name in this._eventEmitterCallbacks)) return;\n const i = this._eventEmitterCallbacks[name].indexOf(callback);\n\n if (i < 0) return;\n this._eventEmitterCallbacks[name].splice(i, 1);\n};\nEventEmitter.removeListener = EventEmitter.off;\n\nEventEmitter.emit = function (name, evt) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n if (!(name in this._eventEmitterCallbacks)) return;\n for (let callback of this._eventEmitterCallbacks[name]) {\n if (typeof callback !== 'function') return;\n callback(evt);\n }\n};\nEventEmitter.trigger = EventEmitter.emit;\n\nexport default EventEmitter;\n","/*\n * Lazy Line Painter\n * SVG Stroke animation.\n *\n * https://github.com/camoconnell/lazy-line-painter\n * http://www.camoconnell.com\n *\n * Copyright 2013-2018 Cam O'Connell\n * All rights reserved.\n *\n * Licensed under the MIT license.\n *\n */\n\nimport Events from './events';\nimport Easing from './easing';\n\nclass LazyLinePainter {\n\n /**\n * init\n * Responsible for caching user options,\n * @public\n * @param {object} opts user defined options\n */\n\n constructor(el, config) {\n\n this.el = el;\n this.el.classList.add('lazy-line-painter');\n\n this.config = Object.assign({\n\n strokeWidth: null,\n strokeDash: null,\n strokeColor: null,\n strokeOverColor: null,\n strokeCap: null,\n strokeJoin: null,\n strokeOpacity: null,\n\n delay: 0,\n ease: null,\n drawSequential: false,\n speedMultiplier: 1,\n reverse: false,\n paused: false,\n progress: 0,\n\n longestDuration: 0,\n log: true,\n offset: this.el.getBoundingClientRect()\n\n }, config, {});\n\n Object.assign(this, Events, {});\n\n this.__raf = null;\n this.__paths = [];\n\n this._generatePaths();\n this._parseDataAttrs();\n this._updateDuration();\n this._setupPaths();\n\n document.addEventListener('visibilitychange', this._onVisibilityChange);\n }\n\n _generatePaths() {\n\n let paths;\n let composed = Boolean(this.el.dataset.llpComposed);\n\n if (composed) {\n paths = this.el.querySelectorAll('[data-llp-id]');\n } else {\n paths = this._uncomposed();\n }\n\n for (let i = 0; i < paths.length; i++) {\n\n let path = {\n el: paths[i]\n };\n\n this.__paths.push(path);\n }\n }\n\n _uncomposed() {\n let paths = this.el.querySelectorAll('path, polygon, circle, ellipse, polyline, line, rect');\n let i;\n\n for (i = 0; i < paths.length; i++) {\n let id = this.el.id.replace(/ /g, '');\n\n id = id.replace('.', '');\n id = id.replace('-', '');\n paths[i].dataset.llpId = id + '-' + i;\n\n if (!paths[i].dataset.llpDuration) {\n paths[i].dataset.llpDuration = 5000;\n }\n if (!paths[i].dataset.llpDuration) {\n paths[i].dataset.llpDelay = 0;\n }\n }\n\n if (this.config.log) {\n console.log('This lazy line is uncomposed! Visit http://lazylinepainter.info to compose your masterpiece!');\n }\n\n return paths;\n }\n\n /**\n * paint\n * Responsible for drawing path.\n * @public\n */\n\n paint(config) {\n\n // update playback arguments\n Object.assign(this.config, config);\n this._updateDuration();\n\n this.erase();\n\n // begin animation\n this._paint();\n\n // fire start callback\n this.emit('start');\n }\n\n /**\n * pause\n * Responsible for pausing path animation.\n * @public\n */\n pause() {\n this.config.paused = true;\n cancelAnimationFrame(this.__raf);\n this.emit('pause');\n }\n\n /**\n * resume\n * Responsible for resuming path animation.\n * @public\n */\n resume() {\n if (this.config.paused) {\n requestAnimationFrame(() => {\n this.adjustStartTime();\n });\n this.config.paused = false;\n this.emit('resume');\n }\n }\n\n /**\n * erase\n * Responsible for clearing path,\n * paint can still be called on the element after it has been erased.\n * @public\n */\n erase() {\n\n // reset / cancel rAF\n this.config.startTime = null;\n this.config.elapsedTime = null;\n cancelAnimationFrame(this.__raf);\n\n // reset callback\n this.config.onStrokeCompleteDone = false;\n\n // reset paused\n this.config.paused = false;\n\n // empty contents of svg\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.style.strokeDashoffset = path.length;\n path.onStrokeCompleteDone = false;\n path.onStrokeStartDone = false;\n }\n\n this.emit('erase');\n }\n\n /**\n * destroy\n * Responsible for removing lazyline data and element from DOM\n * @public\n */\n destroy() {\n\n // retrieve / remove data object\n this.config = null;\n\n // empty container element\n this.el.remove();\n this.el = null;\n\n }\n\n /**\n * set\n * @public\n */\n set(prop, value) {\n switch (prop) {\n case 'progress':\n this._setProgress(value);\n break;\n case 'delay':\n this._setDelay(value);\n break;\n case 'reverse':\n this._setReverse(value);\n break;\n case 'ease':\n this._setEase(value);\n break;\n default:\n if (this.config.log) {\n console.log('property ' + prop + ' can not be set');\n }\n }\n }\n\n _setEase(ease) {\n this.config.ease = ease;\n }\n\n _setProgress(progress) {\n this.pause();\n this.config.progress = this._getProgress(progress, this.config.ease);\n this._updatePaths();\n this.config.elapsedTime = this.config.progress * this.config.totalDuration;\n }\n\n _setDelay(delay) {\n this.config.delay = delay;\n this._updateDuration();\n }\n\n _setReverse(reverse) {\n this.config.reverse = reverse;\n this._updateDuration();\n }\n\n _updateDuration() {\n\n let totalDuration = this._getTotalDuration();\n let longestDuration = this._getLongestDuration();\n\n this.config.totalDuration = this.config.drawSequential ? totalDuration : longestDuration;\n this.config.totalDuration += this.config.delay;\n\n this._calcPathDurations();\n }\n\n _calcPathDurations() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n let startTime;\n\n path.progress = 0;\n\n if (this.config.reverse) {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.totalDuration - (path.delay + path.duration);\n }\n } else {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.delay + path.delay;\n }\n }\n\n path.startTime = startTime;\n path.startProgress = (path.startTime / this.config.totalDuration);\n path.durationProgress = (path.duration / this.config.totalDuration);\n }\n }\n\n /**\n * get\n * @public\n */\n get() {\n return this.config;\n }\n\n /**\n * resize\n * @public\n */\n resize() {\n\n this.config.offset = this.el.getBoundingClientRect();\n // this.config.scale = this.config.offset.width / this.config.width;\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.getBoundingClientRect();\n path.positions = this._getPathPoints(path.el, path.length);\n this._updatePosition(path);\n }\n }\n\n _parseDataAttrs() {\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.id = path.el.dataset.llpId;\n path.delay = Number(path.el.dataset.llpDelay) || 0;\n path.duration = Number(path.el.dataset.llpDuration) || 0;\n path.reverse = Boolean(path.el.dataset.llpReverse) || false;\n path.ease = Number(path.el.dataset.llpEase) || null;\n path.strokeDash = path.el.dataset.llpStrokeDash || null;\n path.delay *= this.config.speedMultiplier;\n path.duration *= this.config.speedMultiplier;\n\n this._setStyleAttrs(path);\n }\n }\n\n _setStyleAttrs(path) {\n\n path.strokeColor = (path.el.dataset.llpStrokeColor || this.config.strokeColor);\n if (path.strokeColor) {\n path.el.style.stroke = path.strokeColor;\n }\n\n path.strokeOpacity = (path.el.dataset.llpStrokeOpacity || this.config.strokeOpacity);\n if (path.strokeOpacity) {\n path.el.style.strokeOpacity = path.strokeOpacity;\n }\n\n path.strokeWidth = (path.el.dataset.llpStrokeWidth || this.config.strokeWidth);\n if (path.strokeWidth) {\n path.el.style.strokeWidth = path.strokeWidth;\n }\n\n path.strokeCap = (path.el.dataset.llpStrokeCap || this.config.strokeCap);\n if (path.strokeCap) {\n path.el.style.strokeLinecap = path.strokeCap;\n }\n\n path.strokeJoin = (path.el.dataset.llpStrokeJoin || this.config.strokeJoin);\n if (path.strokeJoin) {\n path.el.style.strokeLinejoin = path.strokeJoin;\n }\n }\n\n _setupPaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n\n path.index = i;\n path.length = this._getPathLength(path.el);\n path.positions = this._getPathPoints(path.el, path.length);\n\n path.el.style.strokeDasharray = this._getStrokeDashArray(path, path.length);\n path.el.style.strokeDashoffset = path.length;\n\n path.onStrokeStartDone = false;\n path.onStrokeCompleteDone = false;\n }\n };\n\n /**\n * adjustStartTime\n * Responsible for managing time.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n adjustStartTime() {\n let timestamp = performance.now();\n\n this.config.startTime = timestamp - this.config.elapsedTime;\n requestAnimationFrame(() => {\n this._paint();\n });\n }\n\n /**\n * _paint\n * Responsible for animating paths.\n * Path incrementation is performed using requestAnimationFrame.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n _paint() {\n\n if (!this.config) {\n return;\n }\n\n // set startTime\n if (!this.config.startTime) {\n this.config.startTime = performance.now(); // new Date()\n }\n\n this.emit('update');\n\n // set elapsedTime\n let timestamp = performance.now();\n\n this.config.elapsedTime = (timestamp - this.config.startTime);\n this.config.linearProgress = (this.config.elapsedTime / this.config.totalDuration);\n\n this.config.progress = this._getProgress(this.config.linearProgress, this.config.ease);\n // console.log(this.config.elapsedTime, ' ', this.config.totalDuration);\n\n this._updatePaths();\n\n if (this.config.linearProgress >= 0 && this.config.linearProgress <= 1) {\n this.__raf = requestAnimationFrame(() => {\n this._paint();\n });\n } else {\n this.emit('complete');\n }\n }\n\n _updatePaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n let pathProgress = this._getElapsedProgress(path);\n\n path.progress = this._getProgress(pathProgress, path.ease);\n this._setLine(path);\n this._updatePosition(path);\n this._updateStrokeCallbacks(path);\n }\n }\n\n _getElapsedProgress(path) {\n\n let elapsedProgress;\n\n if (\n this.config.progress >= path.startProgress &&\n this.config.progress <= (path.startProgress + path.durationProgress)\n ) {\n elapsedProgress = (this.config.progress - path.startProgress) / path.durationProgress;\n } else if (this.config.progress >= (path.startProgress + path.durationProgress)) {\n elapsedProgress = 1;\n } else if (this.config.progress <= path.startProgress) {\n elapsedProgress = 0;\n }\n\n return elapsedProgress;\n }\n\n _getProgress(linearProgress, ease) {\n\n let progress = linearProgress;\n\n if (ease) {\n progress = Easing[ease](linearProgress);\n }\n return progress;\n }\n\n _setLine(path) {\n\n let el = path.el;\n let length = path.progress * path.length;\n\n if (path.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else if (this.config.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else {\n el.style.strokeDashoffset = (path.length - length) + 0.1;\n }\n }\n\n _updateStrokeCallbacks(path) {\n\n if (path.progress === 1) {\n\n if (!path.onStrokeCompleteDone) {\n path.onStrokeCompleteDone = true;\n\n this.emit('complete:' + path.id, path);\n this.emit('complete:all', path);\n }\n\n } else if (path.progress > 0.00001) {\n\n if (!path.onStrokeStartDone) {\n this.emit('start:' + path.id, path);\n this.emit('start:all', path);\n path.onStrokeStartDone = true;\n }\n\n this.emit('update:' + path.id, path);\n this.emit('update:all', path);\n }\n }\n\n /**\n * _updatePosition\n * Responsible for updating the paths x / y position.\n * @private\n */\n _updatePosition(path) {\n let index = Math.round((path.progress * (path.length - 1)));\n let position = path.positions[index];\n\n if (position) {\n path.position = {\n x: this.config.offset.left + position.x,\n y: this.config.offset.top + position.y\n };\n }\n\n }\n\n _getTotalDuration() {\n\n let totalDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathDelay = paths[i].delay || 0;\n\n totalDuration += (paths[i].duration + pathDelay);\n }\n\n return totalDuration;\n }\n\n _getLongestDuration() {\n\n let longestDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathTotalDuration = paths[i].delay + paths[i].duration;\n\n if (pathTotalDuration > longestDuration) {\n longestDuration = pathTotalDuration;\n }\n }\n\n return longestDuration;\n };\n\n /**\n * _getPathLength\n * Responsible for returning a svg path length.\n * @return {number} path length\n */\n _getPathLength(el) {\n return Math.ceil(this._getTotalLength(el)); // Math.ceil(el.getTotalLength());\n }\n\n _getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n }\n\n _getCircleLength(el) {\n return Math.PI * 2 * el.getAttribute('r');\n }\n\n _getEllipseLength(el) {\n let rx = parseInt(el.getAttribute('rx'), 1);\n let ry = parseInt(el.getAttribute('ry'), 1);\n let h = Math.pow((rx - ry), 2) / Math.pow((rx + ry), 2);\n let totalLength = (Math.PI * (rx + ry)) * (1 + ((3 * h) / (Math.sqrt(4 - (3 * h)))));\n\n return totalLength;\n }\n\n _getRectLength(el) {\n return (el.getAttribute('width') * 2) + (el.getAttribute('height') * 2);\n }\n\n _getLineLength(el) {\n return this._getDistance(\n {\n x: el.getAttribute('x1'),\n y: el.getAttribute('y1')\n },\n {\n x: el.getAttribute('x2'),\n y: el.getAttribute('y2')\n }\n );\n }\n\n _getPolylineLength(el) {\n const points = el.points;\n let totalLength = 0;\n let previousPos;\n\n for (let i = 0 ; i < points.numberOfItems; i++) {\n const currentPos = points.getItem(i);\n\n if (i > 0) {\n totalLength += this._getDistance(previousPos, currentPos);\n }\n previousPos = currentPos;\n }\n return totalLength;\n }\n\n _getPolygonLength(el) {\n const points = el.points;\n\n return this._getPolylineLength(el) + this._getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n }\n\n _getTotalLength(el) {\n\n let length = el.getTotalLength();\n\n if (!el.getTotalLength || length === 0) {\n let tagName = el.tagName.toLowerCase();\n\n switch (tagName) {\n case 'circle':\n length = this._getCircleLength(el);\n break;\n case 'ellipse':\n length = this._getEllipseLength(el);\n break;\n case 'rect':\n length = this._getRectLength(el);\n break;\n case 'line':\n length = this._getLineLength(el);\n break;\n case 'polyline':\n length = this._getPolylineLength(el);\n break;\n case 'polygon':\n length = this._getPolygonLength(el);\n break;\n }\n }\n return length;\n }\n\n /**\n * _getPathPoints\n * Responsible for returning a svg path coords.\n * @return {array} path coords\n */\n _getPathPoints(el, length) {\n\n let arr = [];\n\n for (let i = 0; i < length; i++) {\n let position = el.getPointAtLength(i);\n\n arr.push({\n x: position.x,\n y: position.y\n });\n };\n return arr;\n }\n\n /**\n * _getStrokeDashArray\n * @private\n */\n _getStrokeDashArray(path, length) {\n let strokeDash;\n\n if (path.strokeDash) {\n strokeDash = this._getStrokeDashString(path.strokeDash, length);\n } else if (this.config.strokeDash) {\n strokeDash = this._getStrokeDashString(this.config.strokeDash, length);\n } else {\n strokeDash = length + ' ' + length;\n };\n return strokeDash;\n }\n\n /**\n * _getStrokeDashString\n * @private\n */\n _getStrokeDashString(dashArray, length) {\n let strokeDashString = '';\n let strokeDashArray = dashArray.split(',');\n\n let strokeDashTotal = 0;\n let strokeDashNum;\n let strokeDashRemainder;\n\n for (let i = strokeDashArray.length - 1; i >= 0; i--) {\n strokeDashTotal += Number(strokeDashArray[i]);\n };\n strokeDashNum = Math.floor(length / strokeDashTotal);\n strokeDashRemainder = length - (strokeDashNum * strokeDashTotal);\n for (let i = 0; i < strokeDashNum ; i++) {\n strokeDashString += (dashArray + ', ');\n };\n let preArray = strokeDashString + strokeDashRemainder + ', ' + (length + 2);\n\n return preArray.split(',').join('px,') + 'px';\n }\n\n _onVisibilityChange = () => {\n if (document.hidden) {\n this.pause();\n } else {\n this.resume();\n }\n }\n\n}\nwindow.LazyLinePainter = LazyLinePainter;\nexport default LazyLinePainter;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/lazy-line-painter-1.9.2.min.js b/lib/lazy-line-painter-1.9.2.min.js index c4d57c4..00fc695 100644 --- a/lib/lazy-line-painter-1.9.2.min.js +++ b/lib/lazy-line-painter-1.9.2.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("lazy-line-painter",[],e):"object"==typeof exports?exports["lazy-line-painter"]=e():t["lazy-line-painter"]=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return 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="",n(n.s=2)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={easeLinear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return--t*t*t*t*t+1},easeInOutQuint:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*Math.PI/2)},easeOutSine:function(t){return Math.sin(t*Math.PI/2)},easeInOutSine:function(t){return.5*(1-Math.cos(Math.PI*t))},easeInExpo:function(t){return 0===t?0:Math.pow(1024,t-1)},easeOutExpo:function(t){return 1===t?t:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},easeInCirc:function(t){return 1-Math.sqrt(1-t*t)},easeOutCirc:function(t){return Math.sqrt(1- --t*t)},easeInOutCirc:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInBounce:function(t){return 1-this.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*this.easeInBounce(2*t):.5*this.easeOutBounce(2*t-1)+.5}};e.default=i,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={on:function(t,e){this._eventEmitterCallbacks=this._eventEmitterCallbacks||{},this._eventEmitterCallbacks[t]=this._eventEmitterCallbacks[t]||[],this._eventEmitterCallbacks[t].push(e)}};i.addListener=i.on,i.off=function(t,e){if(this._eventEmitterCallbacks=this._eventEmitterCallbacks||{},t in this._eventEmitterCallbacks){var n=this._eventEmitterCallbacks[t].indexOf(e);n<0||this._eventEmitterCallbacks[t].splice(n,1)}},i.removeListener=i.off,i.emit=function(t,e){if(this._eventEmitterCallbacks=this._eventEmitterCallbacks||{},t in this._eventEmitterCallbacks){var n=!0,i=!1,s=void 0;try{for(var r,a=this._eventEmitterCallbacks[t][Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var o=r.value;if("function"!=typeof o)return;o(e)}}catch(t){i=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw s}}}},i.trigger=i.emit;var s=i;e.default=s,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(1)),s=r(n(0));function r(t){return t&&t.__esModule?t:{default:t}}function a(t,e){for(var n=0;n=0&&this.config.linearProgress<=1?this.__raf=requestAnimationFrame(function(){t._paint()}):this.emit("complete")}}},{key:"_updatePaths",value:function(){for(var t=0;t=t.startProgress&&this.config.progress<=t.startProgress+t.durationProgress?e=(this.config.progress-t.startProgress)/t.durationProgress:this.config.progress>=t.startProgress+t.durationProgress?e=1:this.config.progress<=t.startProgress&&(e=0),e}},{key:"_getProgress",value:function(t,e){var n=t;return e&&(n=s.default[e](t)),n}},{key:"_setLine",value:function(t){var e=t.el,n=t.progress*t.length;t.reverse?e.style.strokeDashoffset=-t.length+n:this.config.reverse?e.style.strokeDashoffset=-t.length+n:e.style.strokeDashoffset=t.length-n+.1}},{key:"_updateStrokeCallbacks",value:function(t){1===t.progress?t.onStrokeCompleteDone||(t.onStrokeCompleteDone=!0,this.emit("complete:"+t.id,t),this.emit("complete:all",t)):t.progress>1e-5&&(t.onStrokeStartDone||(this.emit("start:"+t.id,t),this.emit("start:all",t),t.onStrokeStartDone=!0),this.emit("update:"+t.id,t),this.emit("update:all",t))}},{key:"_updatePosition",value:function(t){var e=Math.round(t.progress*(t.length-1)),n=t.positions[e];n&&(t.position={x:this.config.offset.left+n.x,y:this.config.offset.top+n.y})}},{key:"_getTotalDuration",value:function(){for(var t=0,e=this.__paths,n=0;nt&&(t=i)}return t}},{key:"_getPathLength",value:function(t){return Math.ceil(this._getTotalLength(t))}},{key:"_getDistance",value:function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}},{key:"_getCircleLength",value:function(t){return 2*Math.PI*t.getAttribute("r")}},{key:"_getEllipseLength",value:function(t){var e=parseInt(t.getAttribute("rx"),1),n=parseInt(t.getAttribute("ry"),1),i=Math.pow(e-n,2)/Math.pow(e+n,2);return Math.PI*(e+n)*(1+3*i/Math.sqrt(4-3*i))}},{key:"_getRectLength",value:function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}},{key:"_getLineLength",value:function(t){return this._getDistance({x:t.getAttribute("x1"),y:t.getAttribute("y1")},{x:t.getAttribute("x2"),y:t.getAttribute("y2")})}},{key:"_getPolylineLength",value:function(t){for(var e,n=t.points,i=0,s=0;s0&&(i+=this._getDistance(e,r)),e=r}return i}},{key:"_getPolygonLength",value:function(t){var e=t.points;return this._getPolylineLength(t)+this._getDistance(e.getItem(e.numberOfItems-1),e.getItem(0))}},{key:"_getTotalLength",value:function(t){var e=t.getTotalLength();if(!t.getTotalLength||0===e)switch(t.tagName.toLowerCase()){case"circle":e=this._getCircleLength(t);break;case"ellipse":e=this._getEllipseLength(t);break;case"rect":e=this._getRectLength(t);break;case"line":e=this._getLineLength(t);break;case"polyline":e=this._getPolylineLength(t);break;case"polygon":e=this._getPolygonLength(t)}return e}},{key:"_getPathPoints",value:function(t,e){for(var n=[],i=0;i=0;o--)a+=Number(r[o]);i=e-(n=Math.floor(e/a))*a;for(var l=0;l=0&&this.config.linearProgress<=1?this.__raf=requestAnimationFrame(function(){t._paint()}):this.emit("complete")}}},{key:"_updatePaths",value:function(){for(var t=0;t=t.startProgress&&this.config.progress<=t.startProgress+t.durationProgress?e=(this.config.progress-t.startProgress)/t.durationProgress:this.config.progress>=t.startProgress+t.durationProgress?e=1:this.config.progress<=t.startProgress&&(e=0),e}},{key:"_getProgress",value:function(t,e){var n=t;return e&&(n=s.default[e](t)),n}},{key:"_setLine",value:function(t){var e=t.el,n=t.progress*t.length;t.reverse?e.style.strokeDashoffset=-t.length+n:this.config.reverse?e.style.strokeDashoffset=-t.length+n:e.style.strokeDashoffset=t.length-n+.1}},{key:"_updateStrokeCallbacks",value:function(t){1===t.progress?t.onStrokeCompleteDone||(t.onStrokeCompleteDone=!0,this.emit("complete:"+t.id,t),this.emit("complete:all",t)):t.progress>1e-5&&(t.onStrokeStartDone||(this.emit("start:"+t.id,t),this.emit("start:all",t),t.onStrokeStartDone=!0),this.emit("update:"+t.id,t),this.emit("update:all",t))}},{key:"_updatePosition",value:function(t){var e=Math.round(t.progress*(t.length-1)),n=t.positions[e];n&&(t.position={x:this.config.offset.left+n.x,y:this.config.offset.top+n.y})}},{key:"_getTotalDuration",value:function(){for(var t=0,e=this.__paths,n=0;nt&&(t=i)}return t}},{key:"_getPathLength",value:function(t){return Math.ceil(this._getTotalLength(t))}},{key:"_getDistance",value:function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}},{key:"_getCircleLength",value:function(t){return 2*Math.PI*t.getAttribute("r")}},{key:"_getEllipseLength",value:function(t){var e=parseInt(t.getAttribute("rx"),1),n=parseInt(t.getAttribute("ry"),1),i=Math.pow(e-n,2)/Math.pow(e+n,2);return Math.PI*(e+n)*(1+3*i/Math.sqrt(4-3*i))}},{key:"_getRectLength",value:function(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}},{key:"_getLineLength",value:function(t){return this._getDistance({x:t.getAttribute("x1"),y:t.getAttribute("y1")},{x:t.getAttribute("x2"),y:t.getAttribute("y2")})}},{key:"_getPolylineLength",value:function(t){for(var e,n=t.points,i=0,s=0;s0&&(i+=this._getDistance(e,r)),e=r}return i}},{key:"_getPolygonLength",value:function(t){var e=t.points;return this._getPolylineLength(t)+this._getDistance(e.getItem(e.numberOfItems-1),e.getItem(0))}},{key:"_getTotalLength",value:function(t){var e=t.getTotalLength();if(!t.getTotalLength||0===e)switch(t.tagName.toLowerCase()){case"circle":e=this._getCircleLength(t);break;case"ellipse":e=this._getEllipseLength(t);break;case"rect":e=this._getRectLength(t);break;case"line":e=this._getLineLength(t);break;case"polyline":e=this._getPolylineLength(t);break;case"polygon":e=this._getPolygonLength(t)}return e}},{key:"_getPathPoints",value:function(t,e){for(var n=[],i=0;i=0;o--)a+=Number(r[o]);i=e-(n=Math.floor(e/a))*a;for(var l=0;l {\n this.adjustStartTime();\n });\n this.config.paused = false;\n this.emit('resume');\n }\n }\n\n /**\n * erase\n * Responsible for clearing path,\n * paint can still be called on the element after it has been erased.\n * @public\n */\n erase() {\n\n // reset / cancel rAF\n this.config.startTime = null;\n this.config.elapsedTime = null;\n cancelAnimationFrame(this.__raf);\n\n // reset callback\n this.config.onStrokeCompleteDone = false;\n\n // reset paused\n this.config.paused = false;\n\n // empty contents of svg\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.style.strokeDashoffset = path.length;\n path.onStrokeCompleteDone = false;\n path.onStrokeStartDone = false;\n }\n\n this.emit('erase');\n }\n\n /**\n * destroy\n * Responsible for removing lazyline data and element from DOM\n * @public\n */\n destroy() {\n\n // retrieve / remove data object\n this.config = null;\n\n // empty container element\n this.el.remove();\n this.el = null;\n\n }\n\n /**\n * set\n * @public\n */\n set(prop, value) {\n switch (prop) {\n case 'progress':\n this._setProgress(value);\n break;\n case 'delay':\n this._setDelay(value);\n break;\n case 'reverse':\n this._setReverse(value);\n break;\n case 'ease':\n this._setEase(value);\n break;\n default:\n if (this.config.log) {\n console.log('property ' + prop + ' can not be set');\n }\n }\n }\n\n _setEase(ease) {\n this.config.ease = ease;\n }\n\n _setProgress(progress) {\n this.pause();\n this.config.progress = this._getProgress(progress, this.config.ease);\n this._updatePaths();\n this.config.elapsedTime = this.config.progress * this.config.totalDuration;\n }\n\n _setDelay(delay) {\n this.config.delay = delay;\n this._updateDuration();\n }\n\n _setReverse(reverse) {\n this.config.reverse = reverse;\n this._updateDuration();\n }\n\n _updateDuration() {\n\n let totalDuration = this._getTotalDuration();\n let longestDuration = this._getLongestDuration();\n\n this.config.totalDuration = this.config.drawSequential ? totalDuration : longestDuration;\n this.config.totalDuration += this.config.delay;\n\n this._calcPathDurations();\n }\n\n _calcPathDurations() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n let startTime;\n\n path.progress = 0;\n\n if (this.config.reverse) {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.totalDuration - (path.delay + path.duration);\n }\n } else {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.delay + path.delay;\n }\n }\n\n path.startTime = startTime;\n path.startProgress = (path.startTime / this.config.totalDuration);\n path.durationProgress = (path.duration / this.config.totalDuration);\n }\n }\n\n /**\n * get\n * @public\n */\n get() {\n return this.config;\n }\n\n /**\n * resize\n * @public\n */\n resize() {\n\n this.config.offset = this.el.getBoundingClientRect();\n // this.config.scale = this.config.offset.width / this.config.width;\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.getBoundingClientRect();\n path.positions = this._getPathPoints(path.el, path.length);\n this._updatePosition(path);\n }\n }\n\n _parseDataAttrs() {\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.id = path.el.dataset.llpId;\n path.delay = Number(path.el.dataset.llpDelay) || 0;\n path.duration = Number(path.el.dataset.llpDuration) || 0;\n path.reverse = Boolean(path.el.dataset.llpReverse) || false;\n path.ease = Number(path.el.dataset.llpEase) || null;\n path.strokeDash = path.el.dataset.llpStrokeDash || null;\n path.delay *= this.config.speedMultiplier;\n path.duration *= this.config.speedMultiplier;\n\n this._setStyleAttrs(path);\n }\n }\n\n _setStyleAttrs(path) {\n\n path.strokeColor = (path.el.dataset.llpStrokeColor || this.config.strokeColor);\n if (path.strokeColor) {\n path.el.style.stroke = path.strokeColor;\n }\n\n path.strokeOpacity = (path.el.dataset.llpStrokeOpacity || this.config.strokeOpacity);\n if (path.strokeOpacity) {\n path.el.style.strokeOpacity = path.strokeOpacity;\n }\n\n path.strokeWidth = (path.el.dataset.llpStrokeWidth || this.config.strokeWidth);\n if (path.strokeWidth) {\n path.el.style.strokeWidth = path.strokeWidth;\n }\n\n path.strokeCap = (path.el.dataset.llpStrokeCap || this.config.strokeCap);\n if (path.strokeCap) {\n path.el.style.strokeLinecap = path.strokeCap;\n }\n\n path.strokeJoin = (path.el.dataset.llpStrokeJoin || this.config.strokeJoin);\n if (path.strokeJoin) {\n path.el.style.strokeLinejoin = path.strokeJoin;\n }\n }\n\n _setupPaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n\n path.index = i;\n path.length = this._getPathLength(path.el);\n path.positions = this._getPathPoints(path.el, path.length);\n\n path.el.style.strokeDasharray = this._getStrokeDashArray(path, path.length);\n path.el.style.strokeDashoffset = path.length;\n\n path.onStrokeStartDone = false;\n path.onStrokeCompleteDone = false;\n }\n };\n\n /**\n * adjustStartTime\n * Responsible for managing time.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n adjustStartTime() {\n let timestamp = performance.now();\n\n this.config.startTime = timestamp - this.config.elapsedTime;\n requestAnimationFrame(() => {\n this._paint();\n });\n }\n\n /**\n * _paint\n * Responsible for animating paths.\n * Path incrementation is performed using requestAnimationFrame.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n _paint() {\n\n if (!this.config) {\n return;\n }\n\n // set startTime\n if (!this.config.startTime) {\n this.config.startTime = performance.now(); // new Date()\n }\n\n this.emit('update');\n\n // set elapsedTime\n let timestamp = performance.now();\n\n this.config.elapsedTime = (timestamp - this.config.startTime);\n this.config.linearProgress = (this.config.elapsedTime / this.config.totalDuration);\n\n this.config.progress = this._getProgress(this.config.linearProgress, this.config.ease);\n // console.log(this.config.elapsedTime, ' ', this.config.totalDuration);\n\n this._updatePaths();\n\n if (this.config.linearProgress >= 0 && this.config.linearProgress <= 1) {\n this.__raf = requestAnimationFrame(() => {\n this._paint();\n });\n } else {\n this.emit('complete');\n }\n }\n\n _updatePaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n let pathProgress = this._getElapsedProgress(path);\n\n path.progress = this._getProgress(pathProgress, path.ease);\n this._setLine(path);\n this._updatePosition(path);\n this._updateStrokeCallbacks(path);\n }\n }\n\n _getElapsedProgress(path) {\n\n let elapsedProgress;\n\n if (\n this.config.progress >= path.startProgress &&\n this.config.progress <= (path.startProgress + path.durationProgress)\n ) {\n elapsedProgress = (this.config.progress - path.startProgress) / path.durationProgress;\n } else if (this.config.progress >= (path.startProgress + path.durationProgress)) {\n elapsedProgress = 1;\n } else if (this.config.progress <= path.startProgress) {\n elapsedProgress = 0;\n }\n\n return elapsedProgress;\n }\n\n _getProgress(linearProgress, ease) {\n\n let progress = linearProgress;\n\n if (ease) {\n progress = Easing[ease](linearProgress);\n }\n return progress;\n }\n\n _setLine(path) {\n\n let el = path.el;\n let length = path.progress * path.length;\n\n if (path.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else if (this.config.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else {\n el.style.strokeDashoffset = (path.length - length) + 0.1;\n }\n }\n\n _updateStrokeCallbacks(path) {\n\n if (path.progress === 1) {\n\n if (!path.onStrokeCompleteDone) {\n path.onStrokeCompleteDone = true;\n\n this.emit('complete:' + path.id, path);\n this.emit('complete:all', path);\n }\n\n } else if (path.progress > 0.00001) {\n\n if (!path.onStrokeStartDone) {\n this.emit('start:' + path.id, path);\n this.emit('start:all', path);\n path.onStrokeStartDone = true;\n }\n\n this.emit('update:' + path.id, path);\n this.emit('update:all', path);\n }\n }\n\n /**\n * _updatePosition\n * Responsible for updating the paths x / y position.\n * @private\n */\n _updatePosition(path) {\n let index = Math.round((path.progress * (path.length - 1)));\n let position = path.positions[index];\n\n if (position) {\n path.position = {\n x: this.config.offset.left + position.x,\n y: this.config.offset.top + position.y\n };\n }\n\n }\n\n _getTotalDuration() {\n\n let totalDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathDelay = paths[i].delay || 0;\n\n totalDuration += (paths[i].duration + pathDelay);\n }\n\n return totalDuration;\n }\n\n _getLongestDuration() {\n\n let longestDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathTotalDuration = paths[i].delay + paths[i].duration;\n\n if (pathTotalDuration > longestDuration) {\n longestDuration = pathTotalDuration;\n }\n }\n\n return longestDuration;\n };\n\n /**\n * _getPathLength\n * Responsible for returning a svg path length.\n * @return {number} path length\n */\n _getPathLength(el) {\n return Math.ceil(this._getTotalLength(el)); // Math.ceil(el.getTotalLength());\n }\n\n _getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n }\n\n _getCircleLength(el) {\n return Math.PI * 2 * el.getAttribute('r');\n }\n\n _getEllipseLength(el) {\n let rx = parseInt(el.getAttribute('rx'), 1);\n let ry = parseInt(el.getAttribute('ry'), 1);\n let h = Math.pow((rx - ry), 2) / Math.pow((rx + ry), 2);\n let totalLength = (Math.PI * (rx + ry)) * (1 + ((3 * h) / (Math.sqrt(4 - (3 * h)))));\n\n return totalLength;\n }\n\n _getRectLength(el) {\n return (el.getAttribute('width') * 2) + (el.getAttribute('height') * 2);\n }\n\n _getLineLength(el) {\n return this._getDistance(\n {\n x: el.getAttribute('x1'),\n y: el.getAttribute('y1')\n },\n {\n x: el.getAttribute('x2'),\n y: el.getAttribute('y2')\n }\n );\n }\n\n _getPolylineLength(el) {\n const points = el.points;\n let totalLength = 0;\n let previousPos;\n\n for (let i = 0 ; i < points.numberOfItems; i++) {\n const currentPos = points.getItem(i);\n\n if (i > 0) {\n totalLength += this._getDistance(previousPos, currentPos);\n }\n previousPos = currentPos;\n }\n return totalLength;\n }\n\n _getPolygonLength(el) {\n const points = el.points;\n\n return this._getPolylineLength(el) + this._getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n }\n\n _getTotalLength(el) {\n\n let length = el.getTotalLength();\n\n if (!el.getTotalLength || length === 0) {\n let tagName = el.tagName.toLowerCase();\n\n switch (tagName) {\n case 'circle':\n length = this._getCircleLength(el);\n break;\n case 'ellipse':\n length = this._getEllipseLength(el);\n break;\n case 'rect':\n length = this._getRectLength(el);\n break;\n case 'line':\n length = this._getLineLength(el);\n break;\n case 'polyline':\n length = this._getPolylineLength(el);\n break;\n case 'polygon':\n length = this._getPolygonLength(el);\n break;\n }\n }\n return length;\n }\n\n /**\n * _getPathPoints\n * Responsible for returning a svg path coords.\n * @return {array} path coords\n */\n _getPathPoints(el, length) {\n\n let arr = [];\n\n for (let i = 0; i < length; i++) {\n let position = el.getPointAtLength(i);\n\n arr.push({\n x: position.x,\n y: position.y\n });\n };\n return arr;\n }\n\n /**\n * _getStrokeDashArray\n * @private\n */\n _getStrokeDashArray(path, length) {\n let strokeDash;\n\n if (path.strokeDash) {\n strokeDash = this._getStrokeDashString(path.strokeDash, length);\n } else if (this.config.strokeDash) {\n strokeDash = this._getStrokeDashString(this.config.strokeDash, length);\n } else {\n strokeDash = length + ' ' + length;\n };\n return strokeDash;\n }\n\n /**\n * _getStrokeDashString\n * @private\n */\n _getStrokeDashString(dashArray, length) {\n let strokeDashString = '';\n let strokeDashArray = dashArray.split(',');\n\n let strokeDashTotal = 0;\n let strokeDashNum;\n let strokeDashRemainder;\n\n for (let i = strokeDashArray.length - 1; i >= 0; i--) {\n strokeDashTotal += Number(strokeDashArray[i]);\n };\n strokeDashNum = Math.floor(length / strokeDashTotal);\n strokeDashRemainder = length - (strokeDashNum * strokeDashTotal);\n for (let i = 0; i < strokeDashNum ; i++) {\n strokeDashString += (dashArray + ', ');\n };\n let preArray = strokeDashString + strokeDashRemainder + ', ' + (length + 2);\n\n return preArray.split(',').join('px,') + 'px';\n }\n\n}\nwindow.LazyLinePainter = LazyLinePainter;\nexport default LazyLinePainter;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://lazy-line-painter/webpack/universalModuleDefinition","webpack://lazy-line-painter/webpack/bootstrap","webpack://lazy-line-painter/./src/easing.js","webpack://lazy-line-painter/./src/events.js","webpack://lazy-line-painter/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","easeLinear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","Math","cos","PI","easeOutSine","sin","easeInOutSine","easeInExpo","pow","easeOutExpo","easeInOutExpo","easeInCirc","sqrt","easeOutCirc","easeInOutCirc","easeInBounce","this","easeOutBounce","easeInOutBounce","EventEmitter","callback","_eventEmitterCallbacks","push","addListener","on","off","indexOf","splice","removeListener","emit","evt","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","iterator","next","done","err","return","trigger","_events","_interopRequireDefault","_easing","LazyLinePainter","el","config","_this","_classCallCheck","_defineProperty","document","hidden","pause","resume","classList","add","assign","strokeWidth","strokeDash","strokeColor","strokeOverColor","strokeCap","strokeJoin","strokeOpacity","delay","ease","drawSequential","speedMultiplier","reverse","paused","progress","longestDuration","log","offset","getBoundingClientRect","Events","__raf","__paths","_generatePaths","_parseDataAttrs","_updateDuration","_setupPaths","addEventListener","_onVisibilityChange","paths","Boolean","dataset","llpComposed","querySelectorAll","_uncomposed","length","path","id","replace","llpId","llpDuration","llpDelay","console","erase","_paint","cancelAnimationFrame","_this2","requestAnimationFrame","adjustStartTime","startTime","elapsedTime","onStrokeCompleteDone","style","strokeDashoffset","onStrokeStartDone","remove","prop","_setProgress","_setDelay","_setReverse","_setEase","_getProgress","_updatePaths","totalDuration","_getTotalDuration","_getLongestDuration","_calcPathDurations","duration","startProgress","durationProgress","positions","_getPathPoints","_updatePosition","Number","llpReverse","llpEase","llpStrokeDash","_setStyleAttrs","llpStrokeColor","stroke","llpStrokeOpacity","llpStrokeWidth","llpStrokeCap","strokeLinecap","llpStrokeJoin","strokeLinejoin","index","_getPathLength","strokeDasharray","_getStrokeDashArray","_this3","timestamp","performance","now","_this4","linearProgress","pathProgress","_getElapsedProgress","_setLine","_updateStrokeCallbacks","elapsedProgress","Easing","round","position","x","left","y","top","pathDelay","pathTotalDuration","ceil","_getTotalLength","p1","p2","getAttribute","rx","parseInt","ry","h","_getDistance","previousPos","points","totalLength","numberOfItems","currentPos","getItem","_getPolylineLength","getTotalLength","tagName","toLowerCase","_getCircleLength","_getEllipseLength","_getRectLength","_getLineLength","_getPolygonLength","arr","getPointAtLength","_getStrokeDashString","dashArray","strokeDashNum","strokeDashRemainder","strokeDashString","strokeDashArray","split","strokeDashTotal","floor","join"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,uBAAAH,GACA,iBAAAC,QACAA,QAAA,qBAAAD,IAEAD,EAAA,qBAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,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,EACAC,EALAC,EAAmB,GACnBC,EAAkBJ,EAAUK,MAAM,KAElCC,EAAkB,EAIbtP,EAAIoP,EAAgB3G,OAAS,EAAGzI,GAAK,EAAGA,IAC/CsP,GAAmBvE,OAAOqE,EAAgBpP,IAG5CkP,EAAsBzG,GADtBwG,EAAgBnM,KAAKyM,MAAM9G,EAAS6G,IACYA,EAChD,IAAK,IAAItP,EAAI,EAAGA,EAAIiP,EAAgBjP,IAClCmP,GAAqBH,EAAY,KAInC,OAFeG,EAAmBD,EAAsB,MAAQzG,EAAS,IAEzD4G,MAAM,KAAKG,KAAK,OAAS,cAY7C5P,OAAO+F,gBAAkBA,QACVA","file":"lazy-line-painter-1.9.2.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"lazy-line-painter\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"lazy-line-painter\"] = factory();\n\telse\n\t\troot[\"lazy-line-painter\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","\nlet Easing = {\n\n easeLinear(n) {\n return n;\n },\n\n easeInQuad(n) {\n return n * n;\n },\n\n easeOutQuad(n) {\n return n * (2 - n);\n },\n\n easeInOutQuad(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n;\n return -0.5 * (--n * (n - 2) - 1);\n },\n\n easeInCubic(n) {\n return n * n * n;\n },\n\n easeOutCubic(n) {\n return --n * n * n + 1;\n },\n\n easeInOutCubic(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n;\n return 0.5 * ((n -= 2) * n * n + 2);\n },\n\n easeInQuart(n) {\n return n * n * n * n;\n },\n\n easeOutQuart(n) {\n return 1 - --n * n * n * n;\n },\n\n easeInOutQuart(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n;\n return -0.5 * ((n -= 2) * n * n * n - 2);\n },\n\n easeInQuint(n) {\n return n * n * n * n * n;\n },\n\n easeOutQuint(n) {\n return --n * n * n * n * n + 1;\n },\n\n easeInOutQuint(n) {\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n * n;\n return 0.5 * ((n -= 2) * n * n * n * n + 2);\n },\n\n easeInSine(n) {\n return 1 - Math.cos(n * Math.PI / 2);\n },\n\n easeOutSine(n) {\n return Math.sin(n * Math.PI / 2);\n },\n\n easeInOutSine(n) {\n return 0.5 * (1 - Math.cos(Math.PI * n));\n },\n\n easeInExpo(n) {\n return n === 0 ? 0 : Math.pow(1024, n - 1);\n },\n\n easeOutExpo(n) {\n return n === 1 ? n : 1 - Math.pow(2, -10 * n);\n },\n\n easeInOutExpo(n) {\n if (n === 0) return 0;\n if (n === 1) return 1;\n if ((n *= 2) < 1) return 0.5 * Math.pow(1024, n - 1);\n return 0.5 * (-Math.pow(2, -10 * (n - 1)) + 2);\n },\n\n easeInCirc(n) {\n return 1 - Math.sqrt(1 - n * n);\n },\n\n easeOutCirc(n) {\n return Math.sqrt(1 - --n * n);\n },\n\n easeInOutCirc(n) {\n n *= 2;\n if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1);\n return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);\n },\n\n easeInBounce(n) {\n return 1 - this.easeOutBounce(1 - n);\n },\n\n easeOutBounce(n) {\n if (n < 1 / 2.75) {\n return 7.5625 * n * n;\n } else if (n < 2 / 2.75) {\n return 7.5625 * (n -= 1.5 / 2.75) * n + 0.75;\n } else if (n < 2.5 / 2.75) {\n return 7.5625 * (n -= 2.25 / 2.75) * n + 0.9375;\n }\n return 7.5625 * (n -= 2.625 / 2.75) * n + 0.984375;\n\n },\n\n easeInOutBounce(n) {\n if (n < 0.5) return this.easeInBounce(n * 2) * 0.5;\n return this.easeOutBounce(n * 2 - 1) * 0.5 + 0.5;\n }\n};\n\nexport default Easing;\n\n","let EventEmitter = {};\n\nEventEmitter.on = function (name, callback) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n this._eventEmitterCallbacks[name] = this._eventEmitterCallbacks[name] || [];\n this._eventEmitterCallbacks[name].push(callback);\n};\nEventEmitter.addListener = EventEmitter.on;\n\nEventEmitter.off = function (name, callback) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n if (!(name in this._eventEmitterCallbacks)) return;\n const i = this._eventEmitterCallbacks[name].indexOf(callback);\n\n if (i < 0) return;\n this._eventEmitterCallbacks[name].splice(i, 1);\n};\nEventEmitter.removeListener = EventEmitter.off;\n\nEventEmitter.emit = function (name, evt) {\n this._eventEmitterCallbacks = this._eventEmitterCallbacks || {};\n if (!(name in this._eventEmitterCallbacks)) return;\n for (let callback of this._eventEmitterCallbacks[name]) {\n if (typeof callback !== 'function') return;\n callback(evt);\n }\n};\nEventEmitter.trigger = EventEmitter.emit;\n\nexport default EventEmitter;\n","/*\n * Lazy Line Painter\n * SVG Stroke animation.\n *\n * https://github.com/camoconnell/lazy-line-painter\n * http://www.camoconnell.com\n *\n * Copyright 2013-2018 Cam O'Connell\n * All rights reserved.\n *\n * Licensed under the MIT license.\n *\n */\n\nimport Events from './events';\nimport Easing from './easing';\n\nclass LazyLinePainter {\n\n /**\n * init\n * Responsible for caching user options,\n * @public\n * @param {object} opts user defined options\n */\n\n constructor(el, config) {\n\n this.el = el;\n this.el.classList.add('lazy-line-painter');\n\n this.config = Object.assign({\n\n strokeWidth: null,\n strokeDash: null,\n strokeColor: null,\n strokeOverColor: null,\n strokeCap: null,\n strokeJoin: null,\n strokeOpacity: null,\n\n delay: 0,\n ease: null,\n drawSequential: false,\n speedMultiplier: 1,\n reverse: false,\n paused: false,\n progress: 0,\n\n longestDuration: 0,\n log: true,\n offset: this.el.getBoundingClientRect()\n\n }, config, {});\n\n Object.assign(this, Events, {});\n\n this.__raf = null;\n this.__paths = [];\n\n this._generatePaths();\n this._parseDataAttrs();\n this._updateDuration();\n this._setupPaths();\n\n document.addEventListener('visibilitychange', this._onVisibilityChange);\n }\n\n _generatePaths() {\n\n let paths;\n let composed = Boolean(this.el.dataset.llpComposed);\n\n if (composed) {\n paths = this.el.querySelectorAll('[data-llp-id]');\n } else {\n paths = this._uncomposed();\n }\n\n for (let i = 0; i < paths.length; i++) {\n\n let path = {\n el: paths[i]\n };\n\n this.__paths.push(path);\n }\n }\n\n _uncomposed() {\n let paths = this.el.querySelectorAll('path, polygon, circle, ellipse, polyline, line, rect');\n let i;\n\n for (i = 0; i < paths.length; i++) {\n let id = this.el.id.replace(/ /g, '');\n\n id = id.replace('.', '');\n id = id.replace('-', '');\n paths[i].dataset.llpId = id + '-' + i;\n\n if (!paths[i].dataset.llpDuration) {\n paths[i].dataset.llpDuration = 5000;\n }\n if (!paths[i].dataset.llpDuration) {\n paths[i].dataset.llpDelay = 0;\n }\n }\n\n if (this.config.log) {\n console.log('This lazy line is uncomposed! Visit http://lazylinepainter.info to compose your masterpiece!');\n }\n\n return paths;\n }\n\n /**\n * paint\n * Responsible for drawing path.\n * @public\n */\n\n paint(config) {\n\n // update playback arguments\n Object.assign(this.config, config);\n this._updateDuration();\n\n this.erase();\n\n // begin animation\n this._paint();\n\n // fire start callback\n this.emit('start');\n }\n\n /**\n * pause\n * Responsible for pausing path animation.\n * @public\n */\n pause() {\n this.config.paused = true;\n cancelAnimationFrame(this.__raf);\n this.emit('pause');\n }\n\n /**\n * resume\n * Responsible for resuming path animation.\n * @public\n */\n resume() {\n if (this.config.paused) {\n requestAnimationFrame(() => {\n this.adjustStartTime();\n });\n this.config.paused = false;\n this.emit('resume');\n }\n }\n\n /**\n * erase\n * Responsible for clearing path,\n * paint can still be called on the element after it has been erased.\n * @public\n */\n erase() {\n\n // reset / cancel rAF\n this.config.startTime = null;\n this.config.elapsedTime = null;\n cancelAnimationFrame(this.__raf);\n\n // reset callback\n this.config.onStrokeCompleteDone = false;\n\n // reset paused\n this.config.paused = false;\n\n // empty contents of svg\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.style.strokeDashoffset = path.length;\n path.onStrokeCompleteDone = false;\n path.onStrokeStartDone = false;\n }\n\n this.emit('erase');\n }\n\n /**\n * destroy\n * Responsible for removing lazyline data and element from DOM\n * @public\n */\n destroy() {\n\n // retrieve / remove data object\n this.config = null;\n\n // empty container element\n this.el.remove();\n this.el = null;\n\n }\n\n /**\n * set\n * @public\n */\n set(prop, value) {\n switch (prop) {\n case 'progress':\n this._setProgress(value);\n break;\n case 'delay':\n this._setDelay(value);\n break;\n case 'reverse':\n this._setReverse(value);\n break;\n case 'ease':\n this._setEase(value);\n break;\n default:\n if (this.config.log) {\n console.log('property ' + prop + ' can not be set');\n }\n }\n }\n\n _setEase(ease) {\n this.config.ease = ease;\n }\n\n _setProgress(progress) {\n this.pause();\n this.config.progress = this._getProgress(progress, this.config.ease);\n this._updatePaths();\n this.config.elapsedTime = this.config.progress * this.config.totalDuration;\n }\n\n _setDelay(delay) {\n this.config.delay = delay;\n this._updateDuration();\n }\n\n _setReverse(reverse) {\n this.config.reverse = reverse;\n this._updateDuration();\n }\n\n _updateDuration() {\n\n let totalDuration = this._getTotalDuration();\n let longestDuration = this._getLongestDuration();\n\n this.config.totalDuration = this.config.drawSequential ? totalDuration : longestDuration;\n this.config.totalDuration += this.config.delay;\n\n this._calcPathDurations();\n }\n\n _calcPathDurations() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n let startTime;\n\n path.progress = 0;\n\n if (this.config.reverse) {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.totalDuration - (path.delay + path.duration);\n }\n } else {\n if (this.config.drawSequential) {\n startTime = 0;\n } else {\n startTime = this.config.delay + path.delay;\n }\n }\n\n path.startTime = startTime;\n path.startProgress = (path.startTime / this.config.totalDuration);\n path.durationProgress = (path.duration / this.config.totalDuration);\n }\n }\n\n /**\n * get\n * @public\n */\n get() {\n return this.config;\n }\n\n /**\n * resize\n * @public\n */\n resize() {\n\n this.config.offset = this.el.getBoundingClientRect();\n // this.config.scale = this.config.offset.width / this.config.width;\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.el.getBoundingClientRect();\n path.positions = this._getPathPoints(path.el, path.length);\n this._updatePosition(path);\n }\n }\n\n _parseDataAttrs() {\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n\n path.id = path.el.dataset.llpId;\n path.delay = Number(path.el.dataset.llpDelay) || 0;\n path.duration = Number(path.el.dataset.llpDuration) || 0;\n path.reverse = Boolean(path.el.dataset.llpReverse) || false;\n path.ease = Number(path.el.dataset.llpEase) || null;\n path.strokeDash = path.el.dataset.llpStrokeDash || null;\n path.delay *= this.config.speedMultiplier;\n path.duration *= this.config.speedMultiplier;\n\n this._setStyleAttrs(path);\n }\n }\n\n _setStyleAttrs(path) {\n\n path.strokeColor = (path.el.dataset.llpStrokeColor || this.config.strokeColor);\n if (path.strokeColor) {\n path.el.style.stroke = path.strokeColor;\n }\n\n path.strokeOpacity = (path.el.dataset.llpStrokeOpacity || this.config.strokeOpacity);\n if (path.strokeOpacity) {\n path.el.style.strokeOpacity = path.strokeOpacity;\n }\n\n path.strokeWidth = (path.el.dataset.llpStrokeWidth || this.config.strokeWidth);\n if (path.strokeWidth) {\n path.el.style.strokeWidth = path.strokeWidth;\n }\n\n path.strokeCap = (path.el.dataset.llpStrokeCap || this.config.strokeCap);\n if (path.strokeCap) {\n path.el.style.strokeLinecap = path.strokeCap;\n }\n\n path.strokeJoin = (path.el.dataset.llpStrokeJoin || this.config.strokeJoin);\n if (path.strokeJoin) {\n path.el.style.strokeLinejoin = path.strokeJoin;\n }\n }\n\n _setupPaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n\n let path = this.__paths[i];\n\n path.index = i;\n path.length = this._getPathLength(path.el);\n path.positions = this._getPathPoints(path.el, path.length);\n\n path.el.style.strokeDasharray = this._getStrokeDashArray(path, path.length);\n path.el.style.strokeDashoffset = path.length;\n\n path.onStrokeStartDone = false;\n path.onStrokeCompleteDone = false;\n }\n };\n\n /**\n * adjustStartTime\n * Responsible for managing time.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n adjustStartTime() {\n let timestamp = performance.now();\n\n this.config.startTime = timestamp - this.config.elapsedTime;\n requestAnimationFrame(() => {\n this._paint();\n });\n }\n\n /**\n * _paint\n * Responsible for animating paths.\n * Path incrementation is performed using requestAnimationFrame.\n * @private\n * @param {number} timestamp identifies current time\n * @param {object} data contains options set on init() and paint()\n */\n _paint() {\n\n if (!this.config) {\n return;\n }\n\n // set startTime\n if (!this.config.startTime) {\n this.config.startTime = performance.now(); // new Date()\n }\n\n this.emit('update');\n\n // set elapsedTime\n let timestamp = performance.now();\n\n this.config.elapsedTime = (timestamp - this.config.startTime);\n this.config.linearProgress = (this.config.elapsedTime / this.config.totalDuration);\n\n this.config.progress = this._getProgress(this.config.linearProgress, this.config.ease);\n // console.log(this.config.elapsedTime, ' ', this.config.totalDuration);\n\n this._updatePaths();\n\n if (this.config.linearProgress >= 0 && this.config.linearProgress <= 1) {\n this.__raf = requestAnimationFrame(() => {\n this._paint();\n });\n } else {\n this.emit('complete');\n }\n }\n\n _updatePaths() {\n\n for (let i = 0; i < this.__paths.length; i++) {\n let path = this.__paths[i];\n let pathProgress = this._getElapsedProgress(path);\n\n path.progress = this._getProgress(pathProgress, path.ease);\n this._setLine(path);\n this._updatePosition(path);\n this._updateStrokeCallbacks(path);\n }\n }\n\n _getElapsedProgress(path) {\n\n let elapsedProgress;\n\n if (\n this.config.progress >= path.startProgress &&\n this.config.progress <= (path.startProgress + path.durationProgress)\n ) {\n elapsedProgress = (this.config.progress - path.startProgress) / path.durationProgress;\n } else if (this.config.progress >= (path.startProgress + path.durationProgress)) {\n elapsedProgress = 1;\n } else if (this.config.progress <= path.startProgress) {\n elapsedProgress = 0;\n }\n\n return elapsedProgress;\n }\n\n _getProgress(linearProgress, ease) {\n\n let progress = linearProgress;\n\n if (ease) {\n progress = Easing[ease](linearProgress);\n }\n return progress;\n }\n\n _setLine(path) {\n\n let el = path.el;\n let length = path.progress * path.length;\n\n if (path.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else if (this.config.reverse) {\n el.style.strokeDashoffset = -path.length + length;\n } else {\n el.style.strokeDashoffset = (path.length - length) + 0.1;\n }\n }\n\n _updateStrokeCallbacks(path) {\n\n if (path.progress === 1) {\n\n if (!path.onStrokeCompleteDone) {\n path.onStrokeCompleteDone = true;\n\n this.emit('complete:' + path.id, path);\n this.emit('complete:all', path);\n }\n\n } else if (path.progress > 0.00001) {\n\n if (!path.onStrokeStartDone) {\n this.emit('start:' + path.id, path);\n this.emit('start:all', path);\n path.onStrokeStartDone = true;\n }\n\n this.emit('update:' + path.id, path);\n this.emit('update:all', path);\n }\n }\n\n /**\n * _updatePosition\n * Responsible for updating the paths x / y position.\n * @private\n */\n _updatePosition(path) {\n let index = Math.round((path.progress * (path.length - 1)));\n let position = path.positions[index];\n\n if (position) {\n path.position = {\n x: this.config.offset.left + position.x,\n y: this.config.offset.top + position.y\n };\n }\n\n }\n\n _getTotalDuration() {\n\n let totalDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathDelay = paths[i].delay || 0;\n\n totalDuration += (paths[i].duration + pathDelay);\n }\n\n return totalDuration;\n }\n\n _getLongestDuration() {\n\n let longestDuration = 0;\n let paths = this.__paths;\n\n for (let i = 0; i < paths.length; i++) {\n let pathTotalDuration = paths[i].delay + paths[i].duration;\n\n if (pathTotalDuration > longestDuration) {\n longestDuration = pathTotalDuration;\n }\n }\n\n return longestDuration;\n };\n\n /**\n * _getPathLength\n * Responsible for returning a svg path length.\n * @return {number} path length\n */\n _getPathLength(el) {\n return Math.ceil(this._getTotalLength(el)); // Math.ceil(el.getTotalLength());\n }\n\n _getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n }\n\n _getCircleLength(el) {\n return Math.PI * 2 * el.getAttribute('r');\n }\n\n _getEllipseLength(el) {\n let rx = parseInt(el.getAttribute('rx'), 1);\n let ry = parseInt(el.getAttribute('ry'), 1);\n let h = Math.pow((rx - ry), 2) / Math.pow((rx + ry), 2);\n let totalLength = (Math.PI * (rx + ry)) * (1 + ((3 * h) / (Math.sqrt(4 - (3 * h)))));\n\n return totalLength;\n }\n\n _getRectLength(el) {\n return (el.getAttribute('width') * 2) + (el.getAttribute('height') * 2);\n }\n\n _getLineLength(el) {\n return this._getDistance(\n {\n x: el.getAttribute('x1'),\n y: el.getAttribute('y1')\n },\n {\n x: el.getAttribute('x2'),\n y: el.getAttribute('y2')\n }\n );\n }\n\n _getPolylineLength(el) {\n const points = el.points;\n let totalLength = 0;\n let previousPos;\n\n for (let i = 0 ; i < points.numberOfItems; i++) {\n const currentPos = points.getItem(i);\n\n if (i > 0) {\n totalLength += this._getDistance(previousPos, currentPos);\n }\n previousPos = currentPos;\n }\n return totalLength;\n }\n\n _getPolygonLength(el) {\n const points = el.points;\n\n return this._getPolylineLength(el) + this._getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n }\n\n _getTotalLength(el) {\n\n let length = el.getTotalLength();\n\n if (!el.getTotalLength || length === 0) {\n let tagName = el.tagName.toLowerCase();\n\n switch (tagName) {\n case 'circle':\n length = this._getCircleLength(el);\n break;\n case 'ellipse':\n length = this._getEllipseLength(el);\n break;\n case 'rect':\n length = this._getRectLength(el);\n break;\n case 'line':\n length = this._getLineLength(el);\n break;\n case 'polyline':\n length = this._getPolylineLength(el);\n break;\n case 'polygon':\n length = this._getPolygonLength(el);\n break;\n }\n }\n return length;\n }\n\n /**\n * _getPathPoints\n * Responsible for returning a svg path coords.\n * @return {array} path coords\n */\n _getPathPoints(el, length) {\n\n let arr = [];\n\n for (let i = 0; i < length; i++) {\n let position = el.getPointAtLength(i);\n\n arr.push({\n x: position.x,\n y: position.y\n });\n };\n return arr;\n }\n\n /**\n * _getStrokeDashArray\n * @private\n */\n _getStrokeDashArray(path, length) {\n let strokeDash;\n\n if (path.strokeDash) {\n strokeDash = this._getStrokeDashString(path.strokeDash, length);\n } else if (this.config.strokeDash) {\n strokeDash = this._getStrokeDashString(this.config.strokeDash, length);\n } else {\n strokeDash = length + ' ' + length;\n };\n return strokeDash;\n }\n\n /**\n * _getStrokeDashString\n * @private\n */\n _getStrokeDashString(dashArray, length) {\n let strokeDashString = '';\n let strokeDashArray = dashArray.split(',');\n\n let strokeDashTotal = 0;\n let strokeDashNum;\n let strokeDashRemainder;\n\n for (let i = strokeDashArray.length - 1; i >= 0; i--) {\n strokeDashTotal += Number(strokeDashArray[i]);\n };\n strokeDashNum = Math.floor(length / strokeDashTotal);\n strokeDashRemainder = length - (strokeDashNum * strokeDashTotal);\n for (let i = 0; i < strokeDashNum ; i++) {\n strokeDashString += (dashArray + ', ');\n };\n let preArray = strokeDashString + strokeDashRemainder + ', ' + (length + 2);\n\n return preArray.split(',').join('px,') + 'px';\n }\n\n _onVisibilityChange = () => {\n if (document.hidden) {\n this.pause();\n } else {\n this.resume();\n }\n }\n\n}\nwindow.LazyLinePainter = LazyLinePainter;\nexport default LazyLinePainter;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b1967a0..22773fd 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lazy-line-painter", - "version": "1.7.0", + "version": "1.9.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1626,6 +1626,232 @@ } } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.2.3.tgz", + "integrity": "sha512-xO/3Gn+2C7/eOUeb0VRnSP1+yvWHNxlpAot1eMhtoKDCN7POsyQP5excuT5UsV5daHxMWBeIIOeI5cmB8vMRgQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.2.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.2.2.tgz", + "integrity": "sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg==", + "dev": true, + "requires": { + "@babel/types": "^7.2.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz", + "integrity": "sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", + "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + }, + "@babel/helper-replace-supers": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.2.3.tgz", + "integrity": "sha512-GyieIznGUfPXPWu0yLS6U55Mz67AZD9cUk0BfirOWlPrXlBcan9Gz+vHGz+cPfuoweZSnPzPIm67VtQM0OWZbA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/traverse": "^7.2.3", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", + "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.3.tgz", + "integrity": "sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA==", + "dev": true + }, + "@babel/template": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", + "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.2.2", + "@babel/types": "^7.2.2" + } + }, + "@babel/traverse": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", + "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.2.2", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.2.3", + "@babel/types": "^7.2.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + } + }, + "@babel/types": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.2.2.tgz", + "integrity": "sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "globals": { + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", + "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "@babel/helper-define-map": { "version": "7.0.0-beta.51", "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.51.tgz", @@ -2930,6 +3156,24 @@ "@babel/plugin-syntax-async-generators": "7.0.0-beta.51" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.2.3.tgz", + "integrity": "sha512-FVuQngLoN2iDrpW7LmhPZ2sO4DJxf35FOcwidwB9Ru9tMvI5URthnkVHuG14IStV+TzkMTyLMoOUlSTtrdVwqw==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.2.3", + "@babel/helper-plugin-utils": "^7.0.0" + }, + "dependencies": { + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + } + } + }, "@babel/plugin-proposal-object-rest-spread": { "version": "7.0.0-beta.51", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.51.tgz", @@ -7303,11 +7547,6 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "jquery": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", - "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==" - }, "js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.3.tgz", diff --git a/package.json b/package.json index 5001987..2626955 100644 --- a/package.json +++ b/package.json @@ -16,15 +16,16 @@ "keywords": [ "svg", "animation", - "line", + "line", "path", "javascript", "js", "css" - ], + ], "devDependencies": { "@babel/cli": "^7.0.0-beta.51", "@babel/core": "^7.0.0-beta.51", + "@babel/plugin-proposal-class-properties": "^7.2.3", "@babel/preset-env": "^7.0.0-beta.51", "babel-eslint": "^8.0.3", "babel-loader": "^8.0.0-beta.4", diff --git a/src/index.js b/src/index.js index 9927289..c381be5 100644 --- a/src/index.js +++ b/src/index.js @@ -63,6 +63,7 @@ class LazyLinePainter { this._updateDuration(); this._setupPaths(); + document.addEventListener('visibilitychange', this._onVisibilityChange); } _generatePaths() { @@ -723,6 +724,14 @@ class LazyLinePainter { return preArray.split(',').join('px,') + 'px'; } + _onVisibilityChange = () => { + if (document.hidden) { + this.pause(); + } else { + this.resume(); + } + } + } window.LazyLinePainter = LazyLinePainter; export default LazyLinePainter;