Trends in women fashion


‘ + ‘]]]]>]]>’ + ” + trend_name + ”+ ” + ”); return slide; } var newVideoSlide = function(trend_name, trend_url, trend_image) { var slide = $(”); return slide; } var generateSwiper = function(category) { var swiper_wrapper = $(“#trends_home .swiper_trends .swiper-wrapper”); category.subcategories.forEach(function(subcategory) { if(subcategory.key.indexOf(“TRENDS”) != -1 && subcategory.key.indexOf(“HIDDEN”) == -1) { var trend_image, swiper_slide; var url = inditex.generateUrl(“ItxCategoryPage”, { storeId: inditex.iStoreId, langId: inditex.iLangId, catalogId: inditex.iCatalogId, categoryId: subcategory.id }); // var url = “url_test”; subcategory.attachments.forEach(function(attachment) { attachment.type === “TREND_IMAGE” && (trend_image = inditex.iStoreJSON.details.staticUrl + attachment.path + “?” + inditex.iStoreJSON.details.timestampBuildVersion); }); subcategory.key.indexOf(“VIDEO”) == -1 ? swiper_slide = newImageSlide(subcategory.name, url, trend_image): swiper_slide = newVideoSlide(subcategory.name, url, trend_image); swiper_wrapper.append(swiper_slide); } }); }; var initSlider = function() { new Swiper(“#trends_home .swiper_trends”, { speed: 500, // slidesPerView: ‘auto’, centeredSlides: false, slidesPerView: 8, resistanceRatio: 0, centerInsufficientSlides: true, allowSlidePrev: true, allowSlideNext: true, longSwipesRatio: 0.1, breakpoints: { 1023: { slidesPerView: 6.5, }, 767: { slidesPerView: 4, } }, navigation: { nextEl: document.dir == “rtl” ? ‘.nav_trends_prev’ : ‘.nav_trends_next’, prevEl: document.dir == “rtl” ? ‘.nav_trends_next’ : ‘.nav_trends_prev’, }, /* on: { init: function() { if(window.innerWidth >= 768) { this.noSwiping = true; this.allowSlidePrev = false; this.allowSlideNext = false; } }, resize: function() { if(window.innerWidth >= 768) { console.log(“slideTo”); this.slideTo(0, 0); this.noSwiping = true; this.allowSlidePrev = false; this.allowSlideNext = false; } else { this.noSwiping = false; this.allowSlidePrev = true; this.allowSlideNext = true; } } } */ }); }; var searchTrendsCategory = function() { var trends_category; inditex.iCategoryTreeJSON.categories.forEach(function(category) { if(category.key.indexOf(“TRENDS_OYSHO”) != -1) { trends_category = category; }; }); return trends_category; }; var createTrendsObserver = function() { var observer; var prevRatio = 0.0; var observerOptions = { root: null, //viewport rootMargin: “-26px 0px 0px 0px”, threshold: [0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0] }; observer = new IntersectionObserver(function(entries, observer) { var marginTopBullets = 0; if(entries.length > 0) { marginTopBullets = 85 * entries[0].intersectionRatio; } $(‘#homeOysho_container .swiper-pagination’).css(‘margin-top’, marginTopBullets + ‘px’); }, observerOptions); observer.observe(document.querySelector(‘#trends_home’)); } try { var trendsCategory = searchTrendsCategory(); trendsCategory != undefined ? generateSwiper(trendsCategory) : “”; if($(“#trends_home .swiper_trends .swiper-wrapper .swiper-slide”).length > 0) { $(“#trends_home”).show(); var styleMarginSwiperTopElement = document.createElement(‘style’); styleMarginSwiperTopElement.type = “text/css”; var cssText = “#homeOysho_container {margin-top: 0 !important}”; styleMarginSwiperTopElement.innerHTML = cssText; $(‘#trends_home’).append(styleMarginSwiperTopElement); } if(‘IntersectionObserver’ in window) createTrendsObserver(); } catch(error) { console.log(error); } //INIT initSlider(); }); }); 0) { var styleEl = document.createElement(‘style’); styleEl.classList.add(‘bannerTopStyle’); styleEl.type = ‘text/css’; var mobileCssElement = ‘#homeOysho_container div.section.fullscreen_section {height: calc(100vh – ‘ + (65 + bannerEl.height()) + ‘px);}’ var deskCssElement = ‘@media screen and (min-width: 768px) {#homeOysho_container {margin-top:’ + (70 + bannerEl.height()) + ‘px;} #homeOysho_container div.section.fullscreen_section {height: calc(100vh – ‘ + (70 + bannerEl.height()) + ‘px);}} @media screen and (min-width: 768px) and (max-height: 768px) {#homeOysho_container {margin-top:’ + (45 + bannerEl.height()) + ‘px;} #homeOysho_container div.section.fullscreen_section {height: calc(100vh – ‘ + (45 + bannerEl.height()) + ‘px);}}’; styleEl.innerHTML = mobileCssElement + deskCssElement; $(‘#homeOysho_container’).append(styleEl); } } /*————————–*/ /*HOME SWIPER INITIALIZATION*/ function initializeSwiperHome() { var initialSlide = 0; return new Swiper(‘.swiper_container_home’, { trendsElement: $(‘#trends_home’), slidesPerView: 1, initialSlide: initialSlide, autoHeight: true, preloadImages: false, lazy: { loadOnTransitionStart: true }, speed: 1000, resistanceRatio: 0, loop: true, pagination: { clickable: true, el: ‘.swiper-pagination’, type: ‘bullets’ }, navigation: { nextEl: ‘.swiper_container_home .swiper_next’, prevEl: ‘.swiper_container_home .swiper_prev’ }, on: { init: function() { updateNavigationLabels(this); updateNavigationColor(this); if(this.params.trendsElement.length > 0) { var self = this; updateFirstSlideHeight(self); self.on(‘resize’, function() { updateFirstSlideHeight(self); }); } $(‘.next_slide_button’).click(function() { var nextSlide = $(this).parent(‘.section’).next(‘.section’); var bannerTop = $(‘.banner__container.banner-top’).length > 0 ? $(‘.banner__container.banner-top’).outerHeight() : 0; //var trends = $(‘#trends_home’).length > 0 ? $(‘#trends_home’).height() : 0; var header = $(‘#header’).outerHeight(); if(nextSlide.length > 0) { $(‘html, body’).animate({scrollTop: nextSlide.offset().top – bannerTop – header}, 500); } }); } } }); } /*————————–*/ inditex.onReady(function() { var swiperHome = initializeSwiperHome(); swiperHome.on(‘slideChangeTransitionStart’, function() { if(inditex.iPage != “ItxHomePage”) { return; } updateNavigationLabels(this); updateNavigationColor(this); //setLocalStorageInitialSlide(this.realIndex); if($(window).scrollTop() > 0) { $(window).scrollTop(0); } }); checkIsBanner(); $(‘.banner__container.banner-top .banner__closeBtn’).click(function() { $(‘#homeOysho_container .bannerTopStyle’).remove(); if($(‘#trends_home’).length > 0) { updateFirstSlideHeight(swiperHome); } swiperHome.updateAutoHeight(); }); $(document).on(‘scroll.homeScroll’, debounce(changeCssPositionOnScroll, 15)); //$(document).scroll(); }); }); ]]]]>]]>

Source

Leave a Reply