hubs-travel-js 0.0.49 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{var c=function(){let r,t=null,e=null;function s(){let i=document.querySelector(e.swiperWrapper);if(t=document.querySelector(e.pagination),!i||!t)return console.error("Required elements not found"),null;let n=new Swiper(e.swiper,{slidesPerView:1,grid:{rows:5},spaceBetween:0,pagination:{el:e.pagination,clickable:!0}});return r=n,n.on("slideChange",function(){}),n}return{init:function(i){e=i,document.addEventListener("DOMContentLoaded",function(){s()})}}}();function l(){let r=document.querySelectorAll(".filter-button"),t=document.querySelectorAll(".filter-list-item");r.forEach(s=>{s.addEventListener("click",function(){r.forEach(n=>n.classList.remove("active")),this.classList.add("active");let i=this.getAttribute("data-season");i==="all"?t.forEach(n=>{n.classList.remove("filtered-out")}):t.forEach(n=>{let a=`[data-season-${i}="true"]`;n.querySelector(a)!==null?n.classList.remove("filtered-out"):n.classList.add("filtered-out")})})});let e=document.querySelector('[data-season="all"]');e&&e.click()}var o=class{constructor(t){this.SELECTORS=t,this.swiperInstance=null,this.prevButton=null,this.nextButton=null}init(){document.addEventListener("DOMContentLoaded",()=>{let t=document.querySelector(this.SELECTORS.swiperWrapper);t&&(t.style.gap="0"),this.initSwiper()})}initSwiper(){let t=document.querySelector(this.SELECTORS.refContainer),e=document.querySelector(this.SELECTORS.swiperWrapper);if(this.prevButton=document.querySelector(this.SELECTORS.prevButton),this.nextButton=document.querySelector(this.SELECTORS.nextButton),!t||!e||!this.prevButton||!this.nextButton)return console.error("Required elements not found"),null;let i=t.getBoundingClientRect().left,n=new Swiper(this.SELECTORS.swiper,{slidesPerView:"auto",spaceBetween:16,freeMode:!1,slidesOffsetBefore:i,slidesOffsetAfter:16,navigation:{nextEl:this.SELECTORS.nextButton,prevEl:this.SELECTORS.prevButton},watchOverflow:!0});return this.swiperInstance=n,this.updateButtonsState(),n.on("slideChange",this.updateButtonsState.bind(this)),window.addEventListener("resize",()=>{let a=t.getBoundingClientRect().left;n&&n.params&&(n.params.slidesOffsetBefore=a,n.update())}),n}updateButtonsState(){if(!this.prevButton||!this.nextButton)return;this.prevButton.style.opacity=this.swiperInstance.isBeginning?"0.5":"1",this.prevButton.style.pointerEvents=this.swiperInstance.isBeginning?"none":"auto";let t=this.swiperInstance.maxTranslate();this.swiperInstance.translate<=t+5?(this.nextButton.style.opacity="0.5",this.nextButton.style.pointerEvents="none"):(this.nextButton.style.opacity="1",this.nextButton.style.pointerEvents="auto")}};var p=function(){function r(e){let s=new Swiper(e,{effect:"cards",grabCursor:!0,slidesPerView:1,spaceBetween:0,freeMode:!1,slidesOffsetAfter:0,watchOverflow:!0,navigation:{nextEl:"#testimonial-cards-swiper-next-btn",prevEl:"#testimonial-cards-swiper-prev-btn"}});return t(s),s.on("slideChange",function(){t(s)}),s}function t(e){let s=document.querySelector("#testimonial-cards-swiper-prev-btn"),i=document.querySelector("#testimonial-cards-swiper-next-btn");s.style.opacity=e.isBeginning?"0.5":"1",s.style.pointerEvents=e.isBeginning?"none":"auto",i.style.opacity=e.isEnd?"0.5":"1",i.style.pointerEvents=e.isEnd?"none":"auto"}return{initSwiper:r}}();function u(){document.querySelectorAll("#testimonial-cards-section .testimonial-card-slide").forEach(e=>{e.style.position="static"}),document.querySelectorAll("#testimonial-cards-section .swiper-slide-shadow").forEach(e=>{e.style.borderRadius="16px"})}document.addEventListener("DOMContentLoaded",function(){l(),u()});c.init({swiper:"#special-room-offers-section .swiper",swiperWrapper:"#special-room-offers-section .swiper-wrapper",pagination:"#special-room-offers-section .swiper-pagination"});var d=new o({refContainer:"#destination-cards-swiper-ref-container",swiper:"#destination-cards-section .swiper",swiperWrapper:"#destination-cards-section .swiper-wrapper",prevButton:"#destination-cards-swiper-prev-btn",nextButton:"#destination-cards-swiper-next-btn"});d.init();var f=new o({refContainer:"#activity-cards-swiper-ref-container",swiper:"#activity-cards-section .swiper",swiperWrapper:"#activity-cards-section .swiper-wrapper",prevButton:"#activity-cards-swiper-prev-btn",nextButton:"#activity-cards-swiper-next-btn"});f.init();p.initSwiper("#testimonial-cards-section .swiper");})();
1
+ (()=>{var c=function(){let r,t=null,e=null;function s(){let i=document.querySelector(e.swiperWrapper);if(t=document.querySelector(e.pagination),!i||!t)return console.error("Required elements not found"),null;let n=new Swiper(e.swiper,{slidesPerView:1,grid:{rows:5},spaceBetween:0,pagination:{el:e.pagination,clickable:!0}});return r=n,n.on("slideChange",function(){}),n}return{init:function(i){e=i,document.addEventListener("DOMContentLoaded",function(){s()})}}}();function l(){let r=document.querySelectorAll("#destination-cards-section .filter-button"),t=document.querySelectorAll("#destination-cards-section .filter-list-item");r.forEach(s=>{s.addEventListener("click",function(){r.forEach(n=>n.classList.remove("active")),this.classList.add("active");let i=this.getAttribute("data-season");i==="all"?t.forEach(n=>{n.classList.remove("filtered-out")}):t.forEach(n=>{let a=`[data-season-${i}="true"]`;n.querySelector(a)!==null?n.classList.remove("filtered-out"):n.classList.add("filtered-out")})})});let e=document.querySelector('[data-season="all"]');e&&e.click()}var o=class{constructor(t){this.SELECTORS=t,this.swiperInstance=null,this.prevButton=null,this.nextButton=null}init(){document.addEventListener("DOMContentLoaded",()=>{let t=document.querySelector(this.SELECTORS.swiperWrapper);t&&(t.style.gap="0"),this.initSwiper()})}initSwiper(){let t=document.querySelector(this.SELECTORS.refContainer),e=document.querySelector(this.SELECTORS.swiperWrapper);if(this.prevButton=document.querySelector(this.SELECTORS.prevButton),this.nextButton=document.querySelector(this.SELECTORS.nextButton),!t||!e||!this.prevButton||!this.nextButton)return console.error("Required elements not found"),null;let i=t.getBoundingClientRect().left,n=new Swiper(this.SELECTORS.swiper,{slidesPerView:"auto",spaceBetween:16,freeMode:!1,slidesOffsetBefore:i,slidesOffsetAfter:16,navigation:{nextEl:this.SELECTORS.nextButton,prevEl:this.SELECTORS.prevButton},watchOverflow:!0});return this.swiperInstance=n,this.updateButtonsState(),n.on("slideChange",this.updateButtonsState.bind(this)),window.addEventListener("resize",()=>{let a=t.getBoundingClientRect().left;n&&n.params&&(n.params.slidesOffsetBefore=a,n.update())}),n}updateButtonsState(){if(!this.prevButton||!this.nextButton)return;this.prevButton.style.opacity=this.swiperInstance.isBeginning?"0.5":"1",this.prevButton.style.pointerEvents=this.swiperInstance.isBeginning?"none":"auto";let t=this.swiperInstance.maxTranslate();this.swiperInstance.translate<=t+5?(this.nextButton.style.opacity="0.5",this.nextButton.style.pointerEvents="none"):(this.nextButton.style.opacity="1",this.nextButton.style.pointerEvents="auto")}};var p=function(){function r(e){let s=new Swiper(e,{effect:"cards",grabCursor:!0,slidesPerView:1,spaceBetween:0,freeMode:!1,slidesOffsetAfter:0,watchOverflow:!0,navigation:{nextEl:"#testimonial-cards-swiper-next-btn",prevEl:"#testimonial-cards-swiper-prev-btn"}});return t(s),s.on("slideChange",function(){t(s)}),s}function t(e){let s=document.querySelector("#testimonial-cards-swiper-prev-btn"),i=document.querySelector("#testimonial-cards-swiper-next-btn");s.style.opacity=e.isBeginning?"0.5":"1",s.style.pointerEvents=e.isBeginning?"none":"auto",i.style.opacity=e.isEnd?"0.5":"1",i.style.pointerEvents=e.isEnd?"none":"auto"}return{initSwiper:r}}();function u(){document.querySelectorAll("#testimonial-cards-section .testimonial-card-slide").forEach(e=>{e.style.position="static"}),document.querySelectorAll("#testimonial-cards-section .swiper-slide-shadow").forEach(e=>{e.style.borderRadius="16px"})}document.addEventListener("DOMContentLoaded",function(){l(),u()});c.init({swiper:"#special-room-offers-section .swiper",swiperWrapper:"#special-room-offers-section .swiper-wrapper",pagination:"#special-room-offers-section .swiper-pagination"});var d=new o({refContainer:"#destination-cards-swiper-ref-container",swiper:"#destination-cards-section .swiper",swiperWrapper:"#destination-cards-section .swiper-wrapper",prevButton:"#destination-cards-swiper-prev-btn",nextButton:"#destination-cards-swiper-next-btn"});d.init();var f=new o({refContainer:"#activity-cards-swiper-ref-container",swiper:"#activity-cards-section .swiper",swiperWrapper:"#activity-cards-section .swiper-wrapper",prevButton:"#activity-cards-swiper-prev-btn",nextButton:"#activity-cards-swiper-next-btn"});f.init();p.initSwiper("#testimonial-cards-section .swiper");})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hubs-travel-js",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/mediakular/hubs.travel-js-public#readme",
6
6
  "bugs": {