PageSourceSearch

https://thunderlotusgames.com/wp-content/themes/thunderlotus/dist/…mePreview_js.e5ab8a3f203d49d7b8e4.bundle.js

js thunderlotusgames.com collected 2026-10-03 21:56:29 UTC 11,523 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkthunderlotus=self.webpackChunkthunderlotus||[]).push([["src_js_components_GamePreview_js"],{
1"./src/js/components/GamePreview.js":(t,e,n)=>{n.d(e,{Z:()=>b});var i=n("./node_modules/eventemitter2/lib/eventemitter2.js"),s=n.n(i),r=n("./src/js/components/RiveAnimation.js"),o=n("./src/js/utils/dom.js"),a=n("./src/js/utils/listener.js"),u=n("./src/js/utils/math.js"),l=n("./src/js/utils/mobile.js"),c=n("./src/js/utils/raf.js"),h=n("./src/js/utils/resize.js"),_=n("./src/js/utils/rive.js");function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function d(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof e?f(t):e;var n}function y(t,e){return y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},y(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=p(t);if(e){var s=p(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return d(this,n)}}const b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(p,t);var e,n,i,s=m(p);function p(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),(e=s.call(this)).el=t,e.animation=(0,o.$)("[data-game-preview-animation]",e.el),e.imgBox=(0,o.$)("[data-game-preview-imgBox]",e.el),e._data={px:null,py:null,mx:0,my:0,width:null,height:null},e._inView=!1,e._status=_.T.NONE,e._raf=null,e._rive=null,e._onAnimationLoaded=e._onAnimationLoaded.bind(f(e)),e._onResize=e._onResize.bind(f(e)),e._onMousemove=e._onMousemove.bind(f(e)),e._onRaf=e._onRaf.bind(f(e)),h.ZP.add(e._onResize),e._onResize(),e}return e=p,(n=[{key:"init",value:function(){this.animation&&!l.ai?this.animation&&this._status!==_.T.INIT&&(this._status=_.T.INIT,this._rive=new r.Z(this.animation,{stateMachines:"State Machine 1"}),this._rive.on("load",this._onAnimationLoaded)):this.emit("load",this)}},{key:"destroy",value:function(){this._unbindEvents(),this._rive&&this._rive.destroy(),this.el=null,this.animation=null,this.imgBox=null,this._data=null,this._inView=null,this._status=null,this._raf=null,this._rive=null,this._onAnimationLoaded=null,this._onResize=null,this._onMousemove=null,this._onRaf=null}},{key:"_bindEvents",value:function(){this._raf=c.ZP.add(this._onRaf),(0,a.on)(this.el,"mousemove",this._onMousemove)}},{key:"_unbindEvents",value:function(){h.ZP.remove(this._onResize),c.ZP.remove(this._onRaf),(0,a.S1)(this.el,"mousemove",this._onMousemove)}},{key:"_onAnimationLoaded",value:function(){this._status=_.T.LOADED;var t=this._rive.instance.stateMachineInputs(this._rive.stateMachines);t&&(this._data.px=t.find((function(t){return"progress-x"===t.name})),this._data.py=t.find((function(t){return"progress-y"===t.name}))),this.imgBox&&this.imgBox.remove(),this.imgBox=null,t&&this._bindEvents(),this.emit("load",this),this._inView&&(this._raf(!0),this._rive.play())}},{key:"_onResize",value:function(){var t=(0,o.JA)(this.el),e=t.width,n=t.height;this._data.width=e,this._data.height=n}},{key:"_onMousemove",value:function(t){this._data.mx=t.layerX,this._data.my=t.layerY}},{key:"_onRaf",value:function(){if(this._inView){var t=this._data,e=t.px,n=t.py,i=t.mx,s=t.my,r=t.width,o=t.height;if(e&&n){var a=(0,u.b9)(0,r,i)/r*100,l=(0,u.b9)(0,o,s)/o*100,c=e.value||0,h=n.value||0;Math.abs(c-a)<.5&&(c=a),Math.abs(h-l)<.5&&(h=l),c!==a&&(e.value=(0,u.t7)(c,a,.05)),h!==l&&(n.value=(0,u.t7)(h,l,.05))}}}},{key:"inView",get:function(){return this._inView},set:function(t){this._inView!==t&&(this._inView=t,this._status===_.T.LOADED&&(this._inView?(this._raf(!0),this._rive.play()):(this._raf(!1),this._rive.pause())))}},{key:"status",get:function(){return this._status}}])&&v(e.prototype,n),i&&v(e,i),p}(s())},
1"./src/js/components/RiveAnimation.js":(t,e,n)=>{n.d(e,{Z:()=>j});var i=n("./node_modules/eventemitter2/lib/eventemitter2.js"),s=n.n(i),r=n("./node_modules/@rive-app/webgl2/rive.js"),o=n("./src/js/utils/acf.js"),a=n("./src/js/utils/browser.js"),u=n("./src/js/utils/math.js"),l=n("./src/js/utils/viewport.js"),c=n("./src/js/utils/resize.js");function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function p(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof e?h(t):e;var n}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=v(t);if(e){var s=v(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return p(this,n)}}var m="play",b="pause",g={autoplay:!1,layout:new r.Layout({fit:r.Fit.Cover,alignment:r.Alignment.Center}),useOffscreenRenderer:!(0,a.Ud)(),enableRiveAssetCDN:!1,maxDPR:null};const j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(a,t);var e,n,i,s=y(a);function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=s.call(this)).el=t,e._action=null,e._options=n,e._src=e.el.dataset.src,e._src_mobile=e.el.dataset.srcMobile,e._animations=e.el.dataset.animations||!1,e._stateMachines=e.el.dataset.stateMachines||n.stateMachines,e._dpr=e.el.maxDpr||n.maxDPR,e._rive=null,e.el.dataset.artboard&&(e._options.artboard=e.el.dataset.artboard),e._animations&&(e._animations=e._animations.split(","),e._options.animations=e._animations),e._stateMachines&&(e._options.stateMachines=e._stateMachines),e._dpr&&(e._dpr=parseFloat(e._dpr)),e._dpr||(e._dpr=l.Z.devicePixelRatio),e._dpr&&(e._dpr=(0,u.b9)(1,Math.min(1.5,l.Z.devicePixelRatio),e._dpr)),e._onLoad=e._onLoad.bind(h(e)),e._onResize=e._onResize.bind(h(e)),e.init(),e}return e=a,n=[{key:"init",value:function(){var t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),i.forEach((function(e){f(t,e,n[e])}))}return t}({},g,this._options,{src:this.src,canvas:this.el});this._rive=new r.Rive(t),this._rive.on(r.EventType.Load,this._onLoad),this._bindEvents()}},{key:"destroy",value:function(){this._unbindEvents(),this._rive&&(this._rive.off(r.EventType.Load,this._onLoad),this._rive.cleanup()),this.el=null,this._action=null,this._dpr=null,this._options=null,this._src=null,this._src_mobile=null,this._animations=null,this._stateMachines=null,this._rive=null,this._onLoad=null,this._onResize=null}},{key:"play",value:function(){if(this._action!==m){this._action=m;var t=[];this._animations&&(t=t.concat(this._animations)),this._stateMachines&&(t=t.push(this._stateMachines)),this._rive&&this._rive.play(t)}}},{key:"pause",value:function(){this._action===m&&(this._action=b,this._rive&&this._rive.pause())}},{key:"stop",value:function(){this._action===m&&(this._action=b,this._rive&&this._rive.stop())}},{key:"_onLoad",value:function(){this._rive&&this._rive.resizeDrawingSurfaceToCanvas(this._dpr),this.emit
1("load",this),o.Z.is_preview&&this.play()}},{key:"_onResize",value:function(){this._rive.resizeDrawingSurfaceToCanvas(this._dpr)}},{key:"_bindEvents",value:function(){c.ZP.add(this._onResize)}},{key:"_unbindEvents",value:function(){c.ZP.remove(this._onResize)}},{key:"instance",get:function(){return this._rive}},{key:"playing",get:function(){return this._action===m}},{key:"src",get:function(){return this._src_mobile&&l.Z.width<768?this._src_mobile:this._src}},{key:"stateMachines",get:function(){return this._stateMachines}}],n&&_(e.prototype,n),i&&_(e,i),a}(s())},
1"./src/js/utils/raf.js":(t,e,n)=>{function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n.d(e,{ZP:()=>o,ol:()=>s});var s=450,r=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._lastTime=null,this._listeners=[],this._running=!1,this._rafID=null,this._runBnd=this._run.bind(this)}var e,n,s;return e=t,n=[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this._exists(t)){var i={callback:t,priority:e,active:n};return this._listeners.push(i),this._listeners.sort((function(t,e){return e.priority>t.priority?1:e.priority<t.priority?-1:0})),this._running||this._startRAF(),function(t){i.active=!0===t,i.active&&r._startRAF()}}}},{key:"remove",value:function(t){if(this._exists(t)){var e=this._listeners.findIndex((function(e){return e.callback===t}));this._listeners.splice(e,1)[0],this._running&&this._listeners&&0===this._listeners.length&&this._stopRAF()}}},{key:"_exists",value:function(t){return this._listeners.find((function(e){return e.callback===t}))}},{key:"_startRAF",value:function(){this._running||(this._running=!0,this._rafID=requestAnimationFrame(this._runBnd))}},{key:"_stopRAF",value:function(){this._running&&(this._rafID&&cancelAnimationFrame(this._rafID),this._rafID=null,this._running=!1)}},{key:"_run",value:function(){if(this._rafID=null,this._running){var t=!1,e=performance.now(),n=this._lastTime?Math.min(Math.ceil((e-this._lastTime)/16.666666666666668*10)/10,1):1;this._lastTime=e,this._listeners.forEach((function(e){e.active&&(e.callback(n),e.active&&(t=!0))})),t?this._rafID=requestAnimationFrame(this._runBnd):this._stopRAF()}}}],n&&i(e.prototype,n),s&&i(e,s),t}());const o=r},
1"./src/js/utils/viewport.js":(t,e,n)=>{n.d(e,{Z:()=>i});const i={get width(){return innerWidth},get height(){return innerHeight},get devicePixelRatio(){return devicePixelRatio||1}}}
1}]);
2//# sourceMappingURL=src_js_components_GamePreview_js.e5ab8a3f203d49d7b8e4.bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.