Galaxy Z Flip5
- SPECIFICATIONS
- SUPPORT
- REVIEWS
Buy now
- Highlights
- Compare
- Accessories
- SPECIFICATIONS
- SUPPORT
- REVIEWS
-
*Accessories sold separately. Model and colour availability may vary by country, region or carrier.
-
*Image simulated for illustrative purposes. Actual UX/UI may differ.
-
*Flipsuit Case actual colours, collaboration card options and corresponding content displayed on screen may differ. One piece of content is displayed per card.
-
*Accessories sold separately. Model and colour availability may vary by country, region or carrier.
-
*Image simulated for illustrative purposes. Actual UX/UI may differ.
-
*Flipsuit Case actual colours, collaboration card options and corresponding content displayed on screen may differ. One piece of content is displayed per card.
Superb fits for your Flip
Meet your next favourite case
*Image simulated for illustrative purposes. The actual colour, design option and content displayed on the brand collaboration Flipsuit Case may differ.
*Image simulated for illustrative purposes. The actual colour, design option and content displayed on the brand collaboration Flipsuit Case may differ.
-
Introducing
Galaxy Z Flip5 Cases -
How to install and remove
Clear
Gadget Case
-
Clear Gadget Case
A stand for an elevated view. Or a handle to hold on tight. Swap the back grip to switch modes anytime.
LEARN MORE
Transparent
-
Flipsuit Case
Shuffle between smart cards for colourfully matched Flex Windows. An excellent accent for your mirror selfies.
LEARN MORE
Transparent
-
Silicone Case with Ring
Flaunt your unique style with this expressive colour lineup. Use the loop for an even more grab-and-go friendly grip.
LEARN MORE
Apricot
-
Flap Eco-Leather Case
This minimal design adds a chic layer of protection for the hinge with the soft touch of synthetic leather.1,2
LEARN MORE
Cream
-
Front Protection Film
Shield your Flex Window with film that's smooth to the touch. Includes an installation frame for easy application.3
LEARN MORE
Transparent
Chargers to power your day
-
Super Fast Wireless Charger Duo
Charge two devices at once with a Watch magnet on one side and a Fast Wireless Charging pad on the other.4
BUY NOW
Black
-
Galaxy Watch6
Start your everyday wellness journey with Galaxy Watch6.
LEARN MORE
Graphite
-
Galaxy Watch6 Classic
Our iconic rotating bezel is now 15% slimmer.5
LEARN MORE
Silver
Tune in to your world
-
Galaxy Buds2 Pro
Pump up playlists with ANC and clear sound. Listen in luxury with this comfortable fit.
BUY NOW
Bora Purple
-
Galaxy Buds2
From workouts to gaming and the phone calls in between, intelligent ANC helps keep you immersed in the moment.
BUY NOW
Olive
Smartphone Accessories
Complete the foldable experience with stylish and functional add ons.
*Accessories sold separately. Model and colour availability may vary by country, region or carrier.
SEE ALL
GO TO GALAXY Z FOLD5
Check out the all-new Galaxy ZFlip5
BUY NOW RESERVE NOW PRE-ORDER NOW WHERE TO BUY
Life opens up with Galaxy
EXPLORE MORE
*All specifications and descriptions provided herein may be different from the actual specifications and descriptions for the product. Samsung reserves the right to make changes to this document and the product described herein, at anytime, without obligation on Samsung to provide notification of such change. All functionality, features, specifications, GUI and other product information provided in this document including, but not limited to, the benefits, design, pricing, components, performance, availability, and capabilities of the product are subject to change without notice or obligation. The contents within the screen are simulated images and are for demonstration purposes only.
*Brand collaboration accessories include one brand collaboration card in box.
*Flipsuit Case collaboration card content should be downloaded separately before use. Network connection required for download.
- Flap Eco-Leather Case contains UL-certified recycled materials. Plastic of Flap Eco-Leather Case (EF-VF731) contains a minimum of 14% post-consumer recycled content. Measurements based on weight of plastic parts.
- Flap Eco-Leather Case is made from synthetic materials with a leather effect, rather than real leather. The Eco claim is limited to the recycled and bio-based content in the case.
- Includes two sheets of protective film.
- Wireless charger requires power connection. Charging speeds may vary by device. Actual charging speed may vary depending on usage, charging conditions and other factors.
- Compared to previous Galaxy Watch series.
')); } } }; return { setLownetworkClass: setLownetworkClass, setScrollControl: setScrollControl, setResolution: setResolution, onClickSup: onClickSup, centeredFocus: centeredFocus, setArBanner: setArBanner, }})();(function() { var utils = window.flagship.common.utils, resize = window.flagship.common.resize, common = window.flagship.accessories.common, agent = navigator.userAgent.toLowerCase(), maxOs = agent.indexOf('mac os') > -1, touchDevice = ('ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch)); els = {}; var init = function() { els.isGlobal = document.documentElement.classList.contains('global'); }; var bindEvents = function() { window.addEventListener('DOMContentLoaded', anchorPosition, { once: true }); window.addEventListener('hashchange', anchorPosition); }; var setResize = function() { resize.init([{ resolution: 1920, resolutionName: 'desktop', eventFunction: '' }, { resolution: 1023, resolutionName: 'tablet', eventFunction: '' }, { resolution: 767, resolutionName: 'mobile', eventFunction: '' }, { resolution: 360, resolutionName: 'mobileS', eventFunction: '' }, { resolution: 320, resolutionName: 'mobileXs', eventFunction: '' }], 200); resize.add(common.setResolution); }; var setScrollControl = function() { window.scrollController = ANIUTIL.scrollController(); scrollController.init({ speed: 120, duration: 0.5 }); }; var setImageLoader = function() { window.imageLoader = ANIUTIL.mediaLoader({ lazyClass: '.js-img-src', responsiveClass: '.js-res-img', preset: els.isGlobal ? '' : '?imbypass=true', loadOption: [{ resolution: 1920, attribute: 'data-src-pc' }, { resolution: 1023, attribute: 'data-src-tb' }, { resolution: 767, attribute: 'data-src-mo' }, { resolution: 360, attribute: 'data-src-mo-s' }], visiblePoint: 1 }); window.bgLoader = ANIUTIL.mediaLoader({ type: 'bgImage', lazyClass: '.js-bg-img', loadOption: [{ resolution: 1920, attribute: '', bgOpts: '' }], visiblePoint: 1 }); }; var setDisclaimer = function() { els.supClicker = document.querySelectorAll('a.click_sup'); for (var i = 0; i < els.supClicker.length; i++) { els.supClicker[i].addEventListener('click', common.onClickSup); } }; var setCenteredfocus = function() { els.contents = document.querySelector('#contents'); els.allClickables = els.contents.querySelectorAll('a, button, input, select'); for (var i = 0; i < els.allClickables.length; i++) { els.allClickables[i].addEventListener('focusin', common.centeredFocus); } }; var anchorPosition = function() { if (window.location.hash != '' && !!document.querySelector(window.location.hash)) { var hash = location.hash.split('#')[1], hashSection = document.querySelector('#' + hash), hashTimeout = null; clearTimeout(hashTimeout); hashTimeout = setTimeout(function() { var sectionTop = hashSection.getBoundingClientRect().top, navHeight = utils.getNavHeight(), hashScroll = window.pageYOffset + sectionTop - navHeight; window.scrollTo(0, hashScroll); }, 300); } }; var onLoadHandler = function() { common.setLownetworkClass(); common.setArBanner(); init(); bindEvents(); setResize(); if (!maxOs && !touchDevice) { setScrollControl(); } setDisclaimer(); setCenteredfocus(); setImageLoader(); }; onLoadHandler();})();(function() { window.flagship.accessories = window.flagship.accessories || {}; flagship.accessories.colorchip = (function() { var els = {}, status = {}, resize = window.flagship.common.resize, utils = window.flagship.common.utils; currDevice = resize.checkResolution(); var init = function() { els.section = document.querySelector('#accessories'); if (!!els.section) { setElements(); setProperty(); setCta(); bindEvents(); } }; var setElements = function() { els.swiper = null; els.colorchipItem = els.section.querySelectorAll('.accessories__product-item'); status.isClick = false; }; var setProperty = function() { for (var i = 0; i < els.colorchipItem.length; i++) { var colorchipList = els.colorchipItem[i].querySelectorAll('.accessories__colorchip'), optionBtnList = els.colorchipItem[i].querySelectorAll('.accessories__product-option-btn'), swiperContainer = els.colorchipItem[i].querySelectorAll('.swiper-container'); for (var j = 0; j < colorchipList.length; j++) { var accProperty = { parentWrap: els.colorchipItem[i], img: els.colorchipItem[i].querySelector('.accessories__product-image>img'), ctaWrap: els.colorchipItem[i].querySelector('.accessories__product-cta'), cta: els.colorchipItem[i].querySelector('.accessories__product-cta>a'), currentColor: els.colorchipItem[i].querySelector('.accessories__product-current') }; colorchipList[j].accProperty = accProperty; } for (var k = 0; k < optionBtnList.length; k++) { var accProperty = { parentWrap: els.colorchipItem[i], optionBtnWrap: els.colorchipItem[i].querySelectorAll('.accessories__product-option-item')[k], colorchipList: els.colorchipItem[i].querySelectorAll('.swiper-pagination-wrap')[k], activeColorchip: els.colorchipItem[i].querySelector('.accessories__colors .is-active'), activeSwiperWrap: els.colorchipItem[i].querySelectorAll('.swiper-container-wrap')[k], activeSwiperContainer: els.colorchipItem[i].querySelectorAll('.swiper-container')[k], }; optionBtnList[k].accProperty = accProperty; } for (var l = 0; l < swiperContainer.length; l++) { var swiperSlides = swiperContainer[l].querySelectorAll('.swiper-slide'); if (swiperSlides.length >= 2) { var swiperProperty = { nextArrow: els.colorchipItem[i].querySelectorAll('.swiper-button-next')[l], prevArrow: els.colorchipItem[i].querySelectorAll('.swiper-button-prev')[l], pagination: els.colorchipItem[i].querySelectorAll('.swiper-pagination-wrap')[l], parentWrap: els.colorchipItem[i], }; swiperContainer[l].swiperProperty = swiperProperty; } if (swiperContainer[l].classList.contains('is-slide')) { var swiperProperty = { nextArrow: els.colorchipItem[i].querySelectorAll('.swiper-button-next')[l], prevArrow: els.colorchipItem[i].querySelectorAll('.swiper-button-prev')[l], pagination: els.colorchipItem[i].querySelectorAll('.swiper-pagination-wrap')[l], parentWrap: els.colorchipItem[i] }; swiperContainer[l].swiperProperty = swiperProperty; } } } }; var setCta = function() { for (var i = 0; i < els.colorchipItem.length; i++) { var activeColorchip = els.colorchipItem[i].querySelector('.accessories__colorchip.is-active'), activeColorchipUrl = activeColorchip.getAttribute('data-url'), activeItemCta = els.colorchipItem[i].querySelector('.accessories__product-cta'); if (!!activeItemCta) { if (activeColorchipUrl == '#') { activeItemCta.style.visibility = 'hidden'; activeItemCta.setAttribute('tabindex', -1); activeItemCta.setAttribute('aria-hidden', true); } else { activeItemCta.style.visibility = ''; activeItemCta.removeAttribute('tabindex'); activeItemCta.removeAttribute('aria-hidden'); } } } }; var resizeEvent = function(currRes) { if (currRes) currDevice = currRes; var activeSwiper = els.section.querySelectorAll('.swiper-container-initialized'); if (activeSwiper) { for (var i = 0; i < activeSwiper.length; i++) { var flipsuitSwiper = activeSwiper[i].classList.contains('is-slide'); if ((currDevice && (currDevice.indexOf('mobile') > -1) || currDevice == 'tablet') || flipsuitSwiper) { activeSwiper[i].swiper.allowTouchMove = true; } else { activeSwiper[i].swiper.allowTouchMove = false; } } } }; var onLoadHandler = function() { scrollHandler(); resizeEvent(); }; var bindEvents = function() { window.addEventListener('DOMContentLoaded', onLoadHandler, { once: true }); window.addEventListener('scroll', scrollHandler); resize.add(resizeEvent); els.section.addEventListener('click', function(e) { if (e.target.matches('.accessories__product-option-btn')) { colorchipEvent.optionChange(e.target); } else if (e.target.matches('.accessories__colorchip')) { if (!e.target.classList.contains('accessories__colorchip--slide')) { status.isClick = true; colorchipEvent.colorChange(e.target); colorchipEvent.slideTo(e.target); } } else if (e.target.matches('.accessories__radio')) { if (!e.target.parentElement.classList.contains('accessories__colorchip--slide')) { status.isClick = true; colorchipEvent.colorChange(e.target.parentElement); colorchipEvent.slideTo(e.target.parentElement); } } else if (e.target.matches('.accessories__radio-half')) { if (!e.target.parentElement.parentElement.classList.contains('accessories__colorchip--slide')) { status.isClick = true; colorchipEvent.colorChange(e.target.parentElement.parentElement); colorchipEvent.slideTo(e.target.parentElement.parentElement); } } }); els.section.addEventListener('keydown', function(e) { if (e.keyCode == 13) { if (e.target.matches('.accessories__product-option-btn')) { colorchipEvent.optionChange(e.target); } else if (e.target.matches('.accessories__colorchip')) { if (!e.target.classList.contains('accessories__colorchip--slide')) { status.isClick = true; colorchipEvent.colorChange(e.target); colorchipEvent.slideTo(e.target); } } } }); }; var scrollHandler = function() { for (var i = 0; i < els.colorchipItem.length; i++) { var targetElement = els.colorchipItem[i], scrollTop = window.pageYOffset, scrollBottom = scrollTop + window.innerHeight, targetOffsetTop = scrollTop + targetElement.getBoundingClientRect().top, targetOffsetBottom = scrollTop + targetElement.getBoundingClientRect().bottom, swiperContainer; if (els.colorchipItem[i].querySelector('.accessories__options')) { swiperContainer = els.colorchipItem[i].querySelector('.swiper-container-wrap.is-active .swiper-container'); } else { swiperContainer = els.colorchipItem[i].querySelector('.swiper-container'); } if ((scrollTop + 50) < targetOffsetBottom && (scrollBottom - 50) > targetOffsetTop) { setSwiper(swiperContainer); } else if ((scrollTop + 50) > targetOffsetBottom || (scrollBottom - 50) < targetOffsetTop) { if (swiperContainer.swiper) swiperEvents.destroy(swiperContainer.swiper); } } }; var colorchipEvent = { optionChange: function(targetOption) { var target = targetOption.accProperty, parentWrap = target.parentWrap, oldSwiper = parentWrap.querySelector('.swiper-container.swiper-container-initialized'); var _setCurrentOption = function() { parentWrap.selectOpt = parentWrap.querySelector('.accessories__product-option-item.is-active'); parentWrap.selectColorchipWrap = parentWrap.querySelector('.swiper-pagination-wrap.is-active'); parentWrap.selectColorchipList = Array.prototype.slice.call(parentWrap.selectColorchipWrap.querySelectorAll('.accessories__colorchip')); parentWrap.selectSwiperWrap = parentWrap.querySelector('.swiper-container-wrap.is-active'); // optBtn if (!target.optionBtnWrap.classList.contains('is-active')) { parentWrap.selectOpt.classList.remove('is-active'); parentWrap.selectOpt.querySelector('button').removeAttribute('title'); target.optionBtnWrap.classList.add('is-active'); if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.optionBtnWrap.querySelector('button').setAttribute('title', LOCAL_VARI.selected); } else { target.optionBtnWrap.querySelector('button').setAttribute('title', 'Selected'); } } // colorchipWrap if (!target.colorchipList.classList.contains('is-active')) { parentWrap.selectColorchipWrap.classList.remove('is-active'); target.colorchipList.classList.add('is-active'); } // swiperContainer if (!target.activeSwiperWrap.classList.contains('is-active')) { parentWrap.selectSwiperWrap.classList.remove('is-active'); target.activeSwiperWrap.classList.add('is-active'); } }; var _setCurrentOptionColorchip = function() { var oldColorchip = parentWrap.selectColorchipWrap.querySelector('.accessories__colorchip.is-active'), oldColorchipIndex = parentWrap.selectColorchipList.indexOf(oldColorchip); var activeColorchip = target.colorchipList.querySelectorAll('button'), prevColor = oldColorchip.getAttribute('data-color'), currentColor = activeColorchip[oldColorchipIndex].getAttribute('data-color'); if (prevColor == currentColor) { currentOptionColorchip = activeColorchip[oldColorchipIndex]; } else { currentOptionColorchip = target.colorchipList.querySelector('button.is-active'); } return currentOptionColorchip; }; var _slideMove = function() { var swiperContainer = target.activeSwiperContainer, pagination = swiperContainer.swiperProperty.pagination, colorchips = pagination.querySelectorAll('.accessories__colorchip'), colorchipIndex = [].indexOf.call(colorchips, _setCurrentOptionColorchip()); swiperContainer.swiper.slideTo((colorchipIndex + 1), 0, false); }; var optionList = parentWrap.querySelectorAll('.accessories__product-option-item'); if (optionList.length > 1) { _setCurrentOption(); swiperEvents.destroy(oldSwiper.swiper); setSwiper(target.activeSwiperContainer); colorchipEvent.colorChange(_setCurrentOptionColorchip()); _slideMove(); if (!target.activeSwiperContainer.classList.contains('swiper-container-initialized')) { var targetImg = target.activeSwiperContainer.querySelectorAll('.accessories__product-image>img'); if (!targetImg[0].classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia(targetImg); } } } }, colorChange: function(targetColorchip) { var target = targetColorchip.accProperty, parentWrap = target.parentWrap; var activeColor = targetColorchip.getAttribute('aria-label'), activeColorCtaUrl = targetColorchip.getAttribute('data-url'), optionList = parentWrap.querySelectorAll('.accessories__product-option-item'), oldColorchip; if (optionList.length > 1) { oldColorchip = parentWrap.querySelector('.swiper-pagination-wrap.is-active .is-active'); } else { oldColorchip = parentWrap.querySelector('.swiper-pagination-wrap .is-active'); } if (!targetColorchip.classList.contains('is-active')) { oldColorchip.classList.remove('is-active'); oldColorchip.setAttribute('aria-selected', false); targetColorchip.classList.add('is-active'); targetColorchip.setAttribute('aria-selected', true); } target.currentColor.innerText = activeColor; var _setCta = function() { if (!!target.cta) { if (activeColorCtaUrl == '#') { target.ctaWrap.style.visibility = 'hidden'; target.ctaWrap.setAttribute('tabindex', -1); target.ctaWrap.setAttribute('aria-hidden', true); } else { target.ctaWrap.style.visibility = ''; target.ctaWrap.removeAttribute('tabindex'); target.ctaWrap.removeAttribute('aria-hidden'); } } }; var _setTagging = function() { if (!!target.cta) { var dataOmni = target.cta.getAttribute('data-omni').split(':')[4], gala = target.cta.getAttribute('ga-la').split(':')[4], currColor = targetColorchip.getAttribute('data-color'); if (target.parentWrap.querySelector('.accessories__product-option')) { var optionDataOmni = target.cta.getAttribute('data-omni').split(':')[2].split('-').reverse()[0], optionGala = target.cta.getAttribute('data-omni').split(':')[2].split('-').reverse()[0], currOption = target.parentWrap.querySelector('.accessories__product-option .is-active').innerText; target.cta.setAttribute('data-omni', target.cta.getAttribute('data-omni').replace(optionDataOmni, currOption)); target.cta.setAttribute('ga-la', target.cta.getAttribute('ga-la').replace(optionGala, currOption)); } target.cta.setAttribute('href', activeColorCtaUrl); target.cta.setAttribute('data-omni', target.cta.getAttribute('data-omni').replace(dataOmni, currColor)); target.cta.setAttribute('ga-la', target.cta.getAttribute('ga-la').replace(gala, currColor)); } }; _setCta(); _setTagging(); }, slideTo: function(targetColorchip) { var target = targetColorchip.accProperty, parentWrap = target.parentWrap, swiperContainer; if (parentWrap.querySelector('.accessories__options')) { swiperContainer = parentWrap.querySelector('.swiper-container-wrap.is-active .swiper-container'); } else { swiperContainer = parentWrap.querySelector('.swiper-container'); } if (swiperContainer.swiper != null) { var colorchipList; if (parentWrap.querySelector('.accessories__colors-wrap')) { var colorchipListWrap = parentWrap.querySelector('.accessories__colors-wrap .swiper-pagination-wrap.is-active') colorchipList = Array.prototype.slice.call(colorchipListWrap.querySelectorAll('.accessories__colorchip')); } else { colorchipList = Array.prototype.slice.call(parentWrap.querySelectorAll('.accessories__colorchip')); } var index = colorchipList.indexOf(targetColorchip); swiperContainer.swiper.slideTo((index + 1), 500, false); status.isClick = false; } }, }; var swiperEvents = { init: function() { var notification = this.el.querySelector('.swiper-notification'); if (!!notification) this.el.removeChild(notification); if (!this.el.classList.contains('is-slide')) { var cloneSlides = this.el.querySelectorAll('.swiper-slide-duplicate'); for (var i = 0; i < cloneSlides.length; i++) { var cloneId = cloneSlides[i].getAttribute('id'); cloneSlides[i].setAttribute('id', cloneId + '-clone'); } } var activeSlideImg = this.slides[this.activeIndex].querySelectorAll('img'), prevSlideImg = this.slides[this.activeIndex - 1].querySelectorAll('img'), nextIndex = (this.activeIndex < this.slides.length - 1) ? (this.activeIndex + 1) : 0, nextSlide = this.slides[nextIndex], nextSlideImg = nextSlide.querySelectorAll('img'); if (activeSlideImg[0] && !activeSlideImg[0].classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia(activeSlideImg); } if (prevSlideImg[0] && !prevSlideImg[0].classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia(prevSlideImg); } if (nextSlideImg[0] && !nextSlideImg[0].classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia(nextSlideImg); } var pagination = this.el.swiperProperty.pagination, colorchips = pagination.querySelectorAll('.accessories__colorchip'), activeColorchip = pagination.querySelector('.accessories__colorchip.is-active'), colorchipIndex = [].indexOf.call(colorchips, activeColorchip); if (colorchipIndex != 0) { this.slideTo((colorchipIndex + 1), 0, false); } accessibility.slide.call(this); }, slideChange: function() { if (!status.isClick && !this.el.classList.contains('is-slide')) { var activeIndex = this.realIndex, activeColorchipWrap = this.el.swiperProperty.pagination, activeColorchip = activeColorchipWrap.querySelectorAll('.accessories__colorchip'); colorchipEvent.colorChange(activeColorchip[activeIndex]); } var activeSlideImg = this.slides[this.activeIndex].querySelectorAll('img'), nextIndex = (this.activeIndex < this.slides.length - 1) ? (this.activeIndex + 1) : 0, nextSlide = this.slides[nextIndex], nextSlideImg = nextSlide.querySelectorAll('img'); if (activeSlideImg[0] && !activeSlideImg[0].classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia(activeSlideImg); } if (nextSlideImg[0] && !nextSlideImg[0].classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia(nextSlideImg); } accessibility.slide.call(this); }, slideChangeTransitionEnd: function() { status.isClick = false; }, destroy: function(target) { target.destroy(); } } var setSwiper = function(target) { var targetProperty = target.swiperProperty; if (targetProperty && !target.swiper) { var swiper = new Swiper(target, { init: false, slidesPerView: 'auto', loop: true, loopedSlides: 1, navigation: { nextEl: targetProperty.nextArrow, prevEl: targetProperty.prevArrow }, touchRatio: 0.5, allowTouchMove: !!target.classList.contains('is-slide') || (utils.detector.isTouchDevice || (currDevice && currDevice.indexOf('mobile') > -1)) ? true : false }); swiper.on('init', swiperEvents.init); swiper.on('slideChange', swiperEvents.slideChange); swiper.on('slideChangeTransitionEnd', swiperEvents.slideChangeTransitionEnd); swiper.init(); } }; var accessibility = { slide: function() { for (var i = 0; i < this.slides.length; i++) { if (i != this.activeIndex) { this.slides[i].setAttribute('aria-hidden', true); this.slides[i].setAttribute('tabindex', -1); } else { this.slides[i].setAttribute('aria-hidden', false); this.slides[i].removeAttribute('tabindex'); } } } }; return { init: init } })();})();;(function() { window.flagship.accessories = window.flagship.accessories || {}; flagship.accessories.matchHeight = (function() { var els = {}; resize = window.flagship.common.resize, currDevice = resize.checkResolution(); var arrays = { productItemArr: [] }; var init = function() { els.section = document.querySelector('#accessories'); if (!!els.section) { setElements(); bindEvents(); } }; var setElements = function() { els.productList = els.section.querySelectorAll('.accessories__product-list'); els.productLists = Array.prototype.slice.call(els.productList); }; var bindEvents = function() { window.addEventListener('DOMContentLoaded', onLoadHandler, { once: true }); resize.add(onResizeHandler); }; var onResizeHandler = function(currRes) { currDevice = currRes; if (currDevice == null || currDevice.indexOf('mobile') < 0) { matchHeight.setHeight(); } }; var onLoadHandler = function() { if (currDevice == null || currDevice.indexOf('mobile') < 0) { matchHeight.setHeight(); } }; var matchHeight = { setList: function() { var listItems = null; for (var i = 0; i < els.productLists.length; i++) { listItems = Array.prototype.slice.call(els.productLists[i].querySelectorAll('.accessories__product-item')); arrays.productItemArr.push(listItems); } }, setHeight: function() { matchHeight.setList(); var title = null, desc = null, lineCta = null; arrays.productItemArr.forEach(function(productItem) { var itemArr = [], titleArr = [], descArr = [], lineCtaArr = [], maxTitle = 0, maxDesc = 0, maxLineCta = 0; productItem.forEach(function(item) { title = item.querySelector('.accessories__product-title'); desc = item.querySelector('.accessories__product-description'); lineCta = item.querySelector('.accessories__product-cta--underline'); itemArr.push(item); if (title != null) { title.style.height = ''; titleArr.push(title.clientHeight); } if (desc != null) { desc.style.height = ''; descArr.push(desc.clientHeight); } if (lineCta != null) { lineCta.style.height = ''; lineCtaArr.push(lineCta.clientHeight); } }); itemArr = itemSlice(itemArr, 2); titleArr = itemSlice(titleArr, 2); descArr = itemSlice(descArr, 2); lineCtaArr = itemSlice(lineCtaArr, 2); for (var i = 0; i < itemArr.length; i++) { maxTitle = titleArr[i].reduce(function(prev, titleArr) { return Math.max(prev, titleArr); }); maxDesc = descArr[i].reduce(function(prev, descArr) { return Math.max(prev, descArr); }); if (lineCtaArr[i] != null) { maxLineCta = lineCtaArr[i].reduce(function(prev, lineCtaArr) { return Math.max(prev, lineCtaArr); }); } for (var j = 0; j < itemArr[i].length; j++) { if (maxTitle != itemArr[i][j].querySelector('.accessories__product-title').clientHeight) { itemArr[i][j].querySelector('.accessories__product-title').style.height = maxTitle + 'px'; } if (maxDesc != itemArr[i][j].querySelector('.accessories__product-description').clientHeight) { itemArr[i][j].querySelector('.accessories__product-description').style.height = maxDesc + 'px'; } if (itemArr[i][j].querySelector('.accessories__product-cta--underline') != null && maxLineCta != itemArr[i][j].querySelector('.accessories__product-cta--underline').clientHeight) { itemArr[i][j].querySelector('.accessories__product-cta--underline').style.height = maxLineCta + 'px'; } } } }); } }; var itemSlice = function(data, size) { var arr = []; for (var i = 0; i < data.length; i += size) { arr.push(data.slice(i, i + size)); } return arr; }; return { init: init } })();})();(function() { window.flagship = window.flagship || {}; window.flagship.accessories = window.flagship.accessories || {}; window.flagship.accessories.ytPopup = (function() { var els = {}, utils = window.flagship.common.utils; var init = function() { els.layerPopup = document.querySelector('.youtube-layer-popup'); if (!!els.layerPopup) { setElements(); setPopup(); els.layerPopup.addEventListener('click', eventList.clickDimmed); } }; var setElements = function() { els.contents = document.querySelector('#contents'); els.openCtas = document.querySelectorAll('.js-youtube-popup'); els.closeCta = document.querySelector('.youtube-layer-popup__close-cta'); els.ytIframe = els.layerPopup.querySelector('.youtube-layer-popup__iframe > iframe'); els.ytDesc = els.layerPopup.querySelector('.youtube-player__desc'); } var setPopup = function() { for (var i = 0; i < els.openCtas.length; i++) { utils.layerPopup({ layerPopup: els.layerPopup, openerEvent: { element: els.openCtas[i], }, closeCta: els.closeCta, moveTarget: document.documentElement, contents: els.contents, show: { start: function() { els.layerPopup.removeAttribute('tabindex'); els.layerPopup.removeAttribute('aria-hidden'); els.layerPopup.classList.add('is-yt-open'); }, end: function(target) { eventList.setYoutube(target); target .openerCta .blur(); } }, hide: { start: function (target) { if (utils.detector.isIosDevice) target.openerCta.style.display = ''; els.layerPopup.setAttribute('tabindex', -1); els.layerPopup.setAttribute('aria-hidden', true); els.layerPopup.classList.remove('is-yt-open'); }, end: function (target) { eventList.clearYoutube(); target .openerCta .focus(); } } }); } }; var eventList = { setYoutube: function(target) { var opener = target.openerCta, ytSrc = 'htt' + 'ps://www.youtube.com/embed/' + opener.getAttribute('data-youtube-id') + '?wmode=opaque&rel=0&enablejsapi=1&version=3&autoplay=1', ytTitle = opener.getAttribute('data-youtube-title'), ytBlind = opener.querySelector('.blind').innerHTML; els.ytIframe.setAttribute('src', ytSrc); els.ytIframe.setAttribute('title', ytTitle); els.ytDesc.innerHTML = ytBlind; els.OpenerTarget = opener; }, clearYoutube: function() { els.ytIframe.removeAttribute('src'); els.ytDesc.innerHTML = ''; }, clickDimmed: function(e) { if (e.target.classList.contains('youtube-layer-popup__inner') || e.target.classList.contains('youtube-layer-popup__close-area')) { if (utils.detector.isIosDevice) els.OpenerTarget.style.display = ''; els.layerPopup.classList.remove('is-yt-open'); document.documentElement.classList.remove('is-layer-open'); document.documentElement.style.overflow = ''; utils.visibleScroll(); utils.onAccessibility(els.layerPopup); utils.offAccessibility(document.querySelector('#wrap')); setTimeout(function() { els.OpenerTarget.focus(); }, 300); eventList.clearYoutube(); } } }; return { init: init, } })();})();(function() { window.flagship.common.resize.bindEvent(); var initComponents = function() { flagship.accessories.colorchip.init(); flagship.accessories.matchHeight.init(); flagship.accessories.ytPopup.init(); }; initComponents();})(); });