diff --git a/dist/mouse-follower.js b/dist/mouse-follower.js
index 18f94d2..7c914ed 100644
--- a/dist/mouse-follower.js
+++ b/dist/mouse-follower.js
@@ -2,7 +2,7 @@
/*!
* Cuberto Mouse Follower
*
- * @version 1.0.1
+ * @version 1.0.3
* @author Cuberto | Artem Dordzhiev (Draft)
*/
var i=function(){function t(e){this.gsap=t.gsap,this.options=Object.assign({},{el:null,container:document.body,className:"mf-cursor",innerClassName:"mf-cursor-inner",textClassName:"mf-cursor-text",mediaClassName:"mf-cursor-media",mediaBoxClassName:"mf-cursor-media-box",iconSvgClassName:"mf-svgsprite",iconSvgNamePrefix:"-",iconSvgSrc:"",dataAttr:"cursor",hiddenState:"-hidden",textState:"-text",iconState:"-icon",activeState:"-active",mediaState:"-media",stateDetection:{"-pointer":"a,button","-hidden":"iframe"},visible:!0,speed:.55,ease:"expo.out",overwrite:!0,skewing:0,skewingText:2,skewingIcon:2,skewingMedia:2,skewingDelta:.001,skewingDeltaMax:.15,stickDelta:.15,showTimeout:20,hideOnLeave:!0,hideTimeout:300,hideMediaTimeout:300,initialPos:[-window.innerWidth,-window.innerHeight]},e),this.el="string"==typeof this.options.el?document.querySelector(this.options.el):this.options.el,this.container="string"==typeof this.options.container?document.querySelector(this.options.container):this.options.container,this.skewing=this.options.skewing,this.pos={x:this.options.initialPos[0],y:this.options.initialPos[1]},this.vel={x:0,y:0},this.event={},this.init()}t.registerGSAP=function(e){t.gsap=e};var e=t.prototype;return e.init=function(){this.el||this.create(),this.createSetter(),this.bind(),this.render(!0),this.ticker=this.render.bind(this,!1),this.gsap.ticker.add(this.ticker)},e.create=function(){this.el=document.createElement("div"),this.el.className=this.options.className,this.el.classList.add(this.options.hiddenState),this.inner=document.createElement("div"),this.inner.className=this.options.innerClassName,this.text=document.createElement("div"),this.text.className=this.options.textClassName,this.media=document.createElement("div"),this.media.className=this.options.mediaClassName,this.mediaBox=document.createElement("div"),this.mediaBox.className=this.options.mediaBoxClassName,this.media.appendChild(this.mediaBox),this.inner.appendChild(this.media),this.inner.appendChild(this.text),this.el.appendChild(this.inner),this.container.appendChild(this.el)},e.createSetter=function(){this.setter={x:this.gsap.quickSetter(this.el,"x","px"),y:this.gsap.quickSetter(this.el,"y","px"),rotation:this.gsap.quickSetter(this.el,"rotation","deg"),scaleX:this.gsap.quickSetter(this.el,"scaleX"),scaleY:this.gsap.quickSetter(this.el,"scaleY"),wc:this.gsap.quickSetter(this.el,"willChange"),inner:{rotation:this.gsap.quickSetter(this.inner,"rotation","deg")}}},e.bind=function(){var t=this;this.event.mouseleave=function(){return t.hide()},this.event.mouseenter=function(){return t.show()},this.event.mousedown=function(){return t.addState(t.options.activeState)},this.event.mouseup=function(){return t.removeState(t.options.activeState)},this.event.mousemoveOnce=function(){return t.show()},this.event.mousemove=function(e){t.gsap.to(t.pos,{x:t.stick?t.stick.x-(t.stick.x-e.clientX)*t.options.stickDelta:e.clientX,y:t.stick?t.stick.y-(t.stick.y-e.clientY)*t.options.stickDelta:e.clientY,overwrite:t.options.overwrite,ease:t.options.ease,duration:t.visible?t.options.speed:0,onUpdate:function(){return t.vel={x:e.clientX-t.pos.x,y:e.clientY-t.pos.y}}})},this.event.mouseover=function(e){for(var i=e.target;i&&i!==t.container&&(!e.relatedTarget||!i.contains(e.relatedTarget));i=i.parentNode){for(var s in t.options.stateDetection)i.matches(t.options.stateDetection[s])&&t.addState(s);if(t.options.dataAttr){var o=t.getFromDataset(i);o.state&&t.addState(o.state),o.text&&t.setText(o.text),o.icon&&t.setIcon(o.icon),o.img&&t.setImg(o.img),o.video&&t.setVideo(o.video),void 0!==o.show&&t.show(),void 0!==o.stick&&t.setStick(o.stick||i)}}},this.event.mouseout=function(e){for(var i=e.target;i&&i!==t.container&&(!e.relatedTarget||!i.contains(e.relatedTarget));i=i.parentNode){for(var s in t.options.stateDetection)i.matches(t.options.stateDetection[s])&&t.removeState(s);if(t.options.dataAttr){var o=t.getFromDataset(i);o.state&&t.removeState(o.state),o.text&&t.removeText(),o.icon&&t.removeIcon(),o.img&&t.removeImg(),o.video&&t.removeVideo(),void 0!==o.show&&t.hide(),void 0!==o.stick&&t.removeStick()}}},this.options.hideOnLeave&&this.container.addEventListener("mouseleave",this.event.mouseleave,{passive:!0}),this.options.visible&&this.container.addEventListener("mouseenter",this.event.mouseenter,{passive:!0}),this.container.addEventListener("mousedown",this.event.mousedown,{passive:!0}),this.container.addEventListener("mouseup",this.event.mouseup,{passive:!0}),this.container.addEventListener("mousemove",this.event.mousemove,{passive:!0}),this.options.visible&&this.container.addEventListener("mousemove",this.event.mousemoveOnce,{passive:!0,once:!0}),(this.options.stateDetection||this.options.dataAttr)&&(this.container.addEventListener("mouseover",this.event.mouseover,{passive:!0}),this.container.addEventListener("mouseout",this.event.mouseout,{passive:!0}))},e.render=function(t){if(!0===t||0!==this.vel.y&&0!==this.vel.x){if(this.setter.wc("transform"),this.setter.x(this.pos.x),this.setter.y(this.pos.y),this.skewing){var e=Math.sqrt(Math.pow(this.vel.x,2)+Math.pow(this.vel.y,2)),i=Math.min(e*this.options.skewingDelta,this.options.skewingDeltaMax)*this.skewing,s=180*Math.atan2(this.vel.y,this.vel.x)/Math.PI;this.setter.rotation(s),this.setter.scaleX(1+i),this.setter.scaleY(1-i),this.setter.inner.rotation(-s)}}else this.setter.wc("auto")},e.show=function(){var t=this;clearInterval(this.visibleInt),this.el.classList.remove(this.options.hiddenState),this.visibleInt=setTimeout((function(){return t.visible=!0}),this.options.showTimeout)},e.hide=function(){var t=this;clearInterval(this.visibleInt),this.el.classList.add(this.options.hiddenState),this.visibleInt=setTimeout((function(){return t.visible=!1}),this.options.hideTimeout)},e.toggle=function(t){void 0===t&&(t=!1),!this.visible||t?this.show():this.hide()},e.addState=function(t){var e;if(t===this.options.hiddenState)return this.hide();(e=this.el.classList).add.apply(e,t.split(" "))},e.removeState=function(t){var e;if(t===this.options.hiddenState)return this.show();(e=this.el.classList).remove.apply(e,t.split(" "))},e.toggleState=function(t,e){this.el.classList.toggle(""+t,e)},e.setSkewing=function(t){this.gsap.to(this,{skewing:t})},e.removeSkewing=function(){this.gsap.to(this,{skewing:this.options.skewing})},e.setStick=function(t){var e=("string"==typeof t?document.querySelector(t):t).getBoundingClientRect();this.stick={y:e.top+e.height/2,x:e.left+e.height/2}},e.removeStick=function(){this.stick=!1},e.setText=function(t){this.text.innerHTML=t,this.addState(this.options.textState),this.setSkewing(this.options.skewingText)},e.removeText=function(){this.removeState(this.options.textState),this.removeSkewing()},e.setIcon=function(t,e){void 0===e&&(e=""),this.text.innerHTML='',this.addState(this.options.iconState),this.setSkewing(this.options.skewingIcon)},e.removeIcon=function(){this.removeState(this.options.iconState),this.removeSkewing()},e.setMedia=function(t){var e=this;clearTimeout(this.mediaInt),t&&(this.mediaBox.innerHTML="",this.mediaBox.appendChild(t)),this.mediaInt=setTimeout((function(){return e.addState(e.options.mediaState)}),20),this.setSkewing(this.options.skewingMedia)},e.removeMedia=function(){var t=this;clearTimeout(this.mediaInt),this.removeState(this.options.mediaState),this.mediaInt=setTimeout((function(){return t.mediaBox.innerHTML=""}),this.options.hideMediaTimeout),this.removeSkewing()},e.setImg=function(t){this.mediaImg||(this.mediaImg=new Image),this.mediaImg.src!==t&&(this.mediaImg.src=t),this.setMedia(this.mediaImg)},e.removeImg=function(){this.removeMedia()},e.setVideo=function(t){this.mediaVideo||(this.mediaVideo=document.createElement("video"),this.mediaVideo.muted=!0,this.mediaVideo.loop=!0,this.mediaVideo.autoplay=!0),this.mediaVideo.src!==t&&(this.mediaVideo.src=t,this.mediaVideo.load()),this.mediaVideo.play(),this.setMedia(this.mediaVideo)},e.removeVideo=function(){this.mediaVideo&&this.mediaVideo.readyState>2&&this.mediaVideo.pause(),this.removeMedia()},e.getFromDataset=function(t){var e=t.dataset;return{state:e[this.options.dataAttr],show:e[this.options.dataAttr+"Show"],text:e[this.options.dataAttr+"Text"],icon:e[this.options.dataAttr+"Icon"],img:e[this.options.dataAttr+"Img"],video:e[this.options.dataAttr+"Video"],stick:e[this.options.dataAttr+"Stick"]}},e.destroy=function(){this.gsap.ticker.remove(this.ticker),this.container.removeEventListener("mouseleave",this.event.mouseleave),this.container.removeEventListener("mouseenter",this.event.mouseenter),this.container.removeEventListener("mousedown",this.event.mousedown),this.container.removeEventListener("mouseup",this.event.mouseup),this.container.removeEventListener("mousemove",this.event.mousemove),this.container.removeEventListener("mousemove",this.event.mousemoveOnce),this.container.removeEventListener("mouseover",this.event.mouseover),this.container.removeEventListener("mouseout",this.event.mouseout),this.el&&(this.container.removeChild(this.el),this.el=null,this.mediaImg=null,this.mediaVideo=null)},t}();return e=e.default}()}));
diff --git a/dist/mouse-follower.js.map b/dist/mouse-follower.js.map
index 7dfcc16..688dd74 100644
--- a/dist/mouse-follower.js.map
+++ b/dist/mouse-follower.js.map
@@ -1 +1 @@
-{"version":3,"file":"mouse-follower.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,IAR1B,CASGK,MAAM,WACT,O,wBCTA,IAAIC,EAAsB,CCA1BA,EAAwB,SAASL,EAASM,GACzC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EF,EAAwB,SAASQ,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,K;;;;;;;ACK5F,IAEkBI,EAAAA,WA8CjB,WAAYC,GACRf,KAAKgB,KAAOF,EAAcE,KAC1BhB,KAAKe,QAAUV,OAAOY,OAAO,GAAI,CAC7BC,GAAI,KACJC,UAAWC,SAASC,KACpBC,UAAW,YACXC,eAAgB,kBAChBC,cAAe,iBACfC,eAAgB,kBAChBC,k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C3D3F,KAAKmB,UAAU0J,oBAAoB,YAAa7K,KAAK6D,MAAMuC,WAC3DpG,KAAKmB,UAAU0J,oBAAoB,WAAY7K,KAAK6D,MAAMwD,UACtDrH,KAAKkB,KACLlB,KAAKmB,UAAU2J,YAAY9K,KAAKkB,IAChClB,KAAKkB,GAAK,KACVlB,KAAKgK,SAAW,KAChBhK,KAAKmK,WAAa,OAEzB,EA/fgBrJ,G","sources":["webpack://MouseFollower/webpack/universalModuleDefinition","webpack://MouseFollower/webpack/bootstrap","webpack://MouseFollower/webpack/runtime/define property getters","webpack://MouseFollower/webpack/runtime/hasOwnProperty shorthand","webpack://MouseFollower/./src/index.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([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MouseFollower\"] = factory();\n\telse\n\t\troot[\"MouseFollower\"] = factory();\n})(this, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/*!\n * Cuberto Mouse Follower\n *\n * @version 1.0.1\n * @author Cuberto | Artem Dordzhiev (Draft)\n */\n\nexport default class MouseFollower {\n /**\n * Register GSAP animation library.\n *\n * @param {GSAP} gsap GSAP library.\n */\n static registerGSAP(gsap) {\n MouseFollower.gsap = gsap;\n }\n\n /**\n * Create cursor instance.\n *\n * @param {object} [options] Cursor options.\n * @param {HTMLElement|null} options.el Existed cursor element.\n * @param {HTMLElement|null} options.container Cursor container.\n * @param {string} options.className Cursor root element class name.\n * @param {string} options.innerClassName Inner element class name.\n * @param {string} options.mediaClassName Media element class name.\n * @param {string} options.mediaBoxClassName Media inner element class name.\n * @param {string} options.iconSvgClassName SVG sprite class name.\n * @param {string} options.iconSvgNamePrefix SVG sprite icon class name prefix.\n * @param {string} options.iconSvgSrc SVG sprite source.\n * @param {string|null} options.dataAttr Name of data attribute for changing cursor state directly in HTML.\n * @param {string} options.hiddenState Hidden state name.\n * @param {string} options.textState Text state name.\n * @param {string} options.iconState Icon state name.\n * @param {string} options.activeState Active (mousedown) state name.\n * @param {string} options.mediaState Media (image/video) state name.\n * @param {string} options.visible Is cursor visible by default.\n * @param {object} options.stateDetection State detection rules.\n * @param {number} options.speed Cursor movement speed.\n * @param {string} options.ease Timing function of cursor movement.\n * @param {boolean} options.overwrite Overwrite or remain cursor position when `mousemove` event happens.\n * @param {number} options.skewing Default skewing factor.\n * @param {number} options.skewingText Skewing effect factor in a text state.\n * @param {number} options.skewingIcon Skewing effect factor in a icon state.\n * @param {number} options.skewingMedia Skewing effect factor in a media (image/video) state.\n * @param {number} options.skewingDelta Skewing effect base delta.\n * @param {number} options.skewingDeltaMax Skew effect max delta.\n * @param {number} options.stickDelta Stick effect delta.\n * @param {number} options.showTimeout Delay before show.\n * @param {boolean} options.hideOnLeave Hide the cursor when mouse leave container.\n * @param {number} options.hideTimeout Delay before hiding. It should be equal to the CSS hide animation time.\n * @param {array} options.initialPos Array (X, Y) of initial cursor position.\n */\n constructor(options) {\n this.gsap = MouseFollower.gsap;\n this.options = Object.assign({}, {\n el: null,\n container: document.body,\n className: \"mf-cursor\",\n innerClassName: \"mf-cursor-inner\",\n textClassName: \"mf-cursor-text\",\n mediaClassName: \"mf-cursor-media\",\n mediaBoxClassName: \"mf-cursor-media-box\",\n iconSvgClassName: \"mf-svgsprite\",\n iconSvgNamePrefix: \"-\",\n iconSvgSrc: \"\",\n dataAttr: \"cursor\",\n hiddenState: \"-hidden\",\n textState: \"-text\",\n iconState: \"-icon\",\n activeState: \"-active\",\n mediaState: \"-media\",\n stateDetection: {\n \"-pointer\": \"a,button\",\n \"-hidden\": \"iframe\"\n },\n visible: true,\n speed: 0.55,\n ease: \"expo.out\",\n overwrite: true,\n skewing: 0,\n skewingText: 2,\n skewingIcon: 2,\n skewingMedia: 2,\n skewingDelta: 0.001,\n skewingDeltaMax: 0.15,\n stickDelta: 0.15,\n showTimeout: 20,\n hideOnLeave: true,\n hideTimeout: 300,\n hideMediaTimeout: 300,\n initialPos: [-window.innerWidth, -window.innerHeight],\n }, options);\n\n this.el = typeof (this.options.el) === \"string\" ?\n document.querySelector(this.options.el) : this.options.el;\n this.container = typeof (this.options.container) === \"string\" ?\n document.querySelector(this.options.container) : this.options.container;\n this.skewing = this.options.skewing;\n this.pos = {x: this.options.initialPos[0], y: this.options.initialPos[1]};\n this.vel = {x: 0, y: 0};\n this.event = {};\n\n this.init();\n }\n\n /**\n * Init cursor.\n */\n init() {\n if (!this.el) this.create();\n this.createSetter();\n this.bind();\n this.render(true);\n this.ticker = this.render.bind(this, false);\n this.gsap.ticker.add(this.ticker);\n }\n\n /**\n * Create cursor DOM element and append to container.\n */\n create() {\n this.el = document.createElement('div');\n this.el.className = this.options.className;\n this.el.classList.add(this.options.hiddenState);\n\n this.inner = document.createElement('div');\n this.inner.className = this.options.innerClassName;\n\n this.text = document.createElement('div');\n this.text.className = this.options.textClassName;\n\n this.media = document.createElement('div');\n this.media.className = this.options.mediaClassName;\n\n this.mediaBox = document.createElement('div');\n this.mediaBox.className = this.options.mediaBoxClassName;\n\n this.media.appendChild(this.mediaBox);\n this.inner.appendChild(this.media);\n this.inner.appendChild(this.text);\n this.el.appendChild(this.inner);\n this.container.appendChild(this.el);\n }\n\n /**\n * Create GSAP setters.\n */\n createSetter() {\n this.setter = {\n x: this.gsap.quickSetter(this.el, \"x\", \"px\"),\n y: this.gsap.quickSetter(this.el, \"y\", \"px\"),\n rotation: this.gsap.quickSetter(this.el, \"rotation\", \"deg\"),\n scaleX: this.gsap.quickSetter(this.el, \"scaleX\"),\n scaleY: this.gsap.quickSetter(this.el, \"scaleY\"),\n wc: this.gsap.quickSetter(this.el, \"willChange\"),\n inner: {\n rotation: this.gsap.quickSetter(this.inner, \"rotation\", \"deg\")\n }\n };\n }\n\n /**\n * Create and attach events.\n */\n bind() {\n this.event.mouseleave = () => this.hide();\n this.event.mouseenter = () => this.show();\n this.event.mousedown = () => this.addState(this.options.activeState);\n this.event.mouseup = () => this.removeState(this.options.activeState);\n this.event.mousemoveOnce = () => this.show();\n this.event.mousemove = (e) => {\n this.gsap.to(this.pos, {\n x: this.stick ? this.stick.x - ((this.stick.x - e.clientX) * this.options.stickDelta) : e.clientX,\n y: this.stick ? this.stick.y - ((this.stick.y - e.clientY) * this.options.stickDelta) : e.clientY,\n overwrite: this.options.overwrite,\n ease: this.options.ease,\n duration: this.visible ? this.options.speed : 0,\n onUpdate: () => this.vel = {x: e.clientX - this.pos.x, y: e.clientY - this.pos.y}\n });\n };\n this.event.mouseover = (e) => {\n for (let target = e.target; target && target !== this.container; target = target.parentNode) {\n if (e.relatedTarget && target.contains(e.relatedTarget)) break;\n\n for (let state in this.options.stateDetection) {\n if (target.matches(this.options.stateDetection[state])) this.addState(state);\n }\n\n if (this.options.dataAttr) {\n const params = this.getFromDataset(target);\n if (params.state) this.addState(params.state);\n if (params.text) this.setText(params.text);\n if (params.icon) this.setIcon(params.icon);\n if (params.img) this.setImg(params.img);\n if (params.video) this.setVideo(params.video);\n if (typeof (params.show) !== \"undefined\") this.show();\n if (typeof (params.stick) !== \"undefined\") this.setStick(params.stick || target);\n }\n }\n };\n this.event.mouseout = (e) => {\n for (let target = e.target; target && target !== this.container; target = target.parentNode) {\n if (e.relatedTarget && target.contains(e.relatedTarget)) break;\n\n for (let state in this.options.stateDetection) {\n if (target.matches(this.options.stateDetection[state])) this.removeState(state);\n }\n\n if (this.options.dataAttr) {\n const params = this.getFromDataset(target);\n if (params.state) this.removeState(params.state);\n if (params.text) this.removeText();\n if (params.icon) this.removeIcon();\n if (params.img) this.removeImg();\n if (params.video) this.removeVideo();\n if (typeof (params.show) !== \"undefined\") this.hide();\n if (typeof (params.stick) !== \"undefined\") this.removeStick();\n }\n }\n };\n\n if (this.options.hideOnLeave) {\n this.container.addEventListener('mouseleave', this.event.mouseleave, {passive: true});\n }\n if (this.options.visible) {\n this.container.addEventListener('mouseenter', this.event.mouseenter, {passive: true});\n }\n this.container.addEventListener('mousedown', this.event.mousedown, {passive: true});\n this.container.addEventListener('mouseup', this.event.mouseup, {passive: true});\n this.container.addEventListener('mousemove', this.event.mousemove, {passive: true});\n if (this.options.visible) {\n this.container.addEventListener('mousemove', this.event.mousemoveOnce, {\n passive: true,\n once: true\n });\n }\n if (this.options.stateDetection || this.options.dataAttr) {\n this.container.addEventListener('mouseover', this.event.mouseover, {passive: true});\n this.container.addEventListener('mouseout', this.event.mouseout, {passive: true});\n }\n }\n\n /**\n * Render the cursor in a new position.\n *\n * @param {boolean} [force=false] Force render.\n */\n render(force) {\n if (force !== true && (this.vel.y === 0 || this.vel.x === 0)) {\n this.setter.wc('auto');\n return;\n }\n\n this.setter.wc('transform');\n this.setter.x(this.pos.x);\n this.setter.y(this.pos.y);\n\n if (this.skewing) {\n const distance = Math.sqrt(Math.pow(this.vel.x, 2) + Math.pow(this.vel.y, 2));\n const scale = Math.min(distance * this.options.skewingDelta,\n this.options.skewingDeltaMax) * this.skewing;\n const angle = Math.atan2(this.vel.y, this.vel.x) * 180 / Math.PI;\n\n this.setter.rotation(angle);\n this.setter.scaleX(1 + scale);\n this.setter.scaleY(1 - scale);\n this.setter.inner.rotation(-angle);\n }\n }\n\n /**\n * Show cursor.\n */\n show() {\n clearInterval(this.visibleInt);\n this.el.classList.remove(this.options.hiddenState);\n this.visibleInt = setTimeout(() => this.visible = true, this.options.showTimeout);\n }\n\n /**\n * Hide cursor.\n */\n hide() {\n clearInterval(this.visibleInt);\n this.el.classList.add(this.options.hiddenState);\n this.visibleInt = setTimeout(() => this.visible = false, this.options.hideTimeout);\n }\n\n /**\n * Toggle cursor.\n *\n * @param {boolean} [force=false] Force state.\n */\n toggle(force = false) {\n if (!this.visible || force) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Add state/states to the cursor.\n *\n * @param {string} state State name.\n */\n addState(state) {\n if (state === this.options.hiddenState) return this.hide();\n this.el.classList.add(...state.split(\" \"))\n }\n\n /**\n * Remove state/states from cursor.\n *\n * @param {string} state State name.\n */\n removeState(state) {\n if (state === this.options.hiddenState) return this.show();\n this.el.classList.remove(...state.split(\" \"))\n }\n\n /**\n * Toggle cursor state.\n *\n * @param {string} state State name.\n * @param {boolean} force Force state.\n */\n toggleState(state, force) {\n this.el.classList.toggle(`${state}`, force)\n }\n\n /**\n * Set factor of skewing effect.\n *\n * @param {number} value Skewing factor.\n */\n setSkewing(value) {\n this.gsap.to(this, {skewing: value});\n }\n\n /**\n * Reverts skewing factor to default.\n */\n removeSkewing() {\n this.gsap.to(this, {skewing: this.options.skewing});\n }\n\n /**\n * Stick cursor to the element.\n *\n * @param {string|HTMLElement} element Element or selector.\n */\n setStick(element) {\n const el = typeof (element) === \"string\" ? document.querySelector(element) : element\n const rect = el.getBoundingClientRect();\n this.stick = {\n y: rect.top + (rect.height / 2),\n x: rect.left + (rect.height / 2)\n };\n }\n\n /**\n * Unstick cursor from the element.\n */\n removeStick() {\n this.stick = false;\n }\n\n /**\n * Transform cursor to text mode with a given string.\n *\n * @param {string} text Text.\n */\n setText(text) {\n this.text.innerHTML = text;\n this.addState(this.options.textState);\n this.setSkewing(this.options.skewingText);\n }\n\n /**\n * Reverts cursor from text mode.\n */\n removeText() {\n this.removeState(this.options.textState);\n this.removeSkewing();\n }\n\n /**\n * Transform cursor to svg icon mode.\n *\n * @param {string} name Icon identifier.\n * @param {string} [style=\"\"] Additional SVG styles.\n */\n setIcon(name, style = '') {\n this.text.innerHTML = ``;\n this.addState(this.options.iconState);\n this.setSkewing(this.options.skewingIcon);\n }\n\n /**\n * Reverts cursor from icon mode.\n */\n removeIcon() {\n this.removeState(this.options.iconState);\n this.removeSkewing();\n }\n\n /**\n * Transform cursor to media mode with a given element.\n *\n * @param {HTMLElement} element Element.\n */\n setMedia(element) {\n clearTimeout(this.mediaInt);\n if (element) {\n this.mediaBox.innerHTML = \"\";\n this.mediaBox.appendChild(element);\n }\n this.mediaInt = setTimeout(() => this.addState(this.options.mediaState), 20);\n this.setSkewing(this.options.skewingMedia);\n }\n\n /**\n * Revert cursor from media mode.\n */\n removeMedia() {\n clearTimeout(this.mediaInt);\n this.removeState(this.options.mediaState);\n this.mediaInt = setTimeout(() => this.mediaBox.innerHTML = \"\", this.options.hideMediaTimeout);\n this.removeSkewing();\n }\n\n /**\n * Transform cursor to image mode.\n *\n * @param {string} url Image url.\n */\n setImg(url) {\n if (!this.mediaImg) this.mediaImg = new Image();\n if (this.mediaImg.src !== url) this.mediaImg.src = url;\n this.setMedia(this.mediaImg);\n }\n\n /**\n * Reverts cursor from image mode.\n */\n removeImg() {\n this.removeMedia();\n }\n\n /**\n * Transform cursor to video mode.\n *\n * @param {string} url Video url.\n */\n setVideo(url) {\n if (!this.mediaVideo) {\n this.mediaVideo = document.createElement('video');\n this.mediaVideo.muted = true;\n this.mediaVideo.loop = true;\n this.mediaVideo.autoplay = true;\n }\n if (this.mediaVideo.src !== url) {\n this.mediaVideo.src = url;\n this.mediaVideo.load();\n }\n this.mediaVideo.play();\n this.setMedia(this.mediaVideo);\n }\n\n /**\n * Reverts cursor from video mode.\n */\n removeVideo() {\n if (this.mediaVideo && this.mediaVideo.readyState > 2) this.mediaVideo.pause();\n this.removeMedia();\n }\n\n /**\n * Get cursor options from data attribute of a given element.\n *\n * @param {HTMLElement} element Element.\n * @return {object} Options.\n */\n getFromDataset(element) {\n const dataset = element.dataset;\n return {\n state: dataset[this.options.dataAttr],\n show: dataset[this.options.dataAttr + \"Show\"],\n text: dataset[this.options.dataAttr + \"Text\"],\n icon: dataset[this.options.dataAttr + \"Icon\"],\n img: dataset[this.options.dataAttr + \"Img\"],\n video: dataset[this.options.dataAttr + \"Video\"],\n stick: dataset[this.options.dataAttr + \"Stick\"],\n }\n }\n\n /**\n * Destroy cursor instance.\n */\n destroy() {\n this.gsap.ticker.remove(this.ticker);\n this.container.removeEventListener('mouseleave', this.event.mouseleave);\n this.container.removeEventListener('mouseenter', this.event.mouseenter);\n this.container.removeEventListener('mousedown', this.event.mousedown);\n this.container.removeEventListener('mouseup', this.event.mouseup);\n this.container.removeEventListener('mousemove', this.event.mousemove);\n this.container.removeEventListener('mousemove', this.event.mousemoveOnce);\n this.container.removeEventListener('mouseover', this.event.mouseover);\n this.container.removeEventListener('mouseout', this.event.mouseout);\n if (this.el) {\n this.container.removeChild(this.el);\n this.el = null;\n this.mediaImg = null;\n this.mediaVideo = null;\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","MouseFollower","options","gsap","assign","el","container","document","body","className","innerClassName","textClassName","mediaClassName","mediaBoxClassName","iconSvgClassName","iconSvgNamePrefix","iconSvgSrc","dataAttr","hiddenState","textState","iconState","activeState","mediaState","stateDetection","visible","speed","ease","overwrite","skewing","skewingText","skewingIcon","skewingMedia","skewingDelta","skewingDeltaMax","stickDelta","showTimeout","hideOnLeave","hideTimeout","hideMediaTimeout","initialPos","window","innerWidth","innerHeight","querySelector","pos","x","y","vel","event","init","registerGSAP","create","createSetter","bind","render","ticker","add","createElement","classList","inner","text","media","mediaBox","appendChild","setter","quickSetter","rotation","scaleX","scaleY","wc","mouseleave","hide","mouseenter","show","mousedown","addState","mouseup","removeState","mousemoveOnce","mousemove","e","to","stick","clientX","clientY","duration","onUpdate","mouseover","target","relatedTarget","contains","parentNode","state","matches","params","getFromDataset","setText","icon","setIcon","img","setImg","video","setVideo","setStick","mouseout","removeText","removeIcon","removeImg","removeVideo","removeStick","addEventListener","passive","once","force","distance","Math","sqrt","pow","scale","min","angle","atan2","PI","clearInterval","visibleInt","remove","setTimeout","toggle","split","toggleState","setSkewing","value","removeSkewing","element","rect","getBoundingClientRect","top","height","left","innerHTML","name","style","setMedia","clearTimeout","mediaInt","removeMedia","url","mediaImg","Image","src","mediaVideo","muted","loop","autoplay","load","play","readyState","pause","dataset","destroy","removeEventListener","removeChild"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"mouse-follower.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,IAR1B,CASGK,MAAM,WACT,O,wBCTA,IAAIC,EAAsB,CCA1BA,EAAwB,SAASL,EAASM,GACzC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EF,EAAwB,SAASQ,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,K;;;;;;;ACK5F,IAEkBI,EAAAA,WA8CjB,WAAYC,GACRf,KAAKgB,KAAOF,EAAcE,KAC1BhB,KAAKe,QAAUV,OAAOY,OAAO,GAAI,CAC7BC,GAAI,KACJC,UAAWC,SAASC,KACpBC,UAAW,YACXC,eAAgB,kBAChBC,cAAe,iBACfC,eAAgB,kBAChBC,kBAAmB,sBACnBC,iBAAkB,eAClBC,kBAAmB,IACnBC,WAAY,GACZC,SAAU,SACVC,YAAa,UACbC,UAAW,QACXC,UAAW,QACXC,YAAa,UACbC,WAAY,SACZC,eAAgB,CACZ,WAAY,WACZ,UAAW,UAEfC,SAAS,EACTC,MAAO,IACPC,KAAM,WACNC,WAAW,EACXC,QAAS,EACTC,YAAa,EACbC,YAAa,EACbC,aAAc,EACdC,aAAc,KACdC,gBAAiB,IACj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uleDefinition","webpack://MouseFollower/webpack/bootstrap","webpack://MouseFollower/webpack/runtime/define property getters","webpack://MouseFollower/webpack/runtime/hasOwnProperty shorthand","webpack://MouseFollower/./src/index.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([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"MouseFollower\"] = factory();\n\telse\n\t\troot[\"MouseFollower\"] = factory();\n})(this, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/*!\n * Cuberto Mouse Follower\n *\n * @version 1.0.3\n * @author Cuberto | Artem Dordzhiev (Draft)\n */\n\nexport default class MouseFollower {\n /**\n * Register GSAP animation library.\n *\n * @param {GSAP} gsap GSAP library.\n */\n static registerGSAP(gsap) {\n MouseFollower.gsap = gsap;\n }\n\n /**\n * Create cursor instance.\n *\n * @param {object} [options] Cursor options.\n * @param {HTMLElement|null} options.el Existed cursor element.\n * @param {HTMLElement|null} options.container Cursor container.\n * @param {string} options.className Cursor root element class name.\n * @param {string} options.innerClassName Inner element class name.\n * @param {string} options.mediaClassName Media element class name.\n * @param {string} options.mediaBoxClassName Media inner element class name.\n * @param {string} options.iconSvgClassName SVG sprite class name.\n * @param {string} options.iconSvgNamePrefix SVG sprite icon class name prefix.\n * @param {string} options.iconSvgSrc SVG sprite source.\n * @param {string|null} options.dataAttr Name of data attribute for changing cursor state directly in HTML.\n * @param {string} options.hiddenState Hidden state name.\n * @param {string} options.textState Text state name.\n * @param {string} options.iconState Icon state name.\n * @param {string} options.activeState Active (mousedown) state name.\n * @param {string} options.mediaState Media (image/video) state name.\n * @param {string} options.visible Is cursor visible by default.\n * @param {object} options.stateDetection State detection rules.\n * @param {number} options.speed Cursor movement speed.\n * @param {string} options.ease Timing function of cursor movement.\n * @param {boolean} options.overwrite Overwrite or remain cursor position when `mousemove` event happens.\n * @param {number} options.skewing Default skewing factor.\n * @param {number} options.skewingText Skewing effect factor in a text state.\n * @param {number} options.skewingIcon Skewing effect factor in a icon state.\n * @param {number} options.skewingMedia Skewing effect factor in a media (image/video) state.\n * @param {number} options.skewingDelta Skewing effect base delta.\n * @param {number} options.skewingDeltaMax Skew effect max delta.\n * @param {number} options.stickDelta Stick effect delta.\n * @param {number} options.showTimeout Delay before show.\n * @param {boolean} options.hideOnLeave Hide the cursor when mouse leave container.\n * @param {number} options.hideTimeout Delay before hiding. It should be equal to the CSS hide animation time.\n * @param {array} options.initialPos Array (X, Y) of initial cursor position.\n */\n constructor(options) {\n this.gsap = MouseFollower.gsap;\n this.options = Object.assign({}, {\n el: null,\n container: document.body,\n className: \"mf-cursor\",\n innerClassName: \"mf-cursor-inner\",\n textClassName: \"mf-cursor-text\",\n mediaClassName: \"mf-cursor-media\",\n mediaBoxClassName: \"mf-cursor-media-box\",\n iconSvgClassName: \"mf-svgsprite\",\n iconSvgNamePrefix: \"-\",\n iconSvgSrc: \"\",\n dataAttr: \"cursor\",\n hiddenState: \"-hidden\",\n textState: \"-text\",\n iconState: \"-icon\",\n activeState: \"-active\",\n mediaState: \"-media\",\n stateDetection: {\n \"-pointer\": \"a,button\",\n \"-hidden\": \"iframe\"\n },\n visible: true,\n speed: 0.55,\n ease: \"expo.out\",\n overwrite: true,\n skewing: 0,\n skewingText: 2,\n skewingIcon: 2,\n skewingMedia: 2,\n skewingDelta: 0.001,\n skewingDeltaMax: 0.15,\n stickDelta: 0.15,\n showTimeout: 20,\n hideOnLeave: true,\n hideTimeout: 300,\n hideMediaTimeout: 300,\n initialPos: [-window.innerWidth, -window.innerHeight],\n }, options);\n\n this.el = typeof (this.options.el) === \"string\" ?\n document.querySelector(this.options.el) : this.options.el;\n this.container = typeof (this.options.container) === \"string\" ?\n document.querySelector(this.options.container) : this.options.container;\n this.skewing = this.options.skewing;\n this.pos = {x: this.options.initialPos[0], y: this.options.initialPos[1]};\n this.vel = {x: 0, y: 0};\n this.event = {};\n\n this.init();\n }\n\n /**\n * Init cursor.\n */\n init() {\n if (!this.el) this.create();\n this.createSetter();\n this.bind();\n this.render(true);\n this.ticker = this.render.bind(this, false);\n this.gsap.ticker.add(this.ticker);\n }\n\n /**\n * Create cursor DOM element and append to container.\n */\n create() {\n this.el = document.createElement('div');\n this.el.className = this.options.className;\n this.el.classList.add(this.options.hiddenState);\n\n this.inner = document.createElement('div');\n this.inner.className = this.options.innerClassName;\n\n this.text = document.createElement('div');\n this.text.className = this.options.textClassName;\n\n this.media = document.createElement('div');\n this.media.className = this.options.mediaClassName;\n\n this.mediaBox = document.createElement('div');\n this.mediaBox.className = this.options.mediaBoxClassName;\n\n this.media.appendChild(this.mediaBox);\n this.inner.appendChild(this.media);\n this.inner.appendChild(this.text);\n this.el.appendChild(this.inner);\n this.container.appendChild(this.el);\n }\n\n /**\n * Create GSAP setters.\n */\n createSetter() {\n this.setter = {\n x: this.gsap.quickSetter(this.el, \"x\", \"px\"),\n y: this.gsap.quickSetter(this.el, \"y\", \"px\"),\n rotation: this.gsap.quickSetter(this.el, \"rotation\", \"deg\"),\n scaleX: this.gsap.quickSetter(this.el, \"scaleX\"),\n scaleY: this.gsap.quickSetter(this.el, \"scaleY\"),\n wc: this.gsap.quickSetter(this.el, \"willChange\"),\n inner: {\n rotation: this.gsap.quickSetter(this.inner, \"rotation\", \"deg\")\n }\n };\n }\n\n /**\n * Create and attach events.\n */\n bind() {\n this.event.mouseleave = () => this.hide();\n this.event.mouseenter = () => this.show();\n this.event.mousedown = () => this.addState(this.options.activeState);\n this.event.mouseup = () => this.removeState(this.options.activeState);\n this.event.mousemoveOnce = () => this.show();\n this.event.mousemove = (e) => {\n this.gsap.to(this.pos, {\n x: this.stick ? this.stick.x - ((this.stick.x - e.clientX) * this.options.stickDelta) : e.clientX,\n y: this.stick ? this.stick.y - ((this.stick.y - e.clientY) * this.options.stickDelta) : e.clientY,\n overwrite: this.options.overwrite,\n ease: this.options.ease,\n duration: this.visible ? this.options.speed : 0,\n onUpdate: () => this.vel = {x: e.clientX - this.pos.x, y: e.clientY - this.pos.y}\n });\n };\n this.event.mouseover = (e) => {\n for (let target = e.target; target && target !== this.container; target = target.parentNode) {\n if (e.relatedTarget && target.contains(e.relatedTarget)) break;\n\n for (let state in this.options.stateDetection) {\n if (target.matches(this.options.stateDetection[state])) this.addState(state);\n }\n\n if (this.options.dataAttr) {\n const params = this.getFromDataset(target);\n if (params.state) this.addState(params.state);\n if (params.text) this.setText(params.text);\n if (params.icon) this.setIcon(params.icon);\n if (params.img) this.setImg(params.img);\n if (params.video) this.setVideo(params.video);\n if (typeof (params.show) !== \"undefined\") this.show();\n if (typeof (params.stick) !== \"undefined\") this.setStick(params.stick || target);\n }\n }\n };\n this.event.mouseout = (e) => {\n for (let target = e.target; target && target !== this.container; target = target.parentNode) {\n if (e.relatedTarget && target.contains(e.relatedTarget)) break;\n\n for (let state in this.options.stateDetection) {\n if (target.matches(this.options.stateDetection[state])) this.removeState(state);\n }\n\n if (this.options.dataAttr) {\n const params = this.getFromDataset(target);\n if (params.state) this.removeState(params.state);\n if (params.text) this.removeText();\n if (params.icon) this.removeIcon();\n if (params.img) this.removeImg();\n if (params.video) this.removeVideo();\n if (typeof (params.show) !== \"undefined\") this.hide();\n if (typeof (params.stick) !== \"undefined\") this.removeStick();\n }\n }\n };\n\n if (this.options.hideOnLeave) {\n this.container.addEventListener('mouseleave', this.event.mouseleave, {passive: true});\n }\n if (this.options.visible) {\n this.container.addEventListener('mouseenter', this.event.mouseenter, {passive: true});\n }\n this.container.addEventListener('mousedown', this.event.mousedown, {passive: true});\n this.container.addEventListener('mouseup', this.event.mouseup, {passive: true});\n this.container.addEventListener('mousemove', this.event.mousemove, {passive: true});\n if (this.options.visible) {\n this.container.addEventListener('mousemove', this.event.mousemoveOnce, {\n passive: true,\n once: true\n });\n }\n if (this.options.stateDetection || this.options.dataAttr) {\n this.container.addEventListener('mouseover', this.event.mouseover, {passive: true});\n this.container.addEventListener('mouseout', this.event.mouseout, {passive: true});\n }\n }\n\n /**\n * Render the cursor in a new position.\n *\n * @param {boolean} [force=false] Force render.\n */\n render(force) {\n if (force !== true && (this.vel.y === 0 || this.vel.x === 0)) {\n this.setter.wc('auto');\n return;\n }\n\n this.setter.wc('transform');\n this.setter.x(this.pos.x);\n this.setter.y(this.pos.y);\n\n if (this.skewing) {\n const distance = Math.sqrt(Math.pow(this.vel.x, 2) + Math.pow(this.vel.y, 2));\n const scale = Math.min(distance * this.options.skewingDelta,\n this.options.skewingDeltaMax) * this.skewing;\n const angle = Math.atan2(this.vel.y, this.vel.x) * 180 / Math.PI;\n\n this.setter.rotation(angle);\n this.setter.scaleX(1 + scale);\n this.setter.scaleY(1 - scale);\n this.setter.inner.rotation(-angle);\n }\n }\n\n /**\n * Show cursor.\n */\n show() {\n clearInterval(this.visibleInt);\n this.el.classList.remove(this.options.hiddenState);\n this.visibleInt = setTimeout(() => this.visible = true, this.options.showTimeout);\n }\n\n /**\n * Hide cursor.\n */\n hide() {\n clearInterval(this.visibleInt);\n this.el.classList.add(this.options.hiddenState);\n this.visibleInt = setTimeout(() => this.visible = false, this.options.hideTimeout);\n }\n\n /**\n * Toggle cursor.\n *\n * @param {boolean} [force=false] Force state.\n */\n toggle(force = false) {\n if (!this.visible || force) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Add state/states to the cursor.\n *\n * @param {string} state State name.\n */\n addState(state) {\n if (state === this.options.hiddenState) return this.hide();\n this.el.classList.add(...state.split(\" \"))\n }\n\n /**\n * Remove state/states from cursor.\n *\n * @param {string} state State name.\n */\n removeState(state) {\n if (state === this.options.hiddenState) return this.show();\n this.el.classList.remove(...state.split(\" \"))\n }\n\n /**\n * Toggle cursor state.\n *\n * @param {string} state State name.\n * @param {boolean} force Force state.\n */\n toggleState(state, force) {\n this.el.classList.toggle(`${state}`, force)\n }\n\n /**\n * Set factor of skewing effect.\n *\n * @param {number} value Skewing factor.\n */\n setSkewing(value) {\n this.gsap.to(this, {skewing: value});\n }\n\n /**\n * Reverts skewing factor to default.\n */\n removeSkewing() {\n this.gsap.to(this, {skewing: this.options.skewing});\n }\n\n /**\n * Stick cursor to the element.\n *\n * @param {string|HTMLElement} element Element or selector.\n */\n setStick(element) {\n const el = typeof (element) === \"string\" ? document.querySelector(element) : element\n const rect = el.getBoundingClientRect();\n this.stick = {\n y: rect.top + (rect.height / 2),\n x: rect.left + (rect.height / 2)\n };\n }\n\n /**\n * Unstick cursor from the element.\n */\n removeStick() {\n this.stick = false;\n }\n\n /**\n * Transform cursor to text mode with a given string.\n *\n * @param {string} text Text.\n */\n setText(text) {\n this.text.innerHTML = text;\n this.addState(this.options.textState);\n this.setSkewing(this.options.skewingText);\n }\n\n /**\n * Reverts cursor from text mode.\n */\n removeText() {\n this.removeState(this.options.textState);\n this.removeSkewing();\n }\n\n /**\n * Transform cursor to svg icon mode.\n *\n * @param {string} name Icon identifier.\n * @param {string} [style=\"\"] Additional SVG styles.\n */\n setIcon(name, style = '') {\n this.text.innerHTML = ``;\n this.addState(this.options.iconState);\n this.setSkewing(this.options.skewingIcon);\n }\n\n /**\n * Reverts cursor from icon mode.\n */\n removeIcon() {\n this.removeState(this.options.iconState);\n this.removeSkewing();\n }\n\n /**\n * Transform cursor to media mode with a given element.\n *\n * @param {HTMLElement} element Element.\n */\n setMedia(element) {\n clearTimeout(this.mediaInt);\n if (element) {\n this.mediaBox.innerHTML = \"\";\n this.mediaBox.appendChild(element);\n }\n this.mediaInt = setTimeout(() => this.addState(this.options.mediaState), 20);\n this.setSkewing(this.options.skewingMedia);\n }\n\n /**\n * Revert cursor from media mode.\n */\n removeMedia() {\n clearTimeout(this.mediaInt);\n this.removeState(this.options.mediaState);\n this.mediaInt = setTimeout(() => this.mediaBox.innerHTML = \"\", this.options.hideMediaTimeout);\n this.removeSkewing();\n }\n\n /**\n * Transform cursor to image mode.\n *\n * @param {string} url Image url.\n */\n setImg(url) {\n if (!this.mediaImg) this.mediaImg = new Image();\n if (this.mediaImg.src !== url) this.mediaImg.src = url;\n this.setMedia(this.mediaImg);\n }\n\n /**\n * Reverts cursor from image mode.\n */\n removeImg() {\n this.removeMedia();\n }\n\n /**\n * Transform cursor to video mode.\n *\n * @param {string} url Video url.\n */\n setVideo(url) {\n if (!this.mediaVideo) {\n this.mediaVideo = document.createElement('video');\n this.mediaVideo.muted = true;\n this.mediaVideo.loop = true;\n this.mediaVideo.autoplay = true;\n }\n if (this.mediaVideo.src !== url) {\n this.mediaVideo.src = url;\n this.mediaVideo.load();\n }\n this.mediaVideo.play();\n this.setMedia(this.mediaVideo);\n }\n\n /**\n * Reverts cursor from video mode.\n */\n removeVideo() {\n if (this.mediaVideo && this.mediaVideo.readyState > 2) this.mediaVideo.pause();\n this.removeMedia();\n }\n\n /**\n * Get cursor options from data attribute of a given element.\n *\n * @param {HTMLElement} element Element.\n * @return {object} Options.\n */\n getFromDataset(element) {\n const dataset = element.dataset;\n return {\n state: dataset[this.options.dataAttr],\n show: dataset[this.options.dataAttr + \"Show\"],\n text: dataset[this.options.dataAttr + \"Text\"],\n icon: dataset[this.options.dataAttr + \"Icon\"],\n img: dataset[this.options.dataAttr + \"Img\"],\n video: dataset[this.options.dataAttr + \"Video\"],\n stick: dataset[this.options.dataAttr + \"Stick\"],\n }\n }\n\n /**\n * Destroy cursor instance.\n */\n destroy() {\n this.gsap.ticker.remove(this.ticker);\n this.container.removeEventListener('mouseleave', this.event.mouseleave);\n this.container.removeEventListener('mouseenter', this.event.mouseenter);\n this.container.removeEventListener('mousedown', this.event.mousedown);\n this.container.removeEventListener('mouseup', this.event.mouseup);\n this.container.removeEventListener('mousemove', this.event.mousemove);\n this.container.removeEventListener('mousemove', this.event.mousemoveOnce);\n this.container.removeEventListener('mouseover', this.event.mouseover);\n this.container.removeEventListener('mouseout', this.event.mouseout);\n if (this.el) {\n this.container.removeChild(this.el);\n this.el = null;\n this.mediaImg = null;\n this.mediaVideo = null;\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","MouseFollower","options","gsap","assign","el","container","document","body","className","innerClassName","textClassName","mediaClassName","mediaBoxClassName","iconSvgClassName","iconSvgNamePrefix","iconSvgSrc","dataAttr","hiddenState","textState","iconState","activeState","mediaState","stateDetection","visible","speed","ease","overwrite","skewing","skewingText","skewingIcon","skewingMedia","skewingDelta","skewingDeltaMax","stickDelta","showTimeout","hideOnLeave","hideTimeout","hideMediaTimeout","initialPos","window","innerWidth","innerHeight","querySelector","pos","x","y","vel","event","init","registerGSAP","create","createSetter","bind","render","ticker","add","createElement","classList","inner","text","media","mediaBox","appendChild","setter","quickSetter","rotation","scaleX","scaleY","wc","mouseleave","hide","mouseenter","show","mousedown","addState","mouseup","removeState","mousemoveOnce","mousemove","e","to","stick","clientX","clientY","duration","onUpdate","mouseover","target","relatedTarget","contains","parentNode","state","matches","params","getFromDataset","setText","icon","setIcon","img","setImg","video","setVideo","setStick","mouseout","removeText","removeIcon","removeImg","removeVideo","removeStick","addEventListener","passive","once","force","distance","Math","sqrt","pow","scale","min","angle","atan2","PI","clearInterval","visibleInt","remove","setTimeout","toggle","split","toggleState","setSkewing","value","removeSkewing","element","rect","getBoundingClientRect","top","height","left","innerHTML","name","style","setMedia","clearTimeout","mediaInt","removeMedia","url","mediaImg","Image","src","mediaVideo","muted","loop","autoplay","load","play","readyState","pause","dataset","destroy","removeEventListener","removeChild"],"sourceRoot":""}
\ No newline at end of file
diff --git a/package.json b/package.json
index ea372ad..1a98940 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "mouse-follower",
- "version": "1.0.2",
+ "version": "1.0.3",
"description": "A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.",
"license": "MIT",
"main": "dist/mouse-follower.js",
diff --git a/src/index.js b/src/index.js
index 71f7361..38d53ea 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,7 +1,7 @@
/*!
* Cuberto Mouse Follower
*
- * @version 1.0.2
+ * @version 1.0.3
* @author Cuberto | Artem Dordzhiev (Draft)
*/