{"version":3,"sources":["webpack:///./src/feature/hero-slider/hero-slider.js"],"names":["classes","active","windowSize","sm","HeroSlider","element","initDomCache","el","$el","slider","sliderActive","slideStart","slides","find","timeout","getTimeout","resizeTimeout","addBackgroundsToPage","setBackground","initEvents","window","innerWidth","startSlider","addEventListener","e","resizeThrottler","classList","add","setSliderHeight","current","setInterval","i","length","setAttribute","nextBackground","clearInterval","removeAttribute","remove","calculateHeight","height","offsetHeight","getAttribute","parseInt","setTimeout","actualResizeHandler","stopSlider","backgrounds","push","publish","BaseFeature"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;AAEA,IAAMA,UAAU;AACZC,YAAQ;AADI,CAAhB;;AAIA,IAAMC,aAAa;AACfC,QAAI;AADW,CAAnB;;IAIqBC,U;;;AACpB,wBAAYC,OAAZ,EAAqB;AAAA;;AAAA,4HACdA,OADc;;AAEd,cAAKC,YAAL;AACA,cAAKC,EAAL,GAAUF,OAAV;AACA,cAAKG,GAAL,GAAW,sBAAE,MAAKD,EAAP,CAAX;;AAEA,cAAKE,MAAL,CANc,CAMD;AACb,cAAKC,YAAL,GAAoB,KAApB,CAPc,CAOa;AAC3B,cAAKC,UAAL,GAAkB,CAAlB,CARc,CAQO;AACrB,cAAKC,MAAL,GAAc,MAAKJ,GAAL,CAASK,IAAT,CAAc,mBAAd,CAAd,CATc,CASoC;AAClD,cAAKC,OAAL,GAAe,MAAKC,UAAL,EAAf,CAVc,CAUoB;AAClC,cAAKC,aAAL,GAAqB,IAArB,CAXc,CAWa;;AAE3B,cAAKC,oBAAL;AACA,cAAKC,aAAL,CAAmB,CAAnB;;AAEA,cAAKC,UAAL;;AAEA,YAAGC,OAAOC,UAAP,GAAoB,GAAvB,EAA2B,MAAKC,WAAL;AAlBb;AAmBjB;;;;qCAEY;AAAA;;AACTF,mBAAOG,gBAAP,CAAwB,QAAxB,EAAkC,UAACC,CAAD,EAAO;AACrC,uBAAKC,eAAL;AACT,aAFK;AAGH;;;sC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5B,CAAjB;AACA;AACD,iBAAKO,OAAL,CAAa,sBAAb,EAAqC;AACjCF;AADiC,aAArC;AAGH;;;sCAEajB,O,EAAS;AACnB,iBAAKmB,OAAL,CAAa,qBAAb,EAAoC;AAChCnB;AADgC,aAApC;AAGH;;;uCAEcA,O,EAAS;AACpB,iBAAKmB,OAAL,CAAa,sBAAb,EAAqC;AACjCnB;AADiC,aAArC;AAGH;;;;EA9HmCoB,c;;kBAAnB7C,U","file":"19-6c22ce81.pkg.js","sourcesContent":["import $ from 'jquery';\r\nimport BaseFeature from '../../foundation/base/base';\r\n\r\nconst classes = {\r\n active: 'o-hero-slider--active'\r\n};\r\n\r\nconst windowSize = {\r\n sm: 640\r\n};\r\n\r\nexport default class HeroSlider extends BaseFeature {\r\n\tconstructor(element) {\r\n\t\tsuper(element);\r\n this.initDomCache();\r\n this.el = element;\r\n this.$el = $(this.el);\r\n \r\n this.slider; // Set to an ID used by the timout function\r\n this.sliderActive = false; // Sets to true when slider becomes active\r\n this.slideStart = 0; // Should start at first slide\r\n this.slides = this.$el.find('[data-js=\"slide\"]'); // Get all the slides\r\n this.timeout = this.getTimeout(); // Get the custom timeout\r\n this.resizeTimeout = null; // Used by the resize function to throttle resize event\r\n\r\n this.addBackgroundsToPage();\r\n this.setBackground(0);\r\n\r\n this.initEvents();\r\n\r\n if(window.innerWidth > 640)this.startSlider();\r\n }\r\n\r\n initEvents() {\r\n window.addEventListener('resize', (e) => {\r\n this.resizeThrottler();\r\n\t\t});\r\n }\r\n\r\n startSlider() {\r\n this.sliderActive = true;\r\n this.el.classList.add(classes.active);\r\n this.setBackground(0);\r\n this.setSliderHeight();\r\n let current = 0;\r\n this.slider = setInterval(() => {\r\n for (var i = 0; i < this.slides.length; i++) {\r\n this.slides[i].setAttribute('style', 'opacity:0;visibility:hidden;');\r\n // this.slides[i].style.opacity = 0;\r\n }\r\n current = (current != this.slides.length - 1) ? current + 1 : 0;\r\n this.slides[current].setAttribute('style', 'opacity:1;visibility:visible;');\r\n // this.slides[current].style.opacity = 1;\r\n this.nextBackground(current);\r\n }, this.timeout);\r\n }\r\n\r\n stopSlider() {\r\n clearInterval(this.slider);\r\n this.sliderActive = false;\r\n this.setBackground(0);\r\n this.el.removeAttribute('style');\r\n this.el.classList.remove(classes.active);\r\n for (var i = 0; i < this.slides.length; i++) {\r\n this.slides[i].removeAttribute('style');\r\n }\r\n }\r\n\r\n setSliderHeight() {\r\n this.el.setAttribute('style', 'margin-bottom:' + this.calculateHeight() + 'px;');\r\n }\r\n\r\n calculateHeight() {\r\n var height = 0;\r\n for(var i=0;i < this.slides.length; i++) {\r\n if(this.slides[i].offsetHeight > height) height = this.slides[i].offsetHeight;\r\n }\r\n return height;\r\n }\r\n\r\n getTimeout() {\r\n if(this.element.getAttribute('data-timeout')){\r\n return parseInt(this.element.getAttribute('data-timeout') * 1000);\r\n }\r\n return 5000;\r\n }\r\n\r\n resizeThrottler() {\r\n // Ignore resize events as long as an actualResizeHandler execution is in the queue\r\n if ( !this.resizeTimeout ) {\r\n this.resizeTimeout = setTimeout(() => {\r\n this.resizeTimeout = null;\r\n this.actualResizeHandler();\r\n // The actualResizeHandler will execute at a rate of 15fps\r\n }, 66);\r\n }\r\n }\r\n\r\n actualResizeHandler() {\r\n if (window.innerWidth < windowSize.sm) {\r\n if(this.sliderActive) {\r\n this.stopSlider();\r\n }\r\n else { \r\n this.el.removeAttribute('style');\r\n }\r\n }\r\n else {\r\n if(!this.sliderActive){\r\n this.startSlider();\r\n }\r\n else {\r\n this.setSliderHeight();\r\n }\r\n }\r\n }\r\n\r\n addBackgroundsToPage() {\r\n let backgrounds = [];\r\n for (let i = 0; i < this.slides.length; i++) {\r\n backgrounds.push(this.slides[i].getAttribute('data-background')); \r\n }\r\n this.publish('/page/addBackgrounds', {\r\n backgrounds\r\n });\r\n }\r\n \r\n setBackground(current) {\r\n this.publish('/page/setBackground', {\r\n current\r\n });\r\n }\r\n\r\n nextBackground(current) {\r\n this.publish('/page/nextBackground', {\r\n current\r\n });\r\n }\r\n}\r\n"],"sourceRoot":""}
体育平台
Wynn-Palace,-Macau-admin@paingame.net
皇冠官网
中国演出票务网
Asian-sports-betting-platform-support@cesametal.net
永利皇宫
赌博网站推荐
阆中在线
中江种业
Sun-City-customerservice@westridgeparkapartments.com
Sun-City-sales@khobuon.net
金羊网健康
江西国税网
济南网络广播电视台生活频道
游泳梦工厂
博彩平台大全
赶驴网
Wynn-Palace-admin@paingame.net
365-Sports-Betting-sales@tt99949.com
体育平台
重庆欣欣旅游网
宜运股份
凤凰家居
适嘉网
阳光重庆
滁州本地宝
湖南自考网
广州华美医疗美容医院
海报工厂
58同城泰州分类信息网
骷髅猫博客
爱易房网
动漫网
细高跟鞋网
扬州房地产信息网