-
Notifications
You must be signed in to change notification settings - Fork 0
/
clog.bundle.js
1 lines (1 loc) · 11.8 KB
/
clog.bundle.js
1
"use strict";(self.webpackChunkcrocs=self.webpackChunkcrocs||[]).push([[545,276],{503:(e,t,a)=>{a.d(t,{Z:()=>f});var i=a(260),s=a.n(i),o=a(32),l=a(108);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var a=0;a<t.length;a++){var i=t[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function c(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(p,e);var t,a,i,r,f=(i=p,r=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(e){return!1}}(),function(){var e,t=u(i);if(r){var a=u(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return c(this,e)});function p(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),d(g(e=f.call(this,{key:"ClogScene"})),"CATEGORY",{CLOG:"clog",SANDAL:"sandal"}),d(g(e),"clogColors",["alein","beige_colorful","black_grey_camaflouge","black_colorful_black_strap","black_colorful_blue_strap","black_strap","black_white_color_mix","black","blue_camaflouge","blue_pink_colorful","blue_pink_pink_strap","blue_pink","blue","brown_beige_strap","colorful_black","colorful_yellow_straps","flower_colorful","green_metallic","green_camaflouge","grey","light_blue_pattern","light_blue","light_peach","light_pink","light_yellow","matte_black","navy_blue","peach","pink","white_orange_strap","white","yellow"]),d(g(e),"sandalColors",["black_sandal","bluish_sandal","colorful_sandal","white_sandal"]),d(g(e),"selectedClog",void 0),d(g(e),"currentSelection",e.CATEGORY.CLOG),e}return t=p,(a=[{key:"preload",value:function(){this.load.image("header","assets/icons/header.png"),this.load.image("logo_grey","assets/icons/logo_grey.png"),this.load.image("slider_area","assets/icons/slider_area.png"),this.load.image("alein","assets/footwear/Clog/alein.png"),this.load.image("beige_colorful","assets/footwear/Clog/beige_colorful.png"),this.load.image("black_grey_camaflouge","assets/footwear/Clog/black_grey_camaflouge.png"),this.load.image("black_colorful_black_strap","assets/footwear/Clog/black_colorful_black_strap.png"),this.load.image("black_colorful_blue_strap","assets/footwear/Clog/black_colorful_blue_strap.png"),this.load.image("black_strap","assets/footwear/Clog/black_strap.png"),this.load.image("black_white_color_mix","assets/footwear/Clog/black_white_color_mix.png"),this.load.image("black","assets/footwear/Clog/black.png"),this.load.image("blue_camaflouge","assets/footwear/Clog/blue_camaflouge.png"),this.load.image("blue_pink_colorful","assets/footwear/Clog/blue_pink_colorful.png"),this.load.image("blue_pink_pink_strap","assets/footwear/Clog/blue_pink_pink_strap.png"),this.load.image("blue_pink","assets/footwear/Clog/blue_pink.png"),this.load.image("blue","assets/footwear/Clog/blue.png"),this.load.image("brown_beige_strap","assets/footwear/Clog/brown_beige_strap.png"),this.load.image("colorful_black","assets/footwear/Clog/colorful_black.png"),this.load.image("colorful_yellow_straps","assets/footwear/Clog/colorful_yellow_straps.png"),this.load.image("flower_colorful","assets/footwear/Clog/flower_colorful.png"),this.load.image("green_camaflouge","assets/footwear/Clog/green_camaflouge.png"),this.load.image("green_metallic","assets/footwear/Clog/green_metallic.png"),this.load.image("grey","assets/footwear/Clog/grey.png"),this.load.image("light_blue_pattern","assets/footwear/Clog/light_blue_pattern.png"),this.load.image("light_blue","assets/footwear/Clog/light_blue.png"),this.load.image("light_peach","assets/footwear/Clog/light_peach.png"),this.load.image("light_pink","assets/footwear/Clog/light_pink.png"),this.load.image("light_yellow","assets/footwear/Clog/light_yellow.png"),this.load.image("matte_black","assets/footwear/Clog/matte_black.png"),this.load.image("navy_blue","assets/footwear/Clog/navy_blue.png"),this.load.image("peach","assets/footwear/Clog/peach.png"),this.load.image("pink","assets/footwear/Clog/pink.png"),this.load.image("white_orange_strap","assets/footwear/Clog/white_orange_strap.png"),this.load.image("white","assets/footwear/Clog/white.png"),this.load.image("yellow","assets/footwear/Clog/yellow.png"),this.load.image("normal_sandal","assets/icons/normal_sandal.png"),this.load.image("highlight_sandal","assets/icons/highlight_sandal.png"),this.load.image("normal_clog","assets/icons/normal_clog.png"),this.load.image("highlight_clog","assets/icons/highlight_clog.png"),this.load.image("black_sandal","assets/footwear/Sandal/black.png"),this.load.image("bluish_sandal","assets/footwear/Sandal/bluish_green.png"),this.load.image("colorful_sandal","assets/footwear/Sandal/colorful.png"),this.load.image("white_sandal","assets/footwear/Sandal/white.png"),this.load.scenePlugin({key:"rexuiplugin",url:"https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rexuiplugin.min.js",sceneKey:"rexUI"}),this.LoadProgress()}},{key:"create",value:function(){this.header=this.add.image(0,0,"header").setOrigin(0).setScale(.5),this.logo=this.add.image(this.sys.game.canvas.width/2,this.header.height/4,"logo_grey").setOrigin(.5),this.sliderArea=this.add.image(0,this.header.height/2+100,"slider_area").setOrigin(0).setScale(2.5),this.titleText=this.add.bitmapText(this.sys.game.canvas.width/2,this.header.height/1.5,"ProximaNovaBlack","Choose your favourite pair of clogs or sandals",70,0).setOrigin(.5,-1),this.DrawVerticalLine(0,this.header.height/2+50,this.sys.game.canvas.width,this.header.height/2+50),this.Init(),this.sidebar=this.DrawSideBar("Slider",this.sys.game.canvas.width-100,this.sys.game.canvas.height/2+300,100,this.sys.game.canvas.height-800),this.input.on("gameobjectdown",(function(e,t){t.emit("clickdown",t)}),this)}},{key:"Init",value:function(){this.currentSelection=this.CATEGORY.CLOG,this.clogBtn=this.add.image(450,600,"highlight_clog").setOrigin(.5).setScale(2).setInteractive({cursor:"pointer"}).on("pointerdown",(function(){this.clogBtn.setTexture("highlight_clog"),this.sandalBtn.setTexture("normal_sandal"),this.currentSelection=this.CATEGORY.CLOG,this.GenerateMenu(),this.sidebar.setVisible(!0),this.sidebar.setValue(0)}),this),this.sandalBtn=this.add.image(1150,600,"normal_sandal").setOrigin(.5).setScale(2).setInteractive({cursor:"pointer"}).on("pointerdown",(function(){this.clogBtn.setTexture("normal_clog"),this.sandalBtn.setTexture("highlight_sandal"),this.currentSelection=this.CATEGORY.SANDAL,this.GenerateMenu(),this.sidebar.setValue(0),this.sidebar.setVisible(!1)}),this),this.sliderContainer=this.add.container(0,0);var e=this.make.graphics();e.fillRect(0,this.header.height+300,this.sys.game.canvas.width,this.sys.game.canvas.height);var t=new(s().Display.Masks.GeometryMask)(this,e);this.sliderContainer.setMask(t),this.GenerateMenu()}},{key:"GenerateMenu",value:function(){var e=0;if(this.sliderContainer.removeAll(!0),this.sliderContainer.y=0,this.currentSelection==this.CATEGORY.CLOG)for(var t=0;t<this.clogColors.length/2;t++)for(var a=0;a<2;a++){var i=new o.Z(this,16777215,200+700*a,750+600*t,500,500,5,15,13158600,this.clogColors[e],.35,(function(e){this.selectedClog=e.texture,this.scene.start("JibbitzScene")}));e++,this.sliderContainer.add(i),l.log(i.willRender(this.cameras.main))}else for(t=0;t<this.sandalColors.length/2;t++)for(a=0;a<2;a++)i=new o.Z(this,16777215,200+700*a,750+600*t,500,500,5,15,13158600,this.sandalColors[e],1,(function(e){this.selectedClog=e.texture,this.scene.start("JibbitzScene")})),e++,this.sliderContainer.add(i)}},{key:"LoadProgress",value:function(){this.cameras.main.setZoom(3);var e=this.add.graphics(),t=this.add.graphics();e.fillStyle(10119196,.8),e.fillRect(this.cameras.main.centerX-160,this.cameras.main.centerY,320,50);var a=this.make.text({x:this.cameras.main.centerX,y:this.cameras.main.centerY-50,text:"Loading...",style:{font:"20px monospace",fill:"#000000"}});a.setOrigin(.5,.5);var i=this.make.text({x:this.cameras.main.centerX,y:this.cameras.main.centerY+25,text:"0%",style:{font:"18px monospace",fill:"#000000"}});i.setOrigin(.5,.5);var s=this.make.text({x:this.cameras.main.centerX,y:this.cameras.main.centerY+70,text:"",style:{font:"18px monospace",fill:"#000000"}});this.load.on("progress",(function(e){t.clear(),t.fillStyle(16628831,1),t.fillRect(this.cameras.main.centerX-150,this.cameras.main.centerY+10,300*e,30),null==this.selectedClog&&i.setText(parseInt(100*e)+"%")}),this),this.load.on("complete",(function(){this.cameras.main.setZoom(1),t.destroy(),e.destroy(),a.destroy(),i.destroy(),s.destroy()}),this)}},{key:"DrawSideBar",value:function(e,t,a,i,s){return this.slider=this.rexUI.add.slider({x:t,y:a,width:i,height:s,orientation:"y",track:this.rexUI.add.roundRectangle(0,0,0,0,6,12368312),thumb:this.rexUI.add.roundRectangle(0,0,i+20,s/10,25,10145806),space:{top:4,bottom:4},input:"drag"}).layout().setDepth(1).setOrigin(.5).setName(e),this.slider.on("valuechange",(function(e,t,a){this.sliderContainer.y=e*this.clogColors.length/2*-500}),this),this.slider}},{key:"DrawVerticalLine",value:function(e,t,a,i){var s=this.add.graphics();return s.lineStyle(3,0,1),s.beginPath(),s.moveTo(e,t),s.lineTo(a,i),s.closePath(),s.strokePath(),s}}])&&n(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),p}(s().Scene)},32:(e,t,a)=>{function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var i=t[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}a.d(t,{Z:()=>o});const o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Phaser.scene,a=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0,n=arguments.length>6?arguments[6]:void 0,h=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:16777215,g=arguments.length>9?arguments[9]:void 0,u=arguments.length>10?arguments[10]:void 0,d=arguments.length>11?arguments[11]:void 0;return i(this,e),this.color=a,this.width=l,this.height=r,this.radius=n,this.strokeColor=c,this.strokeWidth=h,this.element=t.add.container(s,o),this.element.add(this.DrawRoundRectHorizontal(t)),this.element.add(t.add.image(l/2,r/2,g).setScale(u).setOrigin(.5).setInteractive({cursor:"pointer"}).on("clickdown",d,t)),this.element}var t,a;return t=e,(a=[{key:"DrawRoundRectHorizontal",value:function(e){var t=e.add.graphics();return t.beginPath(),t.fillStyle(this.color,1),t.fillRoundedRect(0,0,this.width,this.height,this.radius),t.lineStyle(this.strokeWidth,this.strokeColor,1),t.strokeRoundedRect(0,0,this.width,this.height,this.radius),t.name=name,t}}])&&s(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),e}()}},e=>{e.O(0,[426],(()=>(503,e(e.s=503)))),e.O()}]);