Galaxy Z Flip6
- SPECIFICATIONS
- REVIEWS
Buy now
- Features
- Accessories
- FAQ
- SPECIFICATIONS
- REVIEWS
Get £100 - £640 off when you trade in an Android smartphone*
Buy now Reserve now Pre-order now Where to buy
Galaxy AI is here
Your self-expression tool, Galaxy Z Flip6, is more compact and eye-catching, with Galaxy AI and a pro-level 50MP camera that's photoshoot-ready.
Slim & Compact Design
Jump to Design
FlexCam with Auto Zoom
Jump to FlexCam
Join the Global Conversation
Jump to Interpreter
50MP. New Camera. Stunning Portraits
Jump to Camera
All-day Battery Life
Jump to Performance
"Potentially the best software of any flip phone released so far"
"Bears all the hallmarks of a class-leading foldable"
"A flippin' great phone!"
"The Galaxy Z Flip 6 is an instantly desirable device"
MOST COMPACT
BIG IMPACT
Galaxy Z Flip6's new floating design is modern, slim and sleek, creating our most compact smartphone yet.
Colourful. Joyful. Wonderful
Find your favourite colour or choose from one of the online exclusive colours only on Samsung.com.
3d 360 viewer Online Exclusive
Blue Yellow Mint Silver Shadow Crafted Black Online Exclusive Colours White Online Exclusive Colours Peach Online Exclusive Colours
Angle Preset
*Online exclusive colours only available on Samsung.com.
Blue Yellow Mint Silver Shadow Crafted Black Online Exclusive Colours White Online Exclusive Colours Peach Online Exclusive Colours
Angle Preset
*Online exclusive colours only available on Samsung.com.
Galaxy AI is here on Galaxy Foldables
Galaxy AI
is here on Galaxy Foldables is here on Galaxy Foldables
INTERPRETER
Your superior interpreter experience with FlexWindow
Lost in translation? Galaxy Z Flip6 is your passport to communication — working as your personal interpreter.,
Tap to try
Tap to try
CHAT ASSIST
Chat flows, even when closed
Send messages directly from the FlexWindow with Chat Assist. Just select from one of the Suggested Replies — curated by context-aware AI.
Tap to try
Your window, your way
Chat with Google Gemini to supercharge your ideas
Thanks to Samsung's longstanding partnership with Google, your Galaxy now comes with the Google Gemini app. Chat with Gemini to get help learning in new ways, writing thank you notes, planning events and more.
Dive into the world of AI
Circle to Search
Simply circle an object or text to get Google Search results.
Live Translate
Get real-time voice translation on various apps when you make a call.
Transcript Assist
Transcribe your recorded conversations into editable text in a flash.
50MP. NEW CAMERA. STUNNING PORTRAITS
Captured by Galaxy Z Flip6 #withGalaxy
Nighttime portraits are lit
Capture stunning shots during the day but also at night — and even in dimly lit areas. Use Nightography to ensure every photo shines with detail, thanks to ProVisual Engine.
The most powerful camera on a Galaxy Z Flip, now with AI
The upgraded 50MP wide rear camera processes your pics through the ProVisual Engine to capture stunning scenes and richer portraits.,,,,,
ProVisual Engine
rear camera
-
50MP Wide 2x Optical Quality Zoom
-
12MP Ultra Wide
FlexCam. Capture your best angle
FlexCam uses Auto Zoom to either zoom in or out on subjects, and provides a preview on the FlexWindow for a hands-free selfie experience.
Captured by Galaxy Z Flip6 #withGalaxy
Rear cam portraits hit different
Use the FlexWindow to give your subjects a preview as you take their photo in 50 megapixels. Then, snap a pic to capture bright and detailed portraits even when backlit.
Captured by Galaxy Z Flip6 #withGalaxy
PHOTO ASSIST
Effortless editing. Courtesy of Galaxy AI
Generative Edit
Tap into your creativity with Generative Edit for Photo Assist to move, resize or delete whole objects from your photos and fill in the background where they used to be.
Instant Slow-mo
Put focus on key moments by applying slow motion to your videos and share or save it.
Captured by Galaxy Z Flip6 #withGalaxy
Live Effect
Add depth to give your pics all-new life.
Galaxy Z Flip's longest lasting battery
Meet our biggest Flip battery ever. Paired with Snapdragon® 8 Gen 3 for Galaxy, you can talk, text or game to your heart's content — all day long.,
4000 4000 mAh
- Listen to music up to
68 hrs
- Watch videos up to
23 hrs
The fastest Snapdragon on a Galaxy Z Flip yet,
First ever Vapour Chamber on a Galaxy Z Flip
Keep things cool, calm and running smoothly with a Vapour Chamber that dissipates heat quickly.
Why switch to the Galaxy
-
Simple switching from iOS
Switching from iOS is so easy! Thanks to Smart Switch, you can transfer your photos, videos, contacts and apps effortlessly.,,
Learn more
-
Seamless sharing
Send files, data and content between devices, including iOS and PCs. It's a quick and secure way to openly share.
-
Your privacy. Secured.
In Privacy and Security, quickly see which apps are accessing your information, then customise your settings. Plus, with Advanced Intelligence features, you can process data for AI services from your Galaxy device or on the cloud.
Durable. Reliable. Built to last
-
Reinforced Folding Edge
Fortified to withstand more pressure.
-
Engineered for endurance
Meet our slim and innovative FlexHinge.
-
Shielded in aluminium
Enhanced Armour Aluminium Frame keeps you protected.,
-
Truly tough
Great protection with Corning® Gorilla® Glass Victus® 2.
-
Stay water-resistant
IP48 water-resistance for those unexpected spills.
Samsung Care+
Certified care by Samsung experts.
Learn more
Try Galaxy on your phone
Experienced the newest Galaxy device yet? How about trying it out now? On your phone! Simply scan the QR code and download to begin.
Keep close, accurate tabs on your well-being with AI
Pair Galaxy Z Flip6 with the all-new Galaxy Watch Ultra or Galaxy Watch7 to track your Energy Score throughout the day.,
Samsung Health
Learn more
Accessories
Explore more
Frequently Asked Questions
-
Galaxy Z Flip6 comes in a mix of joyful colours including Blue, Yellow, Mint and Silver Shadow. Crafted Black, White and Peach are exclusive colours available only on Samsung.com.
Go to colours
-
Galaxy Z Flip6 comes equipped with various AI features for you to immerse yourself into including Suggested Replies, a new feature that suggests text messages using AI so you can respond even when Galaxy Z Flip6 is closed – perfect for when you’re on the go. Additional AI features include Live Translate and Interpreter. The camera also gets an AI upgrade by ProVisual Engine which applies optimised image quality to elements of the subject for more picture-perfect portraits.,,
Go to Galaxy AI
-
The Galaxy Z Flip6 comes equipped with a 50MP wide rear camera and ProVisual Engine for pictures that are brighter and more crisp. When taking portrait pictures, both you and your subject can preview the image thanks to the FlexWindow. You can even go fully hands-free with FlexMode making selfies easier than ever.,
Go to camera
-
FlexCam is designed to elevate the selfie experience by making it hands-free from the rear camera. Auto Zoom helps you effortlessly capture your best angle by zooming in or out on your subjects, and then provides a preview from the FlexWindow. AI zoom then ensures top quality for your pictures.,
Go to camera
-
Galaxy Z Flip6 is more compact and has a new and improved floating design compared to Galaxy Z Flip5, giving the effect that the display is floating on the frame. It also boasts a bold camera rail detail.,,
-
This feature can be accessed via the Settings. Once you have chosen your screen, you can customise the layout, how notifications will be displayed and choose various widgets.,,
Go to FlexWindow
-
Galaxy Z Flip6 has been built with a durable FlexHinge and has been fortified with Enhanced Amour Aluminium frame and Corning® Gorilla® Glass Victus® 2.,,,
Go to durability
-
Galaxy Z Flip6 has 4000mAh for an all-day battery life. Enjoy up to 68 hours of music or watch videos for up to 23 hours.,,
Go to battery
-
Galaxy Z Flip6 has 300mAh more battery capacity compared to Galaxy Z Flip5, a 50MP wide rear camera and the first ever Vapour Chamber cooling system on a Galaxy Z Flip.
Galaxy Z Fold6
Learn more
Check out smart ways to get your Galaxy Z Flip6
Buy now Reserve now Pre-order now Where to buy
Life opens up with Galaxy
Explore more
3d 360 viewer Online Exclusive
Blue Yellow Mint Silver Shadow Crafted Black Online Exclusive Colours White Online Exclusive Colours Peach Online Exclusive Colours
Angle Preset
*Online exclusive colours only available on Samsung.com.
Unfold a new era of business
Go to Samsung business
*Purchase from Samsung.com by 30/07/24. £100 value based on any android smartphone, in any condition. £640 value based on Galaxy S24 Ultra. Values over £100 vary by model and condition. Purchased phone will be blocked if you don't send us your Trade In device. T&Cs apply.
*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.
*Samsung Account login may be required to use certain Samsung AI features.
*Samsung does not make any promises, assurances or guarantees as to the accuracy, completeness or reliability of the output provided by AI features.
*Availability of Galaxy AI features may vary depending on the region/country, OS/One UI version, device model, and phone carrier.
*Galaxy AI features will be provided for free until the end of 2025 on supported Samsung Galaxy devices. Different terms may apply for AI features provided by third parties.
*Galaxy AI service may be limited for minors in certain regions with age restrictions over AI usage.
- Compared to previous Galaxy Z Flip models.
- Auto Zoom is available in FlexMode using the rear camera and will disengage if the zoom is manually adjusted. Limited in low-light conditions. May not work if the device is moving or if the subject is too close.
- Interpreter feature requires Samsung Account login. Certain languages may require language pack download. Service availability may vary by language. Accuracy of results is not guaranteed. Availability and supported features may vary by country, region or carrier. Availability of supported languages may vary.
- 50MP resolution is available on Galaxy Z Flip6’s rear wide camera only.
- Actual battery life may vary by network environment, features and apps used, frequency of calls and messages, the number of times charged, and many other factors. Estimated against the average usage profile compiled and independently assessed by UX Connect Research under default settings using LTE and 5G Sub6 networks.
- Thickness measured from top to bottom of the glass when unfolded.
- Colour availability may vary depending on country or carrier.
- Interpreter can be viewed from both the Main Screen and FlexWindow but this function must be manually enabled. Not available solely on the FlexWindow.
- Suggested Replies feature requires network connection to receive messages. It can suggest replies without network connection once the messages are received by the device. Samsung Account login required. Suggested Replies feature is only supported from the FlexWindow. Service availability may vary by language, country and app. Accuracy of results is not guaranteed.
- Sequences shortened and simulated. Results for illustrative purposes only. Service availability may vary by country, language, device model. Requires internet connection and Google Account login. Users may need to download or update Google Gemini app to the latest version. Check responses for accuracy. Gemini is a trademark of Google LLC. Gemini opt-in is rolling out to select devices and countries — opt in to Gemini from your Google Assistant or by downloading the Gemini app. Product functionality may be dependent on app and device settings. Some functions may not be compatible with certain apps. Accuracy of results is not guaranteed. Feature availability may vary by content.
- Sequences shortened and simulated. Results for illustrative purposes only. Service availability may vary by country, language, device model. Requires internet connection. Users may need to update Android and Google app to the latest version. Works on compatible apps and surfaces. Results may vary depending on visual matches. Accuracy of results is not guaranteed. Circle to Search is not available via the FlexWindow.
- Live Translate feature requires network connection to receive call messages. It can translate without network connection once the call messages are received by the device. Samsung Account login required. Live Translate feature is only available on pre-installed Samsung Phone apps and some third-party apps. Service availability may vary by language or region. Certain languages may require language pack download. Accuracy of results is not guaranteed.
- Transcription and Summary features for Transcript Assist require a network connection and Samsung Account login. Features for Transcript Assist only available on the pre-installed Samsung Voice Recorder app or files recorded using the pre-installed Samsung Phone app, Samsung Notes app or Samsung Interpreter app. Voice recording feature in the pre-installed Samsung Phone app may not be supported in some countries. Audio files must be under 3 hours in duration to be processed. Summarising feature for Transcript Assist can be activated when a certain number of characters is met. Service availability may vary by language. Accuracy of results is not guaranteed.
- Results may vary depending on light condition and/or shooting conditions including multiple subjects, being out of focus or moving subjects.
- Optical quality zoom is enabled by the Adaptive Pixel sensor.
- 2x zoom must be enabled in the Camera Assistant app settings. Camera Assistant can be downloaded from the Galaxy Store.
- AI Zoom is applied to distances between digital zoom lengths. Accuracy of results is not guaranteed.
- Generative Edit feature for Photo Assist requires a network connection and Samsung Account login. Editing with Generative Edit may result in a resized photo up to 12MP. A visible watermark is overlaid on the image output upon saving in order to indicate that the image is generated by AI. The accuracy and reliability of the generated output is not guaranteed.
- Instant Slow-mo feature for Photo Assist is available on Samsung Video Player and Samsung Gallery. May not be available on certain video file types. Accuracy of results not guaranteed.
- Live Effect feature for Photo Assist supports JPG, HEIC (HEIF), BMP, PNG and WebP files. May not be available on certain photos. The accuracy and reliability of the generated output is not guaranteed.
- Snapdragon branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries.
- Only on Galaxy Z Series.
- Typical value tested under third-party laboratory condition. Typical value is the estimated average value considering the deviation in battery capacity among the battery samples tested under IEC 61960 standard. Rated capacity is 3887mAh for Galaxy Z Flip6. Actual battery life may vary depending on network environment, usage patterns and other factors.
- Based on Samsung internal lab test conditions with pre-release version of given model connected to earphone via Bluetooth under default settings over LTE. Estimated against battery capacity and measured current over battery power consumption during video playback (video file resolution 720p, saved on device) and audio playback (mp3 file, 192kbps, saved on device with LCD display turned off), respectively. Actual video and audio playback times vary by network connection, settings, file format, screen brightness, battery condition and many other factors.
- Wired transfers from Android™ devices require the receiving device to have Android™ 4.3 or later and the sending device to have Android 4.3™ or later. Transfers can be completed without a cable through a wireless connection. For wireless connections, the receiving device must have Android™ 4.0 or later and the sending device must have Android™ 4.0 or later. Open Smart Switch Mobile in “Settings” on the receiving Galaxy device or download the Smart Switch Mobile app from the Galaxy Store. Data, content and apps available for transfer may vary by transmission method.
- Wired transfers from iOS require the receiving device to have Android™ 4.3 or later and the sending device to have iOS 5 or later. Transfers can be completed without a cable through a wireless connection or iCloud. For wireless connections, the receiving device must have Android™ 4.0 or later and the sending device must have iOS 12 or later. iCloud transfers require the receiving device to have Android™ 4.0 or later and the sending device to have iOS 5 or later. Open Smart Switch Mobile in “Settings” on the receiving Galaxy device or download the Smart Switch Mobile app from the Galaxy Store. For wireless transfers, download Smart Switch for iOS from the App Store on your iPhone or iPad. Data, content and apps available for transfer may vary by transmission method. Contacts, gallery, videos, calendars and reminders can be transferred wirelessly from an iOS device.
- It is recommended to use a wired connection when transferring diverse sets of data at once.
- Quick Share feature between Galaxy devices available with the following OS: smartphones and tablets with Android OS version 10.0 (Q) and One UI 2.1 or above, PCs running Windows 10 or later. Requires Samsung Account login and Wi-Fi and Bluetooth connection. Quick Share to iOS and Android devices available by sending shared link: individual files shared cannot exceed 5GB (for a total of 5GB per day) and link will expire after two days; requires a Samsung Account login and internet connection.
- Armor Aluminium Frame does not include volume and side keys or SIM tray.
- Compared to previous models.
- Corning® Gorilla® Glass Victus® 2 is applied to the front and rear of the device.
- Based on lab test conditions for submersion in up to 1.5 meters of freshwater for up to 30 minutes and for protection against a solid object greater than 1mm such as a wire. Not advised for beach or pool use. Water resistance of device is not permanent and may diminish over time because of normal wear and tear. Not dust- or sand-resistant.
- Samsung Care+ coverage, service type and promotion details may vary by country/region and deductible (service fee) may apply. To be eligible for Samsung Care+ promotion benefit, registration may be required. For detailed Samsung Care+ information, please visit https://www.samsung.com/samsung-care-plus/.
- Energy Score is available on Android phones (Android 11 or above) and requires Samsung Health app (v6.27 or above). Samsung Account login required. Service availability may vary by country or region. To check the Energy Score, the health data tracked from Samsung Galaxy Watch or Samsung Galaxy Ring must be synchronized with the Samsung Health App. Needs at least the previous day’s activity data and sleep, and heart rate data during sleep. Not intended for use in detection, diagnosis, treatment of any medical condition. The result is for your personal reference only. Please consult a medical professional for advice.
- Galaxy Watch Ultra and Galaxy Watch7 devices sold separately.
- Measured diagonally, Galaxy Z Flip6's Main Screen size is 6.7” in the full rectangle and 6.6” accounting for the rounded corners; actual viewable area is less due to the rounded corners and camera hole.
- Measured diagonally, Galaxy Z Flip6's Cover Screen size is 3.4” in the full rectangular form; actual viewable area is approximately 95% of the full rectangular area due to the rounded corners and lower cutout.
- Certain applications may not support FlexWindow widgets.
- Generative content features require a network connection and Google Account login. The accuracy and reliability of the generated output is not guaranteed. Feature availability may vary by model.
- Photo Ambient feature requires network connection to receive the weather data. It can reflect the weather data without network connection once the data is received by the device. Reflection of real-time weather conditions may be delayed as service relies on local weather information updates. Certain indoor, nighttime and low-resolution photos may not be compatible. The accuracy and reliability of the generated output is not guaranteed. Service is currently only available on Galaxy S24 Series, Galaxy Z Flip6 and Galaxy Z Fold6. Feature availability may vary by model.
')); } } }; const isZoom = function () { let zoomLevel = 100 / ((window.innerWidth / window.outerWidth) * 100); if (zoomLevel > 1.7) { document.documentElement.classList.add('browser-zoomed-175'); } else { document.documentElement.classList.remove('browser-zoomed-175'); } if (zoomLevel > 3) { document.documentElement.classList.add('browser-zoomed-300'); } else { document.documentElement.classList.remove('browser-zoomed-300'); } if (zoomLevel > 4) { document.documentElement.classList.add('browser-zoomed-400'); } else { document.documentElement.classList.remove('browser-zoomed-400'); } }; const getViewerUrl = function () { let defaultParams = '', viewerSection = document.querySelector('.js-colors-viewer'), viewerButton = document.querySelector('.viewer-btn'), viewerModel = utils.isLowNetwork() ? viewerButton.getAttribute('data-model-name') : viewerSection.getAttribute('data-model-name'), viewerColor = utils.isLowNetwork() ? viewerButton.getAttribute('data-model-color') : viewerSection.getAttribute('data-model-color'), viewerUrl = '//www.samsung.com/global/galaxy/3d-360/viewer/?'; defaultParams = '&gesture_guide=0'; defaultParams += '&bgcolor=transparent'; defaultParams += '&skin=colorlayer'; defaultParams += '&theme=roundlayer'; defaultParams += '&auto_rotation=0'; defaultParams += '&intro=1'; defaultParams += '&ruler=1'; defaultParams += '&breakpoint_criteria=outer'; defaultParams += '&breakpoint_desktop_width=1024'; defaultParams += '&x=180'; defaultParams += '&intro_pose=3'; defaultParams += '&intro_pose_hold=1'; defaultParams += '&intro_pose_hold_limit=9999999'; defaultParams += '&controls=0'; defaultParams += '&use_zoom=0'; defaultParams += '&use_pan=0'; defaultParams += '&screen_mode=on'; // model_name viewerUrl += 'model_name=' + viewerModel; if (document.documentElement.classList.contains('color_yb') || (utils.getCookie('highContrastMode') != null && utils.getCookie('highContrastMode') == 1)) { viewerUrl += '&highcontrast=1'; } else { viewerUrl += '&highcontrast=0'; } // RTL utils.isRTL() && (viewerUrl += '&rtl=1'); viewerUrl += defaultParams; viewerUrl += '#color=' + (viewerColor ? viewerColor : 'null'); return viewerUrl; }; return { addLoadStatusClass: addLoadStatusClass, setResolution: setResolution, clickSup: clickSup, centeredFocus: centeredFocus, setArBanner: setArBanner, isZoom: isZoom, getViewerUrl: getViewerUrl, }})();flagship.features.setting = (function () { const resize = window.flagship.common.resize, common = window.flagship.features.common, utils = window.flagship.common.utils, agent = navigator.userAgent.toLowerCase(), maxOs = agent.indexOf('mac os') > -1, touchDevice = ('ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch)), isGlobal = document.documentElement.classList.contains('global'); let els = {}; const init = function () { common.addLoadStatusClass(); common.setArBanner(); setElements(); bindEvents(); setResize(); if (!maxOs && !touchDevice) { setScrollControl(); } setImageLoader(); setVideoLoader(); setMp4VideoLoader(); setCenteredfocus(); setDisclaimerNumber(); setDisclaimer(); setVideoTheme(); setVideoBlind(); common.isZoom(); resize.add(common.isZoom); }; const setElements = function () { // video els.videoWrap = document.querySelectorAll('.js-video-wrap'); }; const bindEvents = function () { window.addEventListener('load', anchorPosition); window.addEventListener('hashchange', anchorPosition); }; const anchorPosition = function () { if (window.location.hash != '') { let hash = location.hash.split('#')[1], hashSection = document.querySelector('#contents #' + hash), hashTimeout = null; clearTimeout(hashTimeout); hashTimeout = setTimeout(function () { let sectionTop = hashSection.getBoundingClientRect().top, navHeight = utils.getNavHeight(), hashScroll = window.pageYOffset + sectionTop - navHeight; window.scrollTo(0, hashScroll); }, 300); } }; const setResize = function () { resize.init([{ resolution: 1920, resolutionName: 'desktop', eventFunction: '' }, { resolution: 1023, resolutionName: 'tablet', eventFunction: '' }, { resolution: 767, resolutionName: 'mobile', eventFunction: '' }, { resolution: 320, resolutionName: 'mobileS', eventFunction: '' }], 200); resize.add(common.setResolution); }; const setScrollControl = function () { window.scrollController = utils.scrollController(); scrollController.init({ speed: 120, duration: 0.6 }); }; const setImageLoader = function () { window.imageLoader = utils.mediaLoader({ lazyClass: '.js-img-src', responsiveClass: '.js-res-img', preset: 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: 2 }); window.bgLoader = utils.mediaLoader({ type: 'bgImage', lazyClass: '.js-bg-img', loadOption: [{ resolution: 1920, attribute: '', bgOpts: '' }], visiblePoint: 2 }); }; const setVideoLoader = function () { window.videoLoader = utils.mediaLoader({ type: 'video', lazyClass: '.js-video-src', responsiveClass: '.js-res-video', preset: isGlobal ? '' : '?imbypass=true', loadOption: [{ resolution: 1920, attribute: 'data-video-src-pc' }, { resolution: 1023, attribute: 'data-video-src-tb' }, { resolution: 767, attribute: 'data-video-src-mo' }, { resolution: 360, attribute: 'data-video-src-mo-s' }], visiblePoint: 1, endCallback: function (video) { if (!!video.videoHandler && !video.videoHandler.wrap.classList.contains('is-loaded')) { video.videoHandler.wrap.classList.add('is-loaded'); } } }); }; const setMp4VideoLoader = function () { window.mp4VideoLoader = utils.mediaLoader({ type: 'mp4Video', lazyClass: '.js-mp4-video-src', responsiveClass: '.js-res-video', preset: isGlobal ? '' : '?imbypass=true', loadOption: [{ resolution: 1920, attribute: 'data-video-src-pc' }, { resolution: 1023, attribute: 'data-video-src-tb' }, { resolution: 767, attribute: 'data-video-src-mo' }, { resolution: 360, attribute: 'data-video-src-mo-s' }], visiblePoint: 1, endCallback: function (video) { if (!!video.videoHandler && !video.videoHandler.wrap.classList.contains('is-loaded')) { video.videoHandler.wrap.classList.add('is-loaded'); } } }); }; const setCenteredfocus = function () { els.contents = document.querySelector('#contents'); els.allClickables = els.contents.querySelectorAll('a, button, input, select'); for (let i = 0; i < els.allClickables.length; i++) { els.allClickables[i].addEventListener('focusin', common.centeredFocus); } }; const setDisclaimerNumber = function () { const supTag = document.querySelectorAll('.click_sup'), btmDicl = document.querySelectorAll('li.common-bottom-disclaimer__list-item'); let btmDiclArr = []; for (let i = 0; i < btmDicl.length; i++) { let dataSup = btmDicl[i].getAttribute('data-sup'); btmDiclArr.push(dataSup); } for (let j = 0; j < supTag.length; j++) { let dataSupTag = supTag[j].getAttribute('data-sup-tag'); let supChildCount = supTag[j].parentElement.childElementCount; if (btmDiclArr.indexOf(dataSupTag) > -1) { supTag[j].innerText = btmDiclArr.indexOf(dataSupTag) + 1; } else { if (supChildCount == 1) { supTag[j].parentElement.remove(); } else { let supParent = supTag[j].parentElement.childNodes; let supArr = []; for (let supIndex = 0; supIndex < supParent.length; supIndex++) { supArr.push(supParent[supIndex]); } let index = supArr.indexOf(supTag[j]); if (index != 0 && index % 2 == 0) { supParent[index].remove(); supParent[index - 1].remove(); } else { if (index != supArr.length) supParent[index + 1].remove(); supParent[index].remove(); } } } } }; const setDisclaimer = function () { els.supClicker = document.querySelectorAll('a.click_sup'); for (let i = 0; i < els.supClicker.length; i++) { els.supClicker[i].addEventListener('click', common.clickSup); } }; const setVideoTheme = function () { for (let i = 0; i < els.videoWrap.length; i++) { let colorType = els.videoWrap[i].getAttribute('data-theme-type'); if (colorType === 'white') { els.videoWrap[i].classList.add('common-video--white'); } else if (colorType === 'black') { els.videoWrap[i].classList.add('common-video--black'); } } }; const setVideoBlind = function () { for (let i = 0; i < els.videoWrap.length; i++) { let controlBlind = els.videoWrap[i].querySelector('.js-video-control .blind'); controlBlind.innerHTML = (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) ? LOCAL_VARI.play : 'play'; } }; return { init: init }})();flagship.features.setting.init();(function () { window.flagship.features.clickToVideo = (function () { const utils = window.flagship.common.utils; let els = { clickToVideosWrap: [], clickToVideo: [], }; const init = function () { els.clickToVideosWrap = document.querySelectorAll('.js-click-video'); if (els.clickToVideosWrap.length > 0) { setProperty(); bindEvents(); } }; const setProperty = function () { for (let i = 0; i < els.clickToVideosWrap.length; i++) { els.clickToVideosWrap[i].video = els.clickToVideosWrap[i].querySelector('video'); els.clickToVideosWrap[i].controller = els.clickToVideosWrap[i].querySelector('.js-video-control'); els.clickToVideosWrap[i].controller.video = els.clickToVideosWrap[i].video; } }; const bindEvents = function () { eventList.setVideo(); eventHandler.click(); }; const eventHandler = { click: function () { for (let i = 0; i < els.clickToVideosWrap.length; i++) { els.clickToVideosWrap[i].controller.addEventListener('click', eventList.clickVideoCta); } } }; const eventList = { setVideo: function () { for (let i = 0; i < els.clickToVideosWrap.length; i++) { els.clickToVideo[i] = utils.videoHandler({ wrap: els.clickToVideosWrap[i], video: els.clickToVideosWrap[i].video, controller: els.clickToVideosWrap[i].controller, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); } if (this.wrap.classList.contains('is-started')) { this.wrap.classList.remove('is-started'); } }, playCallback: function () { if (!this.wrap.classList.contains('is-started')) { this.wrap.classList.add('is-started'); } setTagging.pause(this.controller); }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } } }); } }, clickVideoCta: function (e) { if (e.target == e.currentTarget) { if (e.currentTarget.video.paused) { e.currentTarget.video.play(); } else { e.currentTarget.video.pause(); } } } }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } } }; return { init: init } })();})();(function () { window.flagship.features.headline = (function () { const utils = window.flagship.common.utils; let els = {}; const init = function () { setElements(); bindEvents(); }; const setElements = function() { els.moveText = document.querySelectorAll('.js-move-text'); }; const bindEvents = function () { eventList.setScene(); eventHandler.scroll(); eventList.scroll(); }; const eventHandler = { scroll: function () { window.addEventListener('scroll', eventList.scroll); } }; const eventList = { scroll: function () { for (let i = 0; i < els.moveText.length; i++) { els.moveText[i].sceneObj.trackAnimation(function () { let progressRange = !!this.trackElement.classList.contains('features-high-resolution__img-bottom') ? -60 : -10; let moveRange = !!this.trackElement.classList.contains('features-high-resolution__img-bottom') ? -55 : -5; if (this.progress >= progressRange && this.progress <= 100) { if(this.progress >= moveRange) { els.moveText[i].classList.add('is-moved'); if (this.trackElement.classList.contains('common-description')) this.trackElement.style.transitionDelay = "0.2s"; } if(this.progress <= moveRange) { els.moveText[i].classList.remove('is-moved'); } } }); } }, setScene: function () { for(let i = 0; i < els.moveText.length; i++) { els.moveText[i].sceneObj = SCROLLER({ trackElement: els.moveText[i], useFixed: false, useStrictMode: false }); } } }; return { init: init } })();})();(function () { window.flagship = window.flagship || {}; window.flagship.features = window.flagship.features || {}; window.flagship.features.oneColumnCarousel = (function () { const utils = window.flagship.common.utils; const resize = window.flagship.common.resize; let els = {}; let prevDevice; let currDevice = resize.checkResolution(); let dimmedClass = 'is-dimmed'; const isRtl = document.documentElement.classList.contains('rtl'); const init = function () { els.section = document.querySelectorAll('.js-one-column-carousel'); if (!!els.section) { setElements(); setProperty(); bindEvents(); } }; const setElements = function () { for (let i = 0; i < els.section.length; i++) { els.section[i].swiperContainer = els.section[i]; els.section[i].swiperSlides = els.section[i].swiperContainer.querySelectorAll('.swiper-slide'); els.section[i].prevArrow = els.section[i].parentElement.querySelector('.swiper-button-prev'); els.section[i].nextArrow = els.section[i].parentElement.querySelector('.swiper-button-next'); els.section[i].scrollbar = els.section[i].parentElement.querySelector('.swiper-scrollbar'); } }; const setProperty = function() { for (let i = 0; i < els.section.length; i++) { let isSlideLength = els.section[i].swiperSlides.length; for (let j = 0; j < isSlideLength; j++) { els.section[i].swiperSlides[j].video = els.section[i].swiperSlides[j].querySelector('.common-video__video'); } } } const bindEvents = function () { eventList.load(); resize.add(eventList.resize); }; const eventList = { load: function() { swiperEvents.set(); for (let i = 0; i < els.section.length; i++) { els.section[i].swiper.init(); if (els.section[i].swiperSlides.length >= 2) { els.section[i].swiper.init(); } } }, resize: function() { currDevice = resize.checkResolution(); if (prevDevice != currDevice) { eventList.responsive(); prevDevice = currDevice; }; }, responsive: function() { for (let i = 0; i < els.section.length; i++) { eventList.resetDimmedSlide(els.section[i].swiper); els.section[i].swiper.slideTo(0, false); if (eventList.getCarouselSizeInfo(els.section[i].swiper).viewLength > 0 && currDevice != 'mobile') eventList.initDimmedSlides(els.section[i].swiper); } }, setMedia: function(swiper, index) { let isIndex = index + 1 > swiper.slides.length -1 ? swiper.slides.length -1 : index + 1; let videoLength = swiper.el.querySelectorAll('video').length - 1; let imageLength = swiper.el.querySelectorAll('img').length - 1; let videoloadComplateLength = swiper.el.querySelectorAll('.is-video-load-complete').length - 1; let imageloadComplateLength = swiper.el.querySelectorAll('.is-img-load-complete').length - 1; let nextVideo = swiper.slides[isIndex].querySelector('video'); let nextImage = swiper.slides[isIndex].querySelector('img'); if (videoloadComplateLength != videoLength) { if (!!nextVideo) { videoLoader.setResponsiveMedia([nextVideo]); } } if (imageloadComplateLength != imageLength) { if (!!nextImage) { imageLoader.setResponsiveMedia([nextImage]); } } }, resetVideo: function(swiper) { for (let i = 0; i < swiper.slides.length; i++) { let isVideo = swiper.slides[i].video; if (!!isVideo && !isVideo.paused) { isVideo.pause(); isVideo.currentTime = 0; }; }; }, getCarouselSizeInfo: function(swiper) { let slideLength = swiper.slides.length; let slideWidth = swiper.slides[0].clientWidth; let slideMargin = parseInt(window.getComputedStyle(swiper.slides[0]).margin.split(' ')[isRtl ? 3 : 1]); let slideSize = slideWidth + slideMargin; let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiper.wrapperEl.clientWidth; let viewWidth = swiper.wrapperEl.clientWidth; let viewLength = parseInt((viewWidth + slideMargin)/slideSize); let lastBeforeSize = slideLength == 2 ? 0 : Math.abs((maxMoveSize - slideSize)) + Math.abs((viewWidth - slideWidth)); let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiper.wrapperEl).transform.split(',')[4])); return { slideWidth: slideWidth, slideMargin: slideMargin, slideSize: slideSize, maxMoveSize: maxMoveSize, viewWidth: viewWidth, viewLength: viewLength, lastBeforeSize: lastBeforeSize, isMoveSize: isMoveSize } }, initDimmedSlides: function(swiper) { for (let i = 0; i < swiper.slides.length; i++) { if ((swiper.activeIndex + eventList.getCarouselSizeInfo(swiper).viewLength) <= i) { swiper.slides[i].classList.add(dimmedClass); } } }, setDimmedSlide: function(swiper) { if (currDevice != 'mobile') { for (let i = 0; i < swiper.slides.length; i++) { let dimmedSlide = (swiper.activeIndex) > i || (swiper.activeIndex + (eventList.getCarouselSizeInfo(swiper).viewLength - 1)) < i; if (dimmedSlide) { swiper.slides[i].classList.add(dimmedClass); } else { swiper.slides[i].classList.remove(dimmedClass); } } } }, resetDimmedSlide: function(swiper) { for (let i = 0; i < swiper.slides.length; i++) { swiper.slides[i].classList.remove(dimmedClass); } }, } const swiperEvents = { set: function () { for (let i = 0; i < els.section.length; i++) { if (els.section[i].swiper == null) { new Swiper(els.section[i].swiperContainer, { init: false, slidesPerView: 'auto', navigation: { nextEl: els.section[i].nextArrow, prevEl: els.section[i].prevArrow, }, scrollbar: { el: els.section[i].scrollbar, draggable: true }, }); els.section[i].swiper.on('init', swiperEvents.init); els.section[i].swiper.on('slideChange', swiperEvents.slideChange); els.section[i].swiper.on('transitionEnd', swiperEvents.transitionEnd); } } }, init: function () { let isNextArrow = this.el.parentElement.querySelector('.swiper-button-next'); let isPrevArrow = this.el.parentElement.querySelector('.swiper-button-prev'); isNextArrow.removeAttribute('aria-label'); isNextArrow.removeAttribute('role'); isPrevArrow.removeAttribute('aria-label'); isPrevArrow.removeAttribute('role'); accessibility.slide(this); if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice != 'mobile') eventList.initDimmedSlides(this); }, slideChange: function () { accessibility.slide(this); eventList.resetVideo(this); if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice != 'mobile') eventList.setDimmedSlide(this); if (this.realIndex > 0) eventList.setMedia(this, this.realIndex); }, transitionEnd: function() { if (this.slides.length < 3 && currDevice == 'mobile') return; setTimeout(() => { let carouselInfo = eventList.getCarouselSizeInfo(this); let lastIndex = this.slides.length -1; let lastSlide = this.slides[lastIndex]; let lastBeforeSlide = this.slides[lastIndex - 1]; if (carouselInfo.isMoveSize > carouselInfo.lastBeforeSize || carouselInfo.maxMoveSize == carouselInfo.isMoveSize) { eventList.resetVideo(this); lastSlide.classList.add('is-last-slide'); lastBeforeSlide.classList.add('is-dimmed'); lastSlide.classList.remove('is-dimmed'); utils.offAccessibility(this.slides[lastIndex]); utils.onAccessibility(this.slides[lastIndex - 1]); } else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) { eventList.resetVideo(this); lastSlide.classList.add('is-dimmed'); lastSlide.classList.remove('is-last-slide'); lastBeforeSlide.classList.remove('is-dimmed'); utils.onAccessibility(this.slides[lastIndex]); utils.offAccessibility(this.slides[lastIndex - 1]); } }, 0); }, destroy: function (swiper) { if (swiper != null) { swiper.navigation.destroy(true); swiper.destroy(true); swiper = null; } }, }; const accessibility = { slide: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { if (i != swiper.activeIndex) { utils.onAccessibility(swiper.slides[i]); } else { utils.offAccessibility(swiper.slides[i]); } } } }; return { init: init, } })();})();(function () { window.flagship.features.scrollVideo = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = { scrollVideoWraps: [], scrollVideo: [], scene: [], }, currDevice = resize.checkResolution(); const init = function () { els.scrollVideoWraps = document.querySelectorAll('div:not(.js-interactive-intro-video)>.js-scroll-video'); if (els.scrollVideoWraps.length > 0) { setProperty(); eventList.setVideo(); eventList.setScene(); bindEvents(); } }; const setProperty = function () { for (let i = 0; i < els.scrollVideoWraps.length; i++) { els.scrollVideoWraps[i].video = els.scrollVideoWraps[i].querySelector('video'); els.scrollVideoWraps[i].controller = els.scrollVideoWraps[i].querySelector('.js-video-control'); els.scrollVideoWraps[i].controller.video = els.scrollVideoWraps[i].video; els.scrollVideoWraps[i].startPoint = !!els.scrollVideoWraps[i].getAttribute('data-start-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-start-point')) : undefined; els.scrollVideoWraps[i].reversePoint = !!els.scrollVideoWraps[i].getAttribute('data-reverse-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-reverse-point')) : undefined; els.scrollVideoWraps[i].moStartPoint = !!els.scrollVideoWraps[i].getAttribute('data-mo-start-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-mo-start-point')) : undefined; els.scrollVideoWraps[i].moReversePoint = !!els.scrollVideoWraps[i].getAttribute('data-mo-reverse-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-mo-reverse-point')) : undefined; } }; const bindEvents = function () { eventHandler.scroll(); eventList.scroll(); eventHandler.click(); resize.add(eventList.resize); }; const eventHandler = { scroll: function () { window.addEventListener('scroll', eventList.scroll); }, click: function () { for (let i = 0; i < els.scrollVideoWraps.length; i++) { els.scrollVideoWraps[i].controller.addEventListener('click', eventList.clickVideoCta); } } }; const eventList = { setVideo: function () { for (let i = 0; i < els.scrollVideoWraps.length; i++) { els.scrollVideo[i] = utils.videoHandler({ playType: 'scrollPlay', startPoint: (currDevice.indexOf('mobile') > -1) ? els.scrollVideoWraps[i].moStartPoint : els.scrollVideoWraps[i].startPoint, reversePoint: (currDevice.indexOf('mobile') > -1) ? els.scrollVideoWraps[i].moReversePoint : els.scrollVideoWraps[i].reversePoint, wrap: els.scrollVideoWraps[i], video: els.scrollVideoWraps[i].video, controller: els.scrollVideoWraps[i].controller, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); } if (this.wrap.classList.contains('is-started')) { this.wrap.classList.remove('is-started'); } if (!!this.video.videoWrap && this.video.videoWrap.classList.contains('js-interactive-intro-video')) { this.video.tooltip.classList.remove('is-visible'); } }, playCallback: function () { if (!this.wrap.classList.contains('is-started')) { this.wrap.classList.add('is-started'); } setTagging.pause(this.controller); }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } } }); } }, setScene: function () { for (let i = 0; i < els.scrollVideoWraps.length; i++) { els.scene[i] = SCROLLER({ trackElement: els.scrollVideoWraps[i].video, useFixed: false, resize: utils.detector.isTouchDevice ? false : true }); } }, scroll: function () { for (let i = 0; i < els.scrollVideoWraps.length; i++) { els.scene[i].trackAnimation(function () { els.scrollVideo[i].scrollActive(this.progress); }); } }, resize: function (currRes) { currDevice = currRes; }, clickVideoCta: function (e) { if (e.target == e.currentTarget) { if (e.currentTarget.video.paused) { e.currentTarget.video.play(); } else { e.currentTarget.video.pause(); } } } }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } } }; return { init: init } })();})();;(function () { window.flagship.features.threeColumnCarousel = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}, swiperObj, prevDevice = null, currDevice = resize.checkResolution(); dimmedClass = 'is-dimmed'; const isRtl = document.documentElement.classList.contains('rtl'); const init = function () { els.section = document.querySelectorAll('.js-three-column-carousel'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { for (let i = 0; i < els.section.length; i++) { els.section[i].swiperContainer = els.section[i]; els.section[i].swiperSlide = els.section[i].querySelectorAll('.swiper-slide'); els.section[i].nextArrow = els.section[i].parentElement.querySelector('.swiper-button-next'); els.section[i].prevArrow = els.section[i].parentElement.querySelector('.swiper-button-prev'); els.section[i].scrollbar = els.section[i].parentElement.querySelector('.swiper-scrollbar'); }; }; const bindEvents = function () { eventList.load(); resize.add(eventList.resize); }; const eventHandler = { swiper: function() { for (let i = 0; i < els.section.length; i++) { els.section[i].swiper.on('init', swiperEvents.init); els.section[i].swiper.on('slideChange', swiperEvents.slideChange); els.section[i].swiper.on('transitionEnd', swiperEvents.transitionEnd); }; } }; const eventList = { load: function() { for (let i = 0; i < els.section.length; i++) { let desktopStatus = (currDevice == 'desktop' || currDevice == 'tablet') && els.section[i].swiperSlide.length > 3; let mobileStatus = (currDevice == 'mobile' || currDevice == 'mobileS') && els.section[i].swiperSlide.length > 1; if (desktopStatus || mobileStatus) { swiperEvents.set(); eventHandler.swiper(); els.section[i].swiper.init(); } } }, resize: function() { currDevice = resize.checkResolution(); if (prevDevice != currDevice) { eventList.responsive(); prevDevice = currDevice; }; }, responsive: function() { for (let i = 0; i < els.section.length; i++) { let isSection = els.section[i]; let desktopStatus = (currDevice == 'desktop' || currDevice == 'tablet') && isSection.swiperSlide.length > 3; let mobileStatus = currDevice == 'mobile' && isSection.swiperSlide.length > 1; eventList.resetDimmedSlide(isSection.swiper); accessibility.reset(isSection.swiper); if (desktopStatus || mobileStatus) { if (isSection.swiper.initialized) swiperEvents.destroy(isSection.swiper); swiperEvents.set(); eventHandler.swiper(); isSection.swiper.init(); if (desktopStatus) eventList.initDimmedSlides(isSection.swiper); if (mobileStatus) accessibility.slide(isSection.swiper); } else if ((!desktopStatus || !mobileStatus) && isSection.swiper != undefined) { if (isSection.swiper.initialized) swiperEvents.destroy(isSection.swiper); } }; }, getCarouselSizeInfo: function(swiperObj) { let slideLength = swiperObj.slides.length; let slideWidth = swiperObj.slides[0].clientWidth; let slideMargin = parseInt(window.getComputedStyle(swiperObj.slides[0]).margin.split(' ')[isRtl ? 3 : 1]); let slideSize = slideWidth + slideMargin; let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiperObj.wrapperEl.clientWidth; let viewWidth = swiperObj.wrapperEl.clientWidth; let viewLength = Math.round((viewWidth + slideMargin)/slideSize); let lastBeforeSize = slideLength == 3 ? 0 : (slideWidth + slideMargin) * ((slideLength - viewLength) - 1); let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiperObj.wrapperEl).transform.split(',')[4])); return { slideLength: slideLength, slideWidth: slideWidth, slideMargin: slideMargin, slideSize: slideSize, maxMoveSize: maxMoveSize, viewWidth: viewWidth, viewLength: viewLength, lastBeforeSize: lastBeforeSize, isMoveSize: isMoveSize } }, initDimmedSlides: function(swiperObj) { for (let i = 0; i < swiperObj.slides.length; i++) { let isSlide = swiperObj.slides[i]; if ((swiperObj.activeIndex + eventList.getCarouselSizeInfo(swiperObj).viewLength) <= i) { isSlide.classList.add(dimmedClass); utils.onAccessibility(isSlide) } } }, setDimmedSlide: function(swiperObj) { if (currDevice != 'mobile') { for (let i = 0; i < swiperObj.slides.length; i++) { let isSlide = swiperObj.slides[i]; let dimmedSlide = (swiperObj.activeIndex) > i || (swiperObj.activeIndex + (eventList.getCarouselSizeInfo(swiperObj).viewLength - 1)) < i; if (dimmedSlide) { isSlide.classList.add(dimmedClass); utils.onAccessibility(isSlide) } else { isSlide.classList.remove(dimmedClass); utils.offAccessibility(isSlide) } } } }, resetDimmedSlide: function(swiperObj) { if (!!!swiperObj) return; for (let i = 0; i < swiperObj.slides.length; i++) { swiperObj.slides[i].classList.remove(dimmedClass); } }, tagging: function () { const values = { 'data-omni-type': 'microsite_pcontentinter', 'data-omni': 'galaxy-z-fold6:highlights:indicator:sldr-dots:', 'ga-ca': 'indication', 'ga-ac': 'carousel', 'ga-la': 'galaxy-z-fold6:highlights:indicator:sldr-dots:', }; } }; const swiperEvents = { set: function () { for (let i = 0; i < els.section.length; i++) { if (els.section[i].swiper == null) { new Swiper(els.section[i].swiperContainer, { init: false, slidesPerView: 'auto', speed: 200, navigation: { nextEl: els.section[i].nextArrow, prevEl: els.section[i].prevArrow, }, scrollbar: { el: els.section[i].scrollbar, draggable: true } }); } } }, init: function () { let isNextArrow = this.el.parentElement.querySelector('.swiper-button-next'); let isPrevArrow = this.el.parentElement.querySelector('.swiper-button-prev'); isNextArrow.removeAttribute('aria-label'); isNextArrow.removeAttribute('role'); isPrevArrow.removeAttribute('aria-label'); isPrevArrow.removeAttribute('role'); eventList.tagging(); if (currDevice != 'mobile') { eventList.initDimmedSlides(this); } else { accessibility.slide(this); }; }, transitionEnd: function() { let carouselInfo = eventList.getCarouselSizeInfo(this); if (currDevice == 'mobile' || currDevice == 'tablet') return; if (carouselInfo.viewLength < 3) return; setTimeout(() => { let lastIndex = this.slides.length -1 ; let lastSlide = this.slides[lastIndex]; let lsatDimmedLength = (carouselInfo.slideLength - 1) - carouselInfo.viewLength; let lastBeforeSlide = this.slides[lsatDimmedLength]; if (carouselInfo.isMoveSize > carouselInfo.lastBeforeSize && carouselInfo.maxMoveSize >= carouselInfo.isMoveSize) { lastSlide.classList.add('is-last-slide'); lastBeforeSlide.classList.add('is-dimmed'); lastSlide.classList.remove('is-dimmed'); } else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) { lastSlide.classList.add('is-dimmed'); lastSlide.classList.remove('is-last-slide'); lastBeforeSlide.classList.remove('is-dimmed'); } }, 0); }, slideChange: function () { eventList.setDimmedSlide(this); if (currDevice == 'mobile') accessibility.slide(this); }, destroy: function (swiperObj) { swiperObj.navigation.destroy(true); swiperObj.destroy(true); swiperObj = null; }, }; const accessibility = { slide: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { if (i != swiper.activeIndex) { utils.onAccessibility(swiper.slides[i]); } else { utils.offAccessibility(swiper.slides[i]); } } }, reset: function(swiper) { for (let i = 0; i < swiper.slides.length; i++) { utils.offAccessibility(swiper.slides[i]); } } }; return { init: init } })();})();(function () { window.flagship.features.ytPopup = (function () { let els = {}; const utils = window.flagship.common.utils; const init = function () { els.layerPopup = document.querySelector('.js-youtube-popup'); if (!!els.layerPopup) { setElements(); eventList.setPopup(); } }; const setElements = function () { els.contents = document.querySelector('#contents'); els.openCtas = document.querySelectorAll('.js-youtube-popup-open'); els.closeCta = document.querySelector('.js-youtube-popup-close'); els.ytIframe = els.layerPopup.querySelector('iframe'); els.ytDesc = els.layerPopup.querySelector('.js-youtube-desc'); els.dimmed = els.layerPopup.querySelector('.js-dimmed'); }; const eventList = { setPopup: function () { for (let i = 0; i < els.openCtas.length; i++) { utils.layerPopup({ layerPopup: els.layerPopup, layerPopupClass: '.js-youtube-popup', openerEvent: { element: els.openCtas[i], }, closeCtas: [els.closeCta], dimmed: els.dimmed, moveTarget: document.documentElement, contents: els.contents, show: { start: function () { els.layerPopup.classList.add('is-yt-open'); }, end: function (target) { eventList.setYoutube(target); } }, hide: { start: function () { els.layerPopup.classList.remove('is-yt-open'); }, end: function (target) { eventList.clearYoutube(); } } }); } }, setYoutube: function (target) { let 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 = ''; } }; return { init: init, } })();})();(function () { window.flagship.features.aiOverview = (function () { const utils = window.flagship.common.utils, resize = flagship.common.resize; let els = {}; let currDevice = resize.checkResolution(); let isAos = utils.detector.isTouchDevice && document.documentElement.classList.contains('android'); let isLoaded = false; const init = function () { els.section = document.querySelector('.features-ai-overview'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { // fixed els.fixedTrack = els.section.querySelector('.js-fixed-track'); els.fixedInner = els.section.querySelector('.js-fixed-inner'); // title els.overviewTextWrap = els.section.querySelector('.js-overview-text-wrap'); els.overviewTopText = els.section.querySelector('.js-overview-top-text'); els.overviewMiddleTextPc = els.section.querySelector('.js-overview-middle-text-pc'); els.overviewMiddleTextMo = els.section.querySelector('.js-overview-middle-text-mo'); els.overviewBottomTextPc = els.section.querySelector('.js-overview-bottom-text-pc'); els.overviewBottomTextMo = els.section.querySelector('.js-overview-bottom-text-mo'); // introVideo els.introVideoWrap = els.section.querySelector('.js-intro-video .js-video-wrap'); els.introVideoWrap.video = els.introVideoWrap.querySelector('video'); // introLogoVideo els.introLogoWrap = els.section.querySelector('.js-intro-logo-wrap'); els.introLogoVideoWrap = els.section.querySelector('.js-intro-logo-video-wrap'); els.introLogoVideoWrap.video = els.introLogoVideoWrap.querySelector('video'); els.introLogoVideoWrap.coverImg = els.introLogoVideoWrap.querySelector('.js-intro-logo-cover-image'); // logoVideo els.logoWrap = els.section.querySelector('.js-logo-wrap'); els.logoVideoWrap = els.section.querySelector('.js-logo-video-wrap'); els.logoVideoWrap.video = els.logoVideoWrap.querySelector('video'); els.logoVideoWrap.coverImg = els.logoVideoWrap.querySelector('.js-logo-cover-image'); // dimmed els.dimmed = els.section.querySelector('.js-dimmed'); }; const bindEvents = function () { eventHandler.load(); resize.add(eventHandler.resize); }; const eventHandler = { load: function () { eventList.checkBrokenFixed(); if (document.documentElement.classList.contains('is-ai-broken-fixed') || document.documentElement.classList.contains('low_network')) { window.addEventListener('DOMContentLoaded', eventList.setStaticContents, {once: true}); } else { if (isAos) { window.addEventListener('DOMContentLoaded', function () { eventList.fixedScroller.set(); eventList.sequencePlayer.set(); }, {once: true}); window.addEventListener('scroll', eventList.setScroll); eventList.setScroll(); } else { window.addEventListener('DOMContentLoaded', eventList.setVideoHandler, {once: true}); window.addEventListener('scroll', eventList.setScroll); els.introVideoWrap.video.addEventListener('canplaythrough',eventList.fixedScroller.set, {once: true}); eventList.setScroll(); } } window.addEventListener('orientationchange', eventHandler.orientationchange); }, resize: function (currRes) { currDevice = currRes; eventList.setContents(); }, orientationchange: function () { setTimeout(function () { eventList.setContents(); }, 150); } }; const eventList = { mediaLoader: function () { let scrollTop = window.pageYOffset, kv = document.querySelector('.features-kv'), kvTop = scrollTop + kv.getBoundingClientRect().top; if ((scrollTop > kvTop) && !isLoaded) { if (!els.introLogoVideoWrap.coverImg.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([els.introLogoVideoWrap.coverImg]); } if (!els.introLogoVideoWrap.video.classList.contains('is-mp4video-load-complete')) { mp4VideoLoader.setResponsiveMedia([els.introLogoVideoWrap.video]); } if (!els.logoVideoWrap.coverImg.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([els.logoVideoWrap.coverImg]); } if (!els.logoVideoWrap.video.classList.contains('is-mp4video-load-complete')) { mp4VideoLoader.setResponsiveMedia([els.logoVideoWrap.video]); } isLoaded = true; } }, setVideoHandler: function () { utils.videoHandler({ wrap: els.introVideoWrap, video: els.introVideoWrap.video }); utils.videoHandler({ wrap: els.introLogoVideoWrap, video: els.introLogoVideoWrap.video }); utils.videoHandler({ wrap: els.logoVideoWrap, video: els.logoVideoWrap.video }); }, fixedScroller: { set: function () { if (els.fixedTrack.scene == null) { els.fixedTrack.scene = SCROLLER({ trackElement: els.fixedTrack, fixedElement: els.fixedInner, useFixed: true, useFixedStyle: false, trackHeight: 5, resize: (utils.detector.isTouchDevice) ? false : true }); } }, destroy: function () { if (els.fixedTrack.scene != null) { els.fixedTrack.scene.destroy(true, true); els.fixedTrack.scene = null; els.fixedTrack.style = ''; } }, play: function () { if (els.fixedTrack.scene != null) { els.fixedTrack.scene.trackAnimation(eventList.fixedScrollMotion); } }, }, sequencePlayer: { set: function () { let imageName = null; if (currDevice.indexOf('desktop') > -1) { imageName = 'galaxy-z-flip6-features-ai-overview-intro-'; } else if (currDevice.indexOf('mobile') > -1) { imageName = 'galaxy-z-flip6-features-ai-overview-intro-mo-'; } else { imageName = 'galaxy-z-flip6-features-ai-overview-intro-tb-'; } els.fixedTrack.seqSence = SEQUENCEPLAYER({ targetElement: els.introVideoWrap, startNum: 0, endNum: 47, path: typeof SEQUENCE_IMG_PATH == 'undefined' ? './images/seq/' : SEQUENCE_IMG_PATH, name: imageName, extension: 'jpg', addType: 'append' }); }, destroy: function () { if (els.fixedTrack.seqSence != null) { els.fixedInner.removeChild(els.fixedInner.querySelector('canvas')); els.fixedTrack.seqSence = null; } }, play: function () { if (els.fixedTrack.scene != null) { els.fixedTrack.scene.trackAnimation(eventList.fixedScrollMotion); } } }, fixedScrollMotion: function () { els.fixedTrack.scene.trackAnimation(function () { let progress = this.progress; let isMobile = currDevice.indexOf('mobile') > -1; let isSeq = (els.fixedTrack.seqSence != null); if (isSeq) { let motionValue = utils.calRange({ targetValue: 47, progress: progress, startPoint: 0, endPoint: 80 }); els.fixedTrack.seqSence.play({index: parseInt(motionValue)}); } else { if (els.introVideoWrap.video.readyState >= 4) { let scrollTimeValue = utils.calRange({ targetValue: els.introVideoWrap.video.duration, progress: progress, endPoint: 45 }); els.introVideoWrap.video.currentTime = scrollTimeValue; } } let introVideoValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: 25, endPoint: isSeq ? 55 : 35 }); TweenMax.to(els.introVideoWrap, 0.1, { opacity: 1 - introVideoValue }); let introLogoShowValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: isSeq ? 53 : 33, endPoint: isSeq ? 60 : 40 }), introLogoHideValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: isSeq ? 60 : 40, endPoint: isSeq ? 67 : 47 }), introLogoScaleValue = utils.calRange({ targetValue: 0.5, progress: progress, startPoint: isSeq ? 60 : 40, endPoint: isSeq ? 67 : 47 }), textWrapShowValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: isSeq ? 68 : 48, endPoint: isSeq ? 75 : 55 }), topMiddleTextShowValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: isSeq ? 68 : 48, endPoint: isSeq ? 75 : 55 }), logoShowValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: isSeq ? 70 : 50, endPoint: isSeq ? 76 : 56 }), bottomTextShowValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: isSeq ? 75 : 55, endPoint: isSeq ? 80 : 60 }), bottomTextTopValue = utils.calRange({ targetValue: 50, progress: progress, startPoint: isSeq ? 76 : 56, endPoint: isSeq ? 84 : 64 }); TweenMax.to(els.introLogoWrap, 0.1, { opacity: introLogoShowValue }); // introLogoVideo if ((isSeq && (progress > 55)) || (!isSeq && (progress > 35))) { if (els.introLogoVideoWrap.video.paused) { if (!els.introLogoWrap.classList.contains('is-visible')) { els.introLogoWrap.classList.add('is-visible'); } els.introLogoVideoWrap.video.play(); } } else { if (!els.introLogoVideoWrap.video.paused) { if (els.introLogoWrap.classList.contains('is-visible')) { els.introLogoWrap.classList.remove('is-visible'); } els.introLogoVideoWrap.video.pause(); els.introLogoVideoWrap.video.currentTime = 0; } } if ((isSeq && (progress > 60)) || (!isSeq && (progress > 40))) { TweenMax.to(els.introLogoWrap, 0.1, { opacity: 1 - introLogoHideValue, scale: 1 - introLogoScaleValue, ease: 'cubic-bezier(0, 0.25, 0, 1.06)' }); } // text TweenMax.to(els.overviewTextWrap, 0.1, { opacity: textWrapShowValue }); TweenMax.to(els.overviewTopText, 0.1, { opacity: topMiddleTextShowValue }); if (isMobile) { TweenMax.to(els.overviewMiddleTextMo, 0.1, { opacity: topMiddleTextShowValue }); } else { TweenMax.to(els.overviewMiddleTextPc, 0.1, { opacity: topMiddleTextShowValue }); } TweenMax.to(els.logoWrap, 0.1, { opacity: logoShowValue }); if ((isSeq && (progress > 80)) || (!isSeq && (progress > 60))) { if (els.logoVideoWrap.video.paused) { if (!els.logoWrap.classList.contains('is-visible')) { els.logoWrap.classList.add('is-visible'); } els.logoVideoWrap.video.play(); } } else { if (!els.logoVideoWrap.video.paused) { if (els.logoWrap.classList.contains('is-visible')) { els.logoWrap.classList.remove('is-visible'); } els.logoVideoWrap.video.pause(); els.logoVideoWrap.video.currentTime = 0; } } // dimmed if ((isSeq && (progress > 80)) || (!isSeq && (progress > 60))) { if (!els.dimmed.classList.contains('is-active')) { els.dimmed.classList.add('is-active') } } else { if (els.dimmed.classList.contains('is-active')) { els.dimmed.classList.remove('is-active') } } if (isMobile) { TweenMax.to(els.overviewBottomTextMo, 0.3, { opacity: bottomTextShowValue, y: 50 - bottomTextTopValue + '%', ease: 'cubic-bezier(0, 0.25, 0, 1.06)' }); } else { TweenMax.to(els.overviewBottomTextPc, 0.3, { opacity: bottomTextShowValue, y: 50 - bottomTextTopValue + '%', ease: 'cubic-bezier(0, 0.25, 0, 1.06)' }); } }); }, checkBrokenFixed: function () { let winWidth = window.innerWidth, winHeight = window.innerHeight; document.documentElement.classList.remove('is-ai-broken-fixed'); if (winWidth > 1440 && winHeight <= 720) { document.documentElement.classList.add('is-ai-broken-fixed'); } else if (winWidth <= 1440 && (winHeight / winWidth) < 0.5277) { document.documentElement.classList.add('is-ai-broken-fixed'); } else { document.documentElement.classList.remove('is-ai-broken-fixed'); } }, setStaticContents: function () { els.section.classList.add('none-fixed'); }, setFixedContents: function () { if (els.section.classList.contains('none-fixed')) { els.section.classList.remove('none-fixed'); } if (isAos) { eventList.fixedScroller.set(); eventList.sequencePlayer.set(); window.addEventListener('scroll', eventList.setScroll); } else { if (!els.introVideoWrap.video.videoHandler) { eventList.setVideoHandler(); } if (els.introVideoWrap.video.readyState < 4) { els.introVideoWrap.video.load(); } window.addEventListener('scroll', eventList.setScroll); els.introVideoWrap.video.addEventListener('canplaythrough', function () { eventList.fixedScroller.set(); }, {once: true}); } }, setContents: function () { eventList.checkBrokenFixed(); if (document.documentElement.classList.contains('is-ai-broken-fixed') || document.documentElement.classList.contains('low_network')) { eventList.fixedScroller.destroy(); window.removeEventListener('scroll', eventList.setScroll); if (isAos) { eventList.sequencePlayer.destroy(); } eventList.setStaticContents(); } else { eventList.setFixedContents(); } }, setScroll: function () { eventList.mediaLoader(); if (isAos) { eventList.sequencePlayer.play(); } else { eventList.fixedScroller.play(); } }, }; return { init: init } })();})();;(function () { window.flagship.features.battery = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}, startNum = 3700, endNum = 4000, counter = { num: startNum }, animateStatus = true, tweenObj, prevDevice = null, currDevice = resize.checkResolution(); const init = function () { els.section = document.querySelector('.features-battery'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.capacity = els.section.querySelector('.js-battery-capacity'); els.value = els.capacity.querySelector('.js-battery-value'); }; const bindEvents = function () { eventHandler.load(); eventList.scroll(); eventHandler.scroll(); }; const eventHandler = { load: function() { eventList.setScene(); }, scroll: function() { window.addEventListener('scroll', eventList.scroll); } } const eventList = { setScene: function() { SCROLLER({ trackElement: els.capacity, useFixed: false }); }, scroll: function() { els.capacity.scroller.trackAnimation(function(){ let countActive = this.progress > 1 && animateStatus && !!!tweenObj; let countReset = this.progress <= 0 && this.wheelDirection == 'up' && !!tweenObj; if (countReset) { tweenObj.kill(); counter.num = startNum; tweenObj = null; els.capacity.classList.remove('is-active'); } if (countActive) { animateStatus = false; els.capacity.classList.add('is-active'); tweenObj = TweenMax.to(counter, 2, {num: endNum, onUpdate: function() { els.value.textContent = Math.floor(counter.num); }, onComplate: function() { animateStatus = true; }}); } }); } }; return { init: init } })();})();;(function () { window.flagship.features.cameraSpec = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}, prevDevice = null, currDevice = resize.checkResolution(); const init = function () { els.section = document.querySelector('.features-camera-spec'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.listInner = els.section.querySelectorAll('.js-camera-spec-inner'); }; const bindEvents = function () { resize.add(eventList.resize); eventList.load(); eventList.showCollout(); eventHandler.scroll(); }; const eventHandler = { scroll: function() { window.addEventListener('scroll', eventList.showCollout); } } const eventList = { load: function() { eventList.setSecene(); }, resize: function (currRes) { currDevice = currRes; if (currDevice != prevDevice) { prevDevice = currDevice; } }, setSecene: function () { for (let i = 0; i < els.listInner.length; i++) { SCROLLER({ trackElement: els.listInner[i], useFixed: false }); } }, showCollout: function() { for (let i = 0; i < els.listInner.length; i++) { els.listInner[i].scroller.trackAnimation(function() { if (this.progress > 0) { this.trackElement.classList.add('is-active'); } if (i == 0) { if (this.progress <= 0) { for (let j = 0; j < els.listInner.length; j++) { els.listInner[j].classList.remove('is-active'); } } } }); } } }; return { init: init } })();})();(function () { window.flagship.features.colorchip = function (colorchipWrap) { const utils = window.flagship.common.utils, common = window.flagship.features.common, resize = window.flagship.common.resize; let els = {}, activeClass = 'is-active', currentDevice = resize.checkResolution(), prevDevice = null, currentSlidesPerView = currentDevice.indexOf('mobile') > -1 ? 5 : 7; const init = function () { els.section = document.querySelector('.js-colors'); els.popup = document.querySelector('.js-viewer'); if (colorchipWrap.type == 'popup') { colorchipWrap.contentWrap = els.popup; } else { colorchipWrap.contentWrap = els.section; } setElements(); setProperty(); bindEvents(); }; const setElements = function () { // panel els.panelWrap = els.section.querySelector('.js-panel-wrap'); els.panelItems = els.panelWrap.querySelectorAll('.js-panel-item'); // colorchip els.swiperContainer = colorchipWrap.querySelector('.js-colorchip-container'); els.colorchipButtons = colorchipWrap.querySelectorAll('.js-colorchip-button'); els.swiperArrowWrap = colorchipWrap.querySelector('.js-arrow-wrap'); els.swiperNextArrow = colorchipWrap.querySelector('.js-colorchip-next'); els.swiperPrevArrow = colorchipWrap.querySelector('.js-colorchip-prev'); els.colorchipNames = colorchipWrap.querySelectorAll('.js-colorchip-name'); // 360 Popup Btn els.viewerBtn = els.section.querySelector('.viewer-btn'); // viewer els.viewerSection = els.section.querySelector('.js-colors-viewer'); els.viewerIframe = colorchipWrap.contentWrap.querySelector('iframe'); // exclusive badge els.exclusive = colorchipWrap.contentWrap.querySelector('.js-exclusive-badge'); }; const setProperty = function () { for (let i = 0; i < els.colorchipButtons.length; i++) { els.colorchipButtons[i].index = i; } }; const bindEvents = function () { eventList.checkColorchipSwiper(); if (colorchipWrap.type != 'popup') eventList.setColors(0); eventHandler.click(); eventHandler.keydown(); resize.add(eventList.resize); eventHandler.scroll(); }; const eventHandler = { click: function () { for (let i = 0; i < els.colorchipButtons.length; i++) { els.colorchipButtons[i].addEventListener('click', eventList.clickColorchip); } els.viewerBtn.addEventListener('click', function () { let activeIndex = this.getAttribute('data-target-index'); eventList.setColorchip(activeIndex); eventList.setColorName(activeIndex); eventList.setExclusive(activeIndex); }); els.swiperNextArrow.addEventListener('click', accessibility.clickArrow); els.swiperPrevArrow.addEventListener('click', accessibility.clickArrow); }, keydown: function () { els.swiperNextArrow.addEventListener('keydown', accessibility.clickArrow); els.swiperPrevArrow.addEventListener('keydown', accessibility.clickArrow); }, scroll: function () { window.addEventListener('scroll', eventList.scroll); } }; const eventList = { scroll: function () { let winOffsetBottom = window.pageYOffset + window.innerHeight, kv = document.querySelector('.features-kv'), kvHeight = kv.getBoundingClientRect().height + utils.getNavHeight(); if (winOffsetBottom >= kvHeight) { // bg load colorchipWrap.bgImgs = colorchipWrap.querySelectorAll('.js-bg-img'); if(!!colorchipWrap.bgImgs) bgLoader.setResponsiveMedia(colorchipWrap.bgImgs); eventList.setViewer(); window.removeEventListener('scroll', eventList.scroll); } }, setViewer: function () { if (!utils.isLowNetwork()) { setTimeout(function () { els.viewerIframe.style.position = 'fixed'; els.viewerIframe.style.top = 0; els.viewerIframe.style.opacity = 0; setTimeout(function () { els.viewerIframe.style.position = ''; els.viewerIframe.style.top = ''; els.viewerIframe.style.opacity = ''; }, 300); }, 1000); // set eventList.setViewerUrl(els.colorchipButtons[0].getAttribute('data-colors')); } }, checkColorchipSwiper: function () { let colorchipSwiperLength = currentDevice.indexOf('mobile') > -1 ? 6 : 8; if (els.colorchipButtons.length >= colorchipSwiperLength) { if (els.swiperArrowWrap.style.display == 'none') { els.swiperArrowWrap.style.display = ''; } swiperEvents.set(); } else { if (els.swiperArrowWrap.style.display != 'none') { els.swiperArrowWrap.style.display = 'none'; } if (els.colorchipSwiper != null) { swiperEvents.destroy(); } } }, setColors: function (activeIndex) { eventList.setPopupBtn(els.colorchipButtons[activeIndex]); eventList.setColorchip(activeIndex); eventList.setPanel(activeIndex); eventList.setColorName(activeIndex); eventList.setExclusive(activeIndex); }, resize: function (currRes) { currentDevice = currRes; if (currentDevice !== prevDevice) { eventList.checkColorchipSwiper(); currentSlidesPerView = currentDevice.indexOf('mobile') > -1 ? 5 : 7; prevDevice = currentDevice; } }, clickColorchip: function () { let targetColor = this; eventList.setColors(targetColor.index); eventList.setViewerUrl(targetColor.getAttribute('data-colors')); }, setColorchip: function (activeIndex) { let targetcolorchipButton = els.colorchipButtons[activeIndex]; for (let i = 0; i < els.colorchipButtons.length; i++) { els.colorchipButtons[i].classList.remove(activeClass); if (!!colorchipWrap.isStatic) { els.colorchipButtons[i].setAttribute('aria-selected', false); } else { els.colorchipButtons[i].removeAttribute('title'); } } if (!targetcolorchipButton.classList.contains(activeClass)) { targetcolorchipButton.classList.add(activeClass); if (!!colorchipWrap.isStatic) { targetcolorchipButton.setAttribute('aria-selected', true); } else { accessibility.selected(targetcolorchipButton); } } }, setPanel: function (activeIndex) { if (!colorchipWrap.isStatic) return; for (let i = 0; i < els.panelItems.length; i++) { if (els.panelItems[i].classList.contains(activeClass)) { els.panelItems[i].classList.remove(activeClass); els.panelItems[i].setAttribute('aria-hidden', true); } } if (!els.panelItems[activeIndex].classList.contains(activeClass)) { els.panelItems[activeIndex].classList.add(activeClass); els.panelItems[activeIndex].setAttribute('aria-hidden', false); } }, setColorName: function (activeIndex) { for (let i = 0; i < els.colorchipNames.length; i++) { if (els.colorchipNames[i].classList.contains(activeClass)) { els.colorchipNames[i].classList.remove(activeClass); els.colorchipNames[i].setAttribute('aria-hidden', true); } } if (!els.colorchipNames[activeIndex].classList.contains(activeClass)) { els.colorchipNames[activeIndex].classList.add(activeClass); els.colorchipNames[activeIndex].setAttribute('aria-hidden', false); } }, setViewerUrl: function (colorName) { if (!!colorchipWrap.isStatic) return; if (colorchipWrap.type == 'popup') { let viewerSrc = els.viewerIframe.getAttribute('src').split('#color=')[0]; els.viewerIframe.setAttribute('src', `${viewerSrc}#color=${colorName}`); } else { els.viewerSection.setAttribute('data-model-color', colorName); els.viewerIframe.setAttribute('src', common.getViewerUrl()); } }, setPopupBtn: function (target) { if (colorchipWrap.type == 'popup') return; els.viewerBtn.setAttribute('data-target-index', target.index); els.viewerBtn.setAttribute('data-model-color', target.getAttribute('aria-controls')); }, setExclusive: function (activeIndex) { if (!!els.colorchipButtons[activeIndex].getAttribute('data-exclusive')) { els.exclusive.classList.add('is-active'); } else { els.exclusive.classList.remove('is-active'); } } }; const swiperEvents = { set: function () { if (els.colorchipSwiper == null) { els.colorchipSwiper = new Swiper(els.swiperContainer, { init: false, navigation: { nextEl: els.swiperNextArrow, prevEl: els.swiperPrevArrow, }, slidesPerView: currentSlidesPerView, speed: 300, }); els.colorchipSwiper.on('init', swiperEvents.init); els.colorchipSwiper.on('slideChange', swiperEvents.slideChange); els.colorchipSwiper.init(); } }, init: function () { let notification = this.el.querySelector('.swiper-notification'); if (!!notification) this.el.removeChild(notification); els.swiperPrevArrow.removeAttribute('aria-label'); els.swiperPrevArrow.removeAttribute('role'); els.swiperNextArrow.removeAttribute('aria-label'); els.swiperNextArrow.removeAttribute('role'); accessibility.colorchip(els.colorchipSwiper); }, slideChange: function () { accessibility.colorchip(els.colorchipSwiper); }, destroy: function () { els.colorchipSwiper.destroy(true); els.colorchipSwiper = null; }, }; const accessibility = { clickArrow: function (e) { let arrowTimeout = null, arrowStyleTimeout = null; if ((e.type == 'keydown' && e.keyCode == 13) || e.type == 'click') { e.preventDefault(); if (els.colorchipSwiper.isBeginning && !els.colorchipSwiper.isEnd) { els.swiperPrevArrow.style.setProperty('display', 'block'); clearTimeout(arrowTimeout); arrowTimeout = setTimeout(function () { els.swiperNextArrow.focus(); }, 300); clearTimeout(arrowStyleTimeout); arrowStyleTimeout = setTimeout(function () { els.swiperPrevArrow.style.display = ''; }, 400); } else if (!els.colorchipSwiper.isBeginning && els.colorchipSwiper.isEnd) { els.swiperNextArrow.style.setProperty('display', 'block'); clearTimeout(arrowTimeout); arrowTimeout = setTimeout(function () { els.swiperPrevArrow.focus(); }, 300); clearTimeout(arrowStyleTimeout); arrowStyleTimeout = setTimeout(function () { els.swiperNextArrow.style.display = ''; }, 400); } } }, colorchip: function (swiperObj) { let isNotActivedColorchips = null; for (let i = 0; i < swiperObj.slides.length; i++) { if (currentDevice.indexOf('mobile') > -1) { isNotActivedColorchips = (i != swiperObj.activeIndex) && (i > swiperObj.activeIndex + 4) || (swiperObj.activeIndex > i); } else { isNotActivedColorchips = (i != swiperObj.activeIndex) && (i > swiperObj.activeIndex + 6) || (swiperObj.activeIndex > i); } if (isNotActivedColorchips) { utils.onAccessibility(swiperObj.slides[i]); setTimeout(function () { utils.onAccessibility(swiperObj.slides[i]); }, 300); } else { utils.offAccessibility(swiperObj.slides[i]); setTimeout(function () { utils.offAccessibility(swiperObj.slides[i]); }, 300); } } }, selected: function (target) { if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.setAttribute('title', LOCAL_VARI.selected); } else { target.setAttribute('title', 'Selected'); } } }; return init(colorchipWrap); }; let colorchips = document.querySelectorAll('.js-colorchip'); for (let i = 0; i < colorchips.length; i++) { colorchips[i].type = colorchips[i].parentElement.classList.contains('js-popup-colorchip') ? 'popup' : 'colors'; colorchips[i].isStatic = colorchips[i].parentElement.getAttribute('data-static'); flagship.features.colorchip(colorchips[i]); }})();;(function () { window.flagship.features.faq = (function () { const resize = window.flagship.common.resize, utils = window.flagship.common.utils; let els = {}, prevDevice = null, currDevice = resize.checkResolution(); const init = function () { els.section = document.querySelector('.js-faq'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.faqList = els.section.querySelector('.js-faq-list'); }; const bindEvents = function () { resize.add(eventList.resize); eventList.setAccordion(); }; const eventList = { resize: function (currRes) { currDevice = currRes; if (currDevice != prevDevice) { eventList.responsive(); prevDevice = currDevice; } }, responsive: function () { let isOpenedItems = els.faqList.querySelectorAll('.js-faq-item.is-open'); if (isOpenedItems.length > 0) { for (let i = 0; i < isOpenedItems.length; i++) { let isOpenedItemContent = isOpenedItems[i].querySelector('.js-faq-answer'), clientHeight = isOpenedItemContent.children[0].clientHeight; isOpenedItemContent.style.height = `${clientHeight}px`; } } }, setAccordion: function () { els.accordion = new window.flagship.common.accordion({ wrap: els.faqList, classList: { item: 'js-faq-item', button: 'js-faq-open', contents: 'js-faq-answer', activeClass: 'is-open' }, open: { start: function (target) { let targetInnerCta = target.querySelector('.js-featue-cta'); if (targetInnerCta) targetInnerCta.addEventListener('click', accessibility.moveFocus); } } }); els.accordion.init(); }, }; const accessibility = { moveFocus: function (e) { if (this.getAttribute('href').indexOf('#') > -1) { e.preventDefault(); let sectionId = this.getAttribute('href'), section = document.querySelector(`${sectionId}`), sectionTop = section.getBoundingClientRect().top, movePosition = (sectionTop + window.pageYOffset) - utils.getNavHeight(), clickable = section.querySelectorAll('a, button'), title = section.querySelector('h2') || section.querySelector('h3'); if (!!title) { let _focusOut = function () { title.removeAttribute('tabindex'); title.removeEventListener('focusout', _focusOut); }; title.addEventListener('focusout', _focusOut); title.setAttribute('tabindex', 0); title.focus(); } else { clickable[0].focus(); } window.scrollTo(0, movePosition); } } }; return { init: init } })();})();(function () { window.flagship.features.flexWindow = (function () { const utils = window.flagship.common.utils; const resize = window.flagship.common.resize; let els = {}; let oldIndex = 0; let swiperObj = {}; let pointerOffset = {}; let currDevice = resize.checkResolution(); let videoPlayStatus = false; let lowNetwork = document.documentElement.classList.contains('low_network'); const init = function () { els.section = document.querySelector('.features-flex-window'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.carouselWrap = els.section.querySelector('.features-flex-window__carousel'); els.carouselInner = els.section.querySelector('.features-flex-window__carousel-inner'); els.swiperContainer = els.section.querySelector('.swiper-container'); els.nextArrow = els.section.querySelector('.swiper-button-next'); els.prevArrow = els.section.querySelector('.swiper-button-prev'); els.autoSlideController = els.section.querySelector('.features-flex-window__carousel-button'); els.blind = els.autoSlideController.querySelector('.blind'); els.videos; els.realCarouselSlides; }; const setProperty = function () { for (let i = 0; i < els.realCarouselSlides.length; i++) { let isSlide = els.realCarouselSlides[i]; let isVideoWrap = els.realCarouselSlides[i].querySelector('.common-video'); if (!!isVideoWrap) { isSlide.videoWrap = isVideoWrap; isSlide.videoWrap.video = isVideoWrap.querySelector('.common-video__video'); isSlide.video = isVideoWrap.querySelector('.common-video__video'); isSlide.videoWrap.controller = isVideoWrap.querySelector('.js-video-control'); isSlide.videoWrap.controller.video = isVideoWrap.querySelector('.common-video__video'); } } }; const bindEvents = function () { eventList.load(); eventHandler.scroll(); eventHandler.autoSlideController(); }; const eventHandler = { scroll: function() { window.addEventListener('scroll', eventList.scroll) }, transitionend: function() { els.carouselInner.addEventListener('animationend', eventList.transitionend, {once: true}) }, flickSwiper: function() { els.carouselWrap.addEventListener('touchstart', function(e) { pointerOffset.start = null; pointerOffset.current = null; pointerOffset.start = e.touches[0].clientX; els.carouselWrap.addEventListener('touchmove', eventList.getPointerMoveSize); }); els.carouselWrap.addEventListener('touchend', function() { if (pointerOffset.start == null) return; eventList.flickSwiper(); els.carouselWrap.removeEventListener('touchmove', eventList.getPointerMoveSize); }); els.carouselWrap.addEventListener('mousedown', function(e) { pointerOffset.start = null; pointerOffset.current = null; pointerOffset.start = e.offsetX; els.carouselWrap.addEventListener('mousemove', eventList.getPointerMoveSize); }); els.carouselWrap.addEventListener('mouseup', function() { eventList.flickSwiper(); els.carouselWrap.removeEventListener('mousemove', eventList.getPointerMoveSize); }); els.carouselWrap.addEventListener('mouseleave', function() { if (pointerOffset.start == null) return; pointerOffset.start = null; pointerOffset.current = null; els.carouselWrap.removeEventListener('mousemove', eventList.getPointerMoveSize); }); }, click: function () { for (let i = 0; i < els.realCarouselSlides.length; i++) { let isVideoWrap = els.realCarouselSlides[i].videoWrap; if (!!isVideoWrap) { els.realCarouselSlides[i].videoWrap.controller.addEventListener('click', eventList.clickVideoCta); } } }, autoSlideController: function() { els.autoSlideController.addEventListener('click', eventList.autoSlideController); } }; const eventList = { load: function() { swiperEvent.set(); swiperObj.thumb.init(); eventList.setScene(); eventList.scroll(); els.blind.innerText = LOCAL_VARI.play; }, setVideo: function() { els.realCarouselSlides = els.swiperContainer.querySelectorAll('.swiper-slide'); els.videos = els.swiperContainer.querySelectorAll('.common-video__video'); setProperty(); eventHandler.click(); for (let i = 0; i < els.realCarouselSlides.length; i++) { let isVideoWrap = els.realCarouselSlides[i].videoWrap; if (!!isVideoWrap) { if (!isVideoWrap.classList.contains('is-loaded')) isVideoWrap.classList.add('is-loaded'); utils.videoHandler({ playType: 'scrollPlay', wrap: isVideoWrap, video: isVideoWrap.video, controller: isVideoWrap.controller, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); } if (this.wrap.classList.contains('is-started')) { this.wrap.classList.remove('is-started'); } }, playCallback: function () { if (!this.wrap.classList.contains('is-started')) { this.wrap.classList.add('is-started'); } setTagging.pause(this.controller); }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } } }); } } }, playVideo: function(videoWrap) { let isVideo = videoWrap.video; if (isVideo.readyState >= 4) { isVideo.play(); } else { isVideo.load(); isVideo.addEventListener('canplay', function() { isVideo.play(); }, {once: true}); } }, resetVideo: function() { if (!!!els.realCarouselSlides) return; for (let i = 0; i < els.realCarouselSlides.length; i++) { let isVideo = els.realCarouselSlides[i].video; if (!!isVideo && !isVideo.paused) { isVideo.pause(); isVideo.currentTime = 0; }; }; }, clickVideoCta: function (e) { if (e.target == e.currentTarget) { if (e.currentTarget.video.paused) { e.currentTarget.video.play(); } else { e.currentTarget.video.pause(); } } }, setScene: function() { SCROLLER({ trackElement: els.swiperContainer, resize: false }) }, autoSlideController: function() { let taggingValue = this.getAttribute('data-omni'); if (this.classList.contains('is-playing')) { this.classList.remove('is-playing'); this.classList.add('is-paused'); this.setAttribute('data-omni', taggingValue.replace('play', 'pause')); this.setAttribute('ga-la', taggingValue.replace('play', 'pause')); els.blind.innerText = LOCAL_VARI.pause; } else { this.classList.remove('is-paused'); this.classList.add('is-playing'); this.setAttribute('data-omni', taggingValue.replace('pause', 'play')); this.setAttribute('ga-la', taggingValue.replace('pause', 'play')); els.blind.innerText = LOCAL_VARI.play; } }, resetScroll: function() { swiperEvent.destroy(swiperObj.thumb); swiperEvent.set(); swiperObj.thumb.init(); for (let i = 0; i < swiperObj.thumb.slides.length; i++) { let isVideo = swiperObj.thumb.slides[i].querySelector('.common-video'); if (!!isVideo) { isVideo.classList.remove('is-playing'); isVideo.classList.remove('is-paused'); isVideo.classList.remove('is-ended'); isVideo.classList.remove('is-loaded'); isVideo.classList.remove('is-completed'); } } els.carouselInner.classList.remove('is-animate-start'); els.autoSlideController.classList.add('is-ended'); els.autoSlideController.classList.remove('is-playing'); els.autoSlideController.classList.remove('is-paused'); }, scroll: function() { els.swiperContainer.scroller.trackAnimation(function() { let clsaaStatus = els.carouselInner.classList.contains('is-animate-start'); let activeStatus = this.progress > 20 && !clsaaStatus; let resetStatus = this.wheelDirection == 'up' && this.progress <= 0 && clsaaStatus; let isActiveVideo = swiperObj.thumb.slides[swiperObj.thumb.activeIndex].querySelector('video'); if (resetStatus) { eventList.resetScroll(); }; if (activeStatus) { videoPlayStatus = false; els.carouselInner.classList.add('is-animate-start'); els.autoSlideController.classList.remove('is-ended'); els.autoSlideController.classList.add('is-playing'); eventHandler.transitionend(); }; for (let i = 0; i < els.videos.length; i++) { if (!lowNetwork && videoPlayStatus && !!isActiveVideo) isActiveVideo.videoHandler.scrollActive(this.progress); } }); }, transitionend: function() { videoPlayStatus = true; els.autoSlideController.classList.remove('is-playing'); els.autoSlideController.classList.add('is-ended'); setTimeout(function() { let isActiveVideo = swiperObj.thumb.slides[swiperObj.thumb.activeIndex].querySelector('video'); if (!!isActiveVideo) { isActiveVideo.currentTime = 0; isActiveVideo.play(); } }, 600); }, getPointerMoveSize: function(e) { if (!!e.touches) { pointerOffset.current = e.touches[0].clientX; } else { pointerOffset.current = e.offsetX; } }, }; const swiperEvent = { set: function() { swiperObj.thumb = new Swiper(els.swiperContainer, { init: false, loop: true, centeredSlides: true, slidesPerView: 'auto', navigation: { nextEl: els.nextArrow, prevEl: els.prevArrow }, }); swiperObj.thumb.on('transitionEnd', swiperEvent.transitionEnd); swiperObj.thumb.on('init', swiperEvent.init); }, init: function() { els.nextArrow.removeAttribute('aria-label'); els.nextArrow.removeAttribute('role'); els.prevArrow.removeAttribute('aria-label'); els.prevArrow.removeAttribute('role'); accessibility.slide(this); eventList.setVideo(); }, transitionEnd: function() { let isActiveSlide = els.swiperContainer.querySelector('.swiper-slide-active'); let isVideoWrap = isActiveSlide.videoWrap; accessibility.slide(this); eventList.resetVideo(); if (!lowNetwork && !!isVideoWrap) eventList.playVideo(isVideoWrap); }, destroy: function (swiper) { swiper.navigation.destroy(true); swiper.destroy(true); }, } const accessibility = { slide: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { if (i != swiper.activeIndex) { utils.onAccessibility(swiper.slides[i]); } else { utils.offAccessibility(swiper.slides[i]); } } } }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } } }; return { init: init } })();})();(function () { window.flagship.features.formfactor = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}; let currDevice = resize.checkResolution(); let isAos = utils.detector.isTouchDevice && document.documentElement.classList.contains('android'); const init = function () { els.section = document.querySelector('.js-form-factor'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { // fixed els.fixedVideoTrack = els.section.querySelector('.js-fixed-track'); els.fixedVideoInner = els.section.querySelector('.js-fixed-inner'); els.fixedVideoWrap = els.section.querySelector('.js-fixed-scroll-video .js-video-wrap'); els.fixedVideo = els.section.querySelector('.js-fixed-scroll-video video'); // title els.topTitleWrap = els.section.querySelector('.js-top-title-wrap'); els.topTitle1 = els.section.querySelector('.js-top-title-1'); els.topTitle2 = els.section.querySelector('.js-top-title-2'); els.bottomTitleWrap = els.section.querySelector('.js-bottom-title-wrap'); els.bottomTitle = els.section.querySelector('.js-bottom-title'); els.bottomDesc = els.section.querySelector('.js-bottom-desc'); // sequence hidden video els els.videoControlWrap = els.section.querySelector('.common-video__control-wrap'); els.videoFigure = els.section.querySelector('.common-video__figure'); }; const bindEvents = function () { eventHandler.load(); resize.add(eventHandler.resize); }; const eventHandler = { load: function () { eventList.checkBrokenFixed(); window.addEventListener('orientationchange', eventHandler.orientationchange); if (document.documentElement.classList.contains('is-formfactor-broken-fixed') || document.documentElement.classList.contains('low_network')) { window.addEventListener('DOMContentLoaded', eventList.setStaticContents, {once: true}); } else { if (isAos) { window.addEventListener('DOMContentLoaded', function () { eventList.fixedScroller.set(); eventList.sequencePlayer.set(); eventList.correctionBottomHeight(); }, {once: true}); window.addEventListener('scroll', eventList.sequencePlayer.play); els.videoControlWrap.style.display = 'none'; els.videoFigure.style.display = 'none'; } else { window.addEventListener('DOMContentLoaded', eventList.setVideoHandler, {once: true}); els.fixedVideo.addEventListener('canplaythrough', function () { window.addEventListener('scroll', eventList.fixedScroller.play); eventList.fixedScroller.set(); eventList.correctionBottomHeight(); }, {once: true}); } } }, resize: function () { eventList.setContents(); }, orientationchange: function () { setTimeout(function () { eventList.setContents(); }, 150); } }; const eventList = { setVideoHandler: function () { utils.videoHandler({ wrap: els.fixedVideoWrap, video: els.fixedVideo }); }, fixedScroller: { set: function () { if (els.fixedVideoTrack.scene == null) { els.fixedVideoTrack.scene = SCROLLER({ trackElement: els.fixedVideoTrack, fixedElement: els.fixedVideoInner, useFixed: true, useFixedStyle: false, trackHeight: isAos ? 6 : 5.5, resize: (utils.detector.isTouchDevice) ? false : true }); } }, destroy: function () { if (els.fixedVideoTrack.scene != null) { els.fixedVideoTrack.scene.destroy(true, true); els.fixedVideoTrack.scene = null; els.fixedVideoTrack.style = ''; } }, play: function () { if (els.fixedVideoTrack.scene != null) { els.fixedVideoTrack.scene.trackAnimation(eventList.fixedScrollMotion); } } }, sequencePlayer: { set: function () { let imageName = null; if (currDevice.indexOf('desktop') > -1) { imageName = 'galaxy-z-flip6-features-form-factor-'; } else if (currDevice.indexOf('mobile') > -1) { imageName = 'galaxy-z-flip6-features-form-factor-mo-'; } else { imageName = 'galaxy-z-flip6-features-form-factor-tb-'; } els.fixedVideoTrack.seqSence = SEQUENCEPLAYER({ targetElement: els.fixedVideoWrap, startNum: 0, endNum: 95, path: typeof SEQUENCE_IMG_PATH == 'undefined' ? './images/seq/' : SEQUENCE_IMG_PATH, name: imageName, extension: 'jpg', addType: 'append' }); }, destroy: function () { if (els.fixedVideoTrack.seqSence != null) { els.fixedVideoInner.removeChild(els.fixedVideoInner.querySelector('canvas')); els.fixedVideoTrack.seqSence = null; } }, play: function () { if (els.fixedVideoTrack.scene != null) { els.fixedVideoTrack.scene.trackAnimation(eventList.fixedScrollMotion); } } }, fixedScrollMotion: function () { let progress = this.progress; let isMobile = currDevice.indexOf('mobile') > -1 ? true : false if (els.fixedVideoTrack.seqSence != null) { let motionValue = utils.calRange({ targetValue: 95, progress: this.progress, startPoint: 0, endPoint: 100 }); els.fixedVideoTrack.seqSence.play({index: parseInt(motionValue)}); } else { if (els.fixedVideo.readyState >= 4) { let scrollTimeValue = utils.calRange({ targetValue: els.fixedVideo.duration, progress: progress, endPoint: 100 }); els.fixedVideo.currentTime = scrollTimeValue - 0.1; } } let topTitleWrapShowValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: 0, endPoint: 10 }); let topTitleValue = utils.calRange({ targetValue: 100, progress: progress, startPoint: 32, endPoint: 36 }); let topTitleWrapHideValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: 28, endPoint: 36 }); TweenMax.to(els.topTitleWrap, 0.1, { opacity: topTitleWrapShowValue, scale: topTitleWrapShowValue }); if (progress >= 28) { TweenMax.to(els.topTitleWrap, 0.1, { opacity: 1 - topTitleWrapHideValue }); } TweenMax.to(els.topTitle1, 0.3, { x: -topTitleValue + '%' }); TweenMax.to(els.topTitle2, 0.3, { x: topTitleValue + '%' }); let bottomTtileOpacityValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: 87, endPoint: 98 }), bottomTopValue = utils.calRange({ targetValue: 20, progress: progress, startPoint: 87, endPoint: 98 }), bottomDescOpacityValue = utils.calRange({ targetValue: 1, progress: progress, startPoint: 98, endPoint: 100 }), bottomDescTopValue = utils.calRange({ targetValue: 70, progress: progress, startPoint: 98, endPoint: 100 }) TweenMax.to(els.bottomTitleWrap, 0.1, { y: 20 - bottomTopValue + '%', ease: 'ease-out' }); TweenMax.to(els.bottomTitle, 0.1, { opacity: bottomTtileOpacityValue }); TweenMax.to(els.bottomDesc, 0.1, { opacity: bottomDescOpacityValue, y: 70 - bottomDescTopValue + '%', ease: 'ease-out' }); }, correctionBottomHeight: function () { let bottomTitleHeight = els.bottomTitleWrap.clientHeight, bottomTitleMarginTop = parseInt(window.getComputedStyle(els.bottomTitleWrap).marginTop), correctionHeight = (bottomTitleMarginTop < 0) ? -bottomTitleMarginTop : bottomTitleMarginTop; if (bottomTitleHeight > correctionHeight) { let correctionValue = bottomTitleHeight - correctionHeight; els.fixedVideoTrack.style.paddingBottom = correctionValue + 'px'; } }, checkBrokenFixed: function () { let winWidth = window.innerWidth, winHeight = window.innerHeight; document.documentElement.classList.remove('is-formfactor-broken-fixed'); if (winWidth > 1440 && winHeight <= 720) { document.documentElement.classList.add('is-formfactor-broken-fixed'); } else if (winWidth <= 1440 && (winHeight / winWidth) < 0.5277) { document.documentElement.classList.add('is-formfactor-broken-fixed'); } else { document.documentElement.classList.remove('is-formfactor-broken-fixed'); } }, setStaticContents: function () { if (!els.section.classList.contains('none-fixed')) { els.section.classList.add('none-fixed'); } }, setFixedContents: function () { if (els.section.classList.contains('none-fixed')) { els.section.classList.remove('none-fixed'); } if (isAos) { window.addEventListener('DOMContentLoaded', function () { eventList.fixedScroller.set(); eventList.sequencePlayer.set(); eventList.correctionBottomHeight(); }, {once: true}); window.addEventListener('scroll', eventList.sequencePlayer.play); els.videoControlWrap.style.display = 'none'; els.videoFigure.style.display = 'none'; } else { if (!els.fixedVideo.videoHandler) { eventList.setVideoHandler(); } if (!els.fixedVideo.classList.contains('is-mp4video-load-complete')) { mp4VideoLoader.setResponsiveMedia([els.fixedVideo]); } els.fixedVideo.addEventListener('canplaythrough', function () { eventList.fixedScroller.set(); eventList.correctionBottomHeight(); window.addEventListener('scroll', eventList.fixedScroller.play); }, {once: true}); } }, setContents: function () { eventList.checkBrokenFixed(); if (document.documentElement.classList.contains('is-formfactor-broken-fixed') || document.documentElement.classList.contains('low_network')) { eventList.fixedScroller.destroy(); if (isAos) { eventList.sequencePlayer.destroy(); window.removeEventListener('scroll', eventList.sequencePlayer.play); els.videoControlWrap.style.display = ''; els.videoFigure.style.display = ''; } else { window.removeEventListener('scroll', eventList.fixedScroller.play); } eventList.setStaticContents(); } else { eventList.setFixedContents(); } }, }; return { init: init } })();})();(function () { window.flagship = window.flagship || {}; window.flagship.features = window.flagship.features || {}; window.flagship.features.highlightsZone = (function () { const utils = window.flagship.common.utils; const resize = window.flagship.common.resize; let els = {}; let prevDevice; let swiperObj = {}; let pointerOffset = {}; let currDevice = resize.checkResolution(); let dimmedClass = 'is-dimmed'; let ctaPlayStatus = true; let scrollProgress = null; let lowNetwork = document.documentElement.classList.contains('low_network'); let isBgLoaded = false; const init = function () { els.section = document.querySelector('.features-highlights'); if (!!els.section) { setElements(); setProperty(); bindEvents(); } }; const setElements = function () { els.mainContainer = els.section.querySelector('.js-highlights-main-container'); els.mainSwiperSlides = els.mainContainer.querySelectorAll('.swiper-slide'); els.videoWrap = els.mainContainer.querySelectorAll('.js-video-wrap'); els.prevArrow = els.mainContainer.parentElement.querySelector('.swiper-button-prev'); els.nextArrow = els.mainContainer.parentElement.querySelector('.swiper-button-next'); els.scrollbar = els.section.querySelector('.js-highlights-scrollbar'); els.bgContainer = els.section.querySelector('.js-highlights-bg-container'); els.bgSwiperSlides = els.bgContainer.querySelectorAll('.swiper-slide'); }; const setProperty = function () { els.mainContainer.autoPlay = true; els.videoWrap = els.mainContainer.querySelectorAll('.js-video-wrap'); for (let i = 0; i < els.videoWrap.length; i++) { els.videoWrap[i].video = els.videoWrap[i].querySelector('.common-video__video'); els.videoWrap[i].image = els.mainContainer.querySelector('img'); els.videoWrap[i].controller = els.videoWrap[i].querySelector('.js-video-control'); els.videoWrap[i].controller.video = els.videoWrap[i].video; els.videoWrap[i].progressBar = els.videoWrap[i].querySelector('.common-video__control-progress-bar'); els.bgSwiperSlides[i].image = els.bgSwiperSlides[i].querySelector('img'); } }; const bindEvents = function () { eventList.load(); eventHandler.click(); eventHandler.scroll(); eventHandler.flickSwiper(); resize.add(eventList.resize); }; const eventHandler = { flickSwiper: function () { els.mainContainer.addEventListener('touchstart', function (e) { pointerOffset.start = null; pointerOffset.current = null; pointerOffset.start = e.touches[0].clientX; els.mainContainer.addEventListener('touchmove', eventList.getPointerMoveSize); }); els.mainContainer.addEventListener('touchend', function () { if (pointerOffset.start == null) return; els.mainContainer.autoPlay = false; els.mainContainer.removeEventListener('touchmove', eventList.getPointerMoveSize); }); els.mainContainer.addEventListener('mousedown', function (e) { pointerOffset.start = null; pointerOffset.current = null; pointerOffset.start = e.offsetX; els.mainContainer.addEventListener('mousemove', eventList.getPointerMoveSize); }); els.mainContainer.addEventListener('mouseup', function () { els.mainContainer.autoPlay = false; els.mainContainer.removeEventListener('mousemove', eventList.getPointerMoveSize); }); els.mainContainer.addEventListener('mouseleave', function () { if (pointerOffset.start == null) return; pointerOffset.start = null; pointerOffset.current = null; els.mainContainer.removeEventListener('mousemove', eventList.getPointerMoveSize); }); }, click: function () { for (let i = 0; i < els.videoWrap.length; i++) { els.videoWrap[i].controller.addEventListener('click', eventList.clickVideoCta); } for (let i = 0; i < els.videoWrap.length; i++) { els.videoWrap[i].controller.addEventListener('click', eventList.stopAutoPlay); } els.nextArrow.addEventListener('click', function (e) { eventList.stopAutoPlay(e) eventList.swiperArrow(e); }); els.prevArrow.addEventListener('click', function (e) { eventList.stopAutoPlay(e) eventList.swiperArrow(e); }); els.scrollbar.addEventListener('click', eventList.stopAutoPlay); }, scroll: function () { window.addEventListener('scroll', eventList.scroll) } } const eventList = { load: function () { swiperEvents.set(); swiperObj.main.init(); swiperObj.bg.init(); eventList.setVideo(); eventList.setScene(); eventList.scroll(); }, resize: function () { currDevice = resize.checkResolution(); if (prevDevice != currDevice) { eventList.responsive(); prevDevice = currDevice; }; }, responsive: function () { let desktopStatus = eventList.getCarouselSizeInfo(swiperObj.main).viewLength > 0 && currDevice == 'desktop'; eventList.resetDimmedSlide(swiperObj.main); swiperObj.main.slideTo(0, false); if (desktopStatus) eventList.initDimmedSlides(swiperObj.main); }, setVideo: function () { for (let i = 0; i < els.videoWrap.length; i++) { utils.videoHandler({ playType: 'scrollPlay', startPoint: currDevice != 'mobile' ? 40 : 24, reversePoint: currDevice != 'mobile' ? 88 : 80, wrap: els.videoWrap[i], video: els.videoWrap[i].video, controller: els.videoWrap[i].controller, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); } if (this.wrap.classList.contains('is-started')) { this.wrap.classList.remove('is-started'); } }, playCallback: function () { if (!this.wrap.classList.contains('is-started')) { this.wrap.classList.add('is-started'); } setTagging.pause(this.controller); eventList.setProgerssDuration(i); }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } if (els.mainContainer.autoPlay) { if (scrollProgress > 40 && scrollProgress < 55) { clearTimeout(swiperObj.main.videoTiming); swiperObj.main.videoTiming = setTimeout(() => { swiperObj.main.slideNext(); }, 1000); } } } }); } }, playVideo: function (video) { if (video.readyState >= 1) { video.play(); } else { video.addEventListener('canplay', function () { this.play(); }, { once: true }) } }, clickVideoCta: function (e) { if (e.target == e.currentTarget) { if (e.currentTarget.video.paused) { eventList.playVideo(e.currentTarget.video); ctaPlayStatus = true; } else { e.currentTarget.video.pause(); ctaPlayStatus = false; } } }, stopAutoPlay: function (e) { if (e.target.classList.contains('js-video-control') || e.target.classList.contains('swiper-button-next') || e.target.classList.contains('swiper-button-prev') || e.target.classList.contains('js-highlights-scrollbar') ) { els.mainContainer.autoPlay = false; }; }, swiperArrowVisiblirity: function () { let mainSlidesLength = els.mainSwiperSlides.length - 1; let mainSwiper = swiperObj.main; let prevArrow = mainSwiper.previousIndex > mainSwiper.realIndex; let nextArrow = mainSwiper.previousIndex < mainSwiper.realIndex; if (prevArrow) { if (mainSwiper.realIndex == (mainSlidesLength - 1)) { if (els.nextArrow.style.display == 'none') els.nextArrow.style.display = ''; } else if (mainSwiper.realIndex == 0) { els.prevArrow.style.display = 'none'; } }; if (nextArrow) { if (mainSwiper.realIndex == 1) { if (els.prevArrow.style.display == 'none') els.prevArrow.style.display = ''; } else if (mainSwiper.realIndex == mainSlidesLength) { els.nextArrow.style.display = 'none'; } }; }, swiperArrow: function (e) { let mainSwiper = swiperObj.main; let mainSlidesLength = els.mainSwiperSlides.length - 1; let prevArrow = e.target.classList.contains('swiper-button-prev'); let nextArrow = e.target.classList.contains('swiper-button-next'); if (prevArrow) { clearTimeout(swiperObj.main.videoTiming); mainSwiper.slidePrev(); if (mainSwiper.realIndex == 0) { setTimeout(() => { els.nextArrow.blur(); els.nextArrow.focus(); }, 300); } }; if (nextArrow) { clearTimeout(swiperObj.main.videoTiming); mainSwiper.slideNext(); if (mainSwiper.realIndex == mainSlidesLength) { setTimeout(() => { els.prevArrow.blur(); els.prevArrow.focus(); }, 300); } }; }, scroll: function () { els.section.scene.trackAnimation(function () { let isIndex = swiperObj.main.realIndex; let isMainVideoHandler = els.videoWrap[isIndex].video.videoHandler; scrollProgress = this.progress; if (!lowNetwork && ctaPlayStatus) isMainVideoHandler.scrollActive(this.progress); if (scrollProgress > 0 && !isBgLoaded) { for (let i = 0; i < els.bgSwiperSlides.length; i++) { if (!els.bgSwiperSlides[i].image.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([els.bgSwiperSlides[i].image]); } } isBgLoaded = true; } }); }, slideVideoPlay: function () { let isIndex = swiperObj.main.realIndex; let isVideoWrap = els.videoWrap[isIndex]; isVideoWrap.classList.add('is-ended'); setTimeout(function () { isVideoWrap.classList.remove('is-started', 'is-paused'); if (!ctaPlayStatus) isVideoWrap.video.paused(); isVideoWrap.video.currentTime = 0; if (ctaPlayStatus) { eventList.playVideo(isVideoWrap.video); setTimeout(function () { if (els.mainContainer.autoPlay) isVideoWrap.video.videoHandler.controller.blur(); if (els.mainContainer.autoPlay) isVideoWrap.video.videoHandler.controller.focus(); if (isIndex == (swiperObj.main.slides.length - 1)) { els.mainContainer.autoPlay = false; } }, 300); } }, 50); }, setProgerssDuration: function (index) { let isDuration = els.videoWrap[index].video.duration; if (!!!els.videoWrap[index].durationSet) { els.videoWrap[index].progressBar.style.animationDuration = `${isDuration}s`; els.videoWrap[index].durationSet = true; } }, setMedia: function (index) { let videoLength = els.mainSwiperSlides.length - 1; let isIndex = index + 1 let loadIndex = isIndex < videoLength ? isIndex : videoLength; let mainVideoloadComplateLength = els.mainContainer.querySelectorAll('.is-video-load-complete').length - 1; for (let i = 0; i <= loadIndex; i++) { if (mainVideoloadComplateLength != videoLength && !els.videoWrap[i].video.classList.contains('.is-video-load-complete')) { if (!!els.videoWrap[i].video) videoLoader.setResponsiveMedia([els.videoWrap[i].video]); if (!!els.videoWrap[i].image) imageLoader.setResponsiveMedia([els.videoWrap[i].image]); if (!!els.bgSwiperSlides[i].image) imageLoader.setResponsiveMedia([els.bgSwiperSlides[i].image]); } } }, pauseVideo: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { let isVideo = swiper.slides[i].querySelector('video'); if (!!isVideo && !isVideo.paused) { isVideo.pause(); }; }; }, getCarouselSizeInfo: function (swiper) { let slideLength = swiper.slides.length; let slideWidth = swiper.slides[0].clientWidth; let slideMargin = parseInt(window.getComputedStyle(swiper.slides[0]).margin.split(' ')[1]); let slideSize = slideWidth + slideMargin; let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiper.wrapperEl.clientWidth; let viewWidth = swiper.wrapperEl.clientWidth; let viewLength = parseInt((viewWidth + slideMargin) / slideSize); let lastBeforeSize = slideLength == 2 ? 0 : Math.abs((maxMoveSize - slideSize)) + Math.abs((viewWidth - slideWidth)); let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiper.wrapperEl).transform.split(',')[4])); return { slideWidth: slideWidth, slideMargin: slideMargin, slideSize: slideSize, maxMoveSize: maxMoveSize, viewWidth: viewWidth, viewLength: viewLength, lastBeforeSize: lastBeforeSize, isMoveSize: isMoveSize } }, setScene: function () { els.section.scene = SCROLLER({ trackElement: els.section, useFixed: false }); }, initDimmedSlides: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { if ((swiper.activeIndex + eventList.getCarouselSizeInfo(swiper).viewLength) <= i) { swiper.slides[i].classList.add(dimmedClass); } } }, setDimmedSlide: function (swiper) { if (currDevice != 'mobile') { for (let i = 0; i < swiper.slides.length; i++) { let dimmedSlide = (swiper.activeIndex) > i || (swiper.activeIndex + (eventList.getCarouselSizeInfo(swiper).viewLength - 1)) < i; if (dimmedSlide) { swiper.slides[i].classList.add(dimmedClass); } else { swiper.slides[i].classList.remove(dimmedClass); } } } }, resetDimmedSlide: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { swiper.slides[i].classList.remove(dimmedClass); } }, getPointerMoveSize: function (e) { if (!!e.touches) { pointerOffset.current = e.touches[0].clientX; } else { pointerOffset.current = e.offsetX; } } } const swiperEvents = { set: function () { if (swiperObj.main == null) { swiperObj.main = new Swiper(els.mainContainer, { init: false, slidesPerView: 'auto', scrollbar: { el: els.scrollbar, draggable: true }, }); swiperObj.main.on('init', swiperEvents.init); swiperObj.main.on('slideChange', swiperEvents.slideChange); swiperObj.main.on('transitionEnd', swiperEvents.transitionEnd); } if (swiperObj.bg == null) { swiperObj.bg = new Swiper(els.bgContainer, { init: false, slidesPerView: 'auto', allowTouchMove: false }); } els.prevArrow.style.display = 'none'; }, init: function () { let isNextArrow = this.el.parentElement.querySelector('.swiper-button-next'); let isPrevArrow = this.el.parentElement.querySelector('.swiper-button-prev'); isNextArrow.removeAttribute('aria-label'); isNextArrow.removeAttribute('role'); isPrevArrow.removeAttribute('aria-label'); isPrevArrow.removeAttribute('role'); accessibility.slide(this); if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice == 'desktop') eventList.initDimmedSlides(this); }, slideChange: function () { swiperObj.bg.slideTo(this.realIndex); accessibility.slide(this); eventList.pauseVideo(this); if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice == 'desktop') eventList.setDimmedSlide(this); if (this.realIndex > 0) eventList.setMedia(this.realIndex); if (!lowNetwork) eventList.slideVideoPlay(); eventList.swiperArrowVisiblirity(); let nextIndex = (this.realIndex < this.slides.length - 1) ? (this.realIndex + 1) : 0; let nextCoverImg = this.slides[nextIndex].querySelector('.common-video__cover-image'); if (imageLoader && !nextCoverImg.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([nextCoverImg]); } }, transitionEnd: function () { setTimeout(() => { let carouselInfo = eventList.getCarouselSizeInfo(this); let lastIndex = this.slides.length - 1; let lastSlide = this.slides[lastIndex]; let lastBeforeSlide = this.slides[lastIndex - 1]; let isIndex = swiperObj.main.previousIndex; let isMoveSize = currDevice != 'mobile' ? carouselInfo.isMoveSize : carouselInfo.isMoveSize + Math.abs(carouselInfo.slideMargin); els.videoWrap[isIndex].video.pause(); if (carouselInfo.maxMoveSize == isMoveSize) { lastSlide.classList.add('is-last-slide'); lastBeforeSlide.classList.add('is-dimmed'); lastSlide.classList.remove('is-dimmed'); if (currDevice == 'mobile') { eventList.pauseVideo(this); if (!lowNetwork && ctaPlayStatus) { lastSlide.querySelector('video').play(); }; lastSlide.classList.add('swiper-slide-active'); lastBeforeSlide.classList.remove('swiper-slide-active'); } } else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) { lastSlide.classList.add('is-dimmed'); lastSlide.classList.remove('is-last-slide'); lastBeforeSlide.classList.remove('is-dimmed'); if (currDevice == 'mobile') { eventList.pauseVideo(this); if (!lowNetwork && ctaPlayStatus) { lastBeforeSlide.querySelector('video').play(); }; lastSlide.classList.remove('swiper-slide-active'); lastBeforeSlide.classList.add('swiper-slide-active'); } } }, 0); }, destroy: function (swiper) { if (swiper != null) { swiper.navigation.destroy(true); swiper.destroy(true); swiper = null; } }, }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } } }; const accessibility = { slide: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { if (i != swiper.activeIndex) { utils.onAccessibility(swiper.slides[i]); } else { utils.offAccessibility(swiper.slides[i]); } } } }; return { init: init, } })();})();;(function () { window.flagship.features.interactiveSuggested = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}; let objs = {}; let stepInfo = []; let scrollProgress = null; let isPlaySection = null; const init = function () { els.section = document.querySelector('.js-suggested-replies'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.interactiveContent = els.section.querySelector('.js-interactive'); els.tutorialVideoContainer = els.section.querySelector('.common-interactive__tutorial'); els.videoList = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video'); els.videoWrap = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video'); els.videos = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video__video'); els.tooltipCta = els.tutorialVideoContainer.querySelectorAll('.js-tutorial-tooltip-cta'); els.tutorialReplay = els.tutorialVideoContainer.querySelector('.js-replay-cta'); }; const setProperty = function (el, index) { el.video = el.querySelector('video'); el.video.videoWrap = el; el.controller = el.querySelector('.js-video-control'); el.controller.video = el.querySelector('video'); el.alert = el.parentElement.querySelector('.common-tutorial__alert'); el.tooltip = el.parentElement.querySelector('.js-tutorial-tooltip'); el.tooltipCta = el.parentElement.querySelector('.js-tutorial-tooltip-cta'); el.video.playIndex = index; el.video.coverImage = el.querySelector('.common-video__cover-image'); }; const bindEvents = function () { for (let i = 0; i < els.videoWrap.length; i++) { setProperty(els.videoWrap[i], i); setStepStatus(els.videoList[i]) } setVideos(); eventList.videoController(); eventList.click(); eventList.setScroller(); eventHandler.scroll(); }; const setStepStatus = function (el) { stepInfo.push({ alert: el.getAttribute('data-alert'), tooltip: el.getAttribute('data-tooltip') }); }; const eventList = { setScroller: function () { if (els.interactiveContent.scene == null) { els.interactiveContent.scene = SCROLLER({ trackElement: els.interactiveContent, useFixed: false }); } }, scrollEvent: function () { if (els.interactiveContent.scene != null) { if (els.interactiveContent.classList.contains('is-tutorial-opened')) { els.interactiveContent.scene.trackAnimation(function () { scrollProgress = this.progress; let activeVideo = els.tutorialVideoContainer.querySelector('.is-visible video'); let firstVideoHandler = els.videoWrap[0].video.videoHandler; let replayStatus = !document.documentElement.classList.contains('low_network') && activeVideo.paused && !els.videoWrap[0].classList.contains(firstVideoHandler.endedClass) && !els.videoWrap[0].classList.contains(firstVideoHandler.pauseClass) && scrollProgress > 0 && scrollProgress < 100; let resetStatus = scrollProgress === 0 || scrollProgress === 100; if (replayStatus) { if (els.videoWrap[0].video.readyState == 4 && els.videoWrap[0].video.paused) { els.videoWrap[0].video.play(); } else { els.videoWrap[0].video.addEventListener('canplay', function() { els.videoWrap[0].video.play(); }, {once:true}); } } if (resetStatus) { activeVideo.pause(); activeVideo.currentTime = 0; eventList.tutorialReset(); } }); } } }, videoController: function () { for (let i = 0; i < objs.videos.length; i++) { objs.videos[i].controller.addEventListener('click', function () { if (this.video.paused) { this.video.play(); } else { this.video.pause(); } }); } }, nextVideoPlay: function (index) { if (!!els.videoList[index].tooltip) { utils.onAccessibility(els.videoList[index].tooltip); } els.videoList[index + 1].classList.add('is-visible'); utils.onAccessibility(els.videoList[index]); if (els.videos[index + 1].readyState > 3) { els.videos[index + 1].play(); } else { els.videos[index + 1].addEventListener('loadeddata', function () { if (this.paused) this.play(); }); } els.videoList[index].classList.remove('is-visible'); }, click: function () { let self = this; for (let i = 0; i < els.tooltipCta.length; i++) { els.tooltipCta[i].addEventListener('click', function () { self.nextVideoPlay(i); }); } }, tutorialReset: function () { let firstVideoHandler = els.videoWrap[0].video.videoHandler; els.videoWrap[0].classList.remove(firstVideoHandler.playClass); els.videoWrap[0].classList.remove(firstVideoHandler.pauseClass); els.videoWrap[0].classList.remove(firstVideoHandler.endedClass); // video wrap if (!els.videoList[0].classList.contains('is-visible')) { els.videoList[0].classList.add('is-visible'); } // tooltip if (!!els.videoWrap[0].tooltip && els.videoWrap[0].tooltip.classList.contains('is-visible')) { els.videoWrap[0].tooltip.classList.remove('is-visible'); } // tootip accessibility utils.offAccessibility(els.videoWrap[0]); if (!!els.videoWrap[0].tooltip) utils.onAccessibility(els.videoWrap[0].tooltip); for (let i = 0; i < els.videoWrap.length; i++) { if (i != 0) { if (els.videoList[i].classList.contains('is-visible')) { els.videoList[i].classList.remove('is-visible'); } if (!els.videoWrap[i].video.paused) { els.videoWrap[i].video.pause(); els.videoWrap[i].video.currentTime = 0; } // tooltip if (!!els.videoWrap[i].tooltip && els.videoWrap[i].tooltip.classList.contains('is-visible')) { els.videoWrap[i].tooltip.classList.remove('is-visible'); } utils.onAccessibility(els.videoWrap[i]); if (!!els.videoWrap[i].tooltip) utils.onAccessibility(els.videoWrap[i].tooltip); } } // replay cta els.tutorialReplay.style.display = 'none'; els.tutorialReplay.setAttribute('aria-hidden', true); els.tutorialReplay.setAttribute('tabindex', -1); } }; const eventHandler = { scroll: function () { window.addEventListener('scroll', eventList.scrollEvent); eventList.scrollEvent(); } } const setVideos = function () { objs.videos = []; for (let i = 0; i < els.videoWrap.length; i++) { let isVideoWrap = els.videoWrap[i]; objs.videos.push(utils.videoHandler({ wrap: isVideoWrap, video: isVideoWrap.video, controller: isVideoWrap.controller, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); if (this.controller.style.display = 'none') { this.controller.style.display = ''; } } }, playCallback: function () { els.videoList[this.video.playIndex].removeAttribute('tabindex'); els.videoList[this.video.playIndex].removeAttribute('aria-hidden'); this.controller.style.display = 'block'; utils.offAccessibility(this.controller); setTagging.pause(this.controller); let nextPlayindex = this.video.playIndex + 1; if ((els.videos.length - 1) > this.video.playIndex && els.videos[nextPlayindex].readyState < 4) { if (!els.videos[nextPlayindex].classList.contains('is-video-load-complete')) { videoLoader.setResponsiveMedia([els.videos[nextPlayindex]]); } if (!els.videos[nextPlayindex].coverImage.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([els.videos[nextPlayindex].coverImage]); } } }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { if (!!this.wrap.tooltip && stepInfo[this.video.playIndex].tooltip == 'true') { let self = this; if (!!this.wrap.tooltipCta) this.wrap.tooltipCta.removeAttribute('disabled'); if (!!this.wrap.tooltip) this.wrap.tooltip.classList.add('is-visible'); utils.offAccessibility(this.wrap.tooltip); } if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } this.controller.style.display = 'none'; if ((els.videos.length - 1) == this.video.playIndex) { els.tutorialReplay.style.display = 'block'; els.tutorialReplay.removeAttribute('tabindex'); els.tutorialReplay.removeAttribute('aria-hidden'); } } })); } }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } } }; return { init: init } })();})();;(function () { window.flagship.features.interactiveInterpreter = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}; let objs = {}; let stepInfo = []; let scrollProgress = null; let isMute = null; let isPlaySection = null; const init = function () { els.section = document.querySelector('.js-interpreter'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.interactiveContent = els.section.querySelector('.js-interactive'); els.tutorialVideoContainer = els.section.querySelector('.common-interactive__tutorial'); els.videoList = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video'); els.videoWrap = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video'); els.videos = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video__video'); els.tooltipCta = els.tutorialVideoContainer.querySelectorAll('.js-tutorial-tooltip-cta'); els.tutorialReplay = els.tutorialVideoContainer.querySelector('.js-replay-cta'); els.allVideoWrap = els.section.querySelectorAll('.js-video-wrap'); els.muteCta = els.section.querySelectorAll('.js-mute-cta'); // status isMute = !!els.muteCta && els.muteCta.length > 0; }; const setProperty = function (el, index) { el.video = el.querySelector('video'); el.video.videoWrap = el; el.controller = el.querySelector('.js-video-control'); el.controller.video = el.querySelector('video'); el.alert = el.parentElement.querySelector('.common-tutorial__alert'); el.tooltip = el.parentElement.querySelector('.js-tutorial-tooltip'); el.tooltipCta = el.parentElement.querySelector('.js-tutorial-tooltip-cta'); el.video.playIndex = index; el.video.coverImage = el.querySelector('.common-video__cover-image'); if (isMute) { el.muteCta = els.muteCta[index + 1]; } }; const bindEvents = function () { for (let i = 0; i < els.videoWrap.length; i++) { setProperty(els.videoWrap[i], i); setStepStatus(els.videoList[i]); } setVideos(); eventList.videoController(); eventList.click.tooltipCta(); eventList.setScroller(); eventHandler.scroll(); if (isMute) { muteEventHandler(); } }; const setStepStatus = function (el) { stepInfo.push({ alert: el.getAttribute('data-alert'), tooltip: el.getAttribute('data-tooltip') }); }; const muteEventHandler = function () { for (let i = 0; i < els.muteCta.length; i++) { muteEventList.setProperty(els.muteCta[i], i); muteEventList.setMuteBlindText(els.muteCta[i], i); muteEventList.click(els.muteCta[i], i); els.allVideoWrap[i].querySelector('video').style.pointerEvents = 'none'; } }; const muteEventList = { setProperty: function (muteCta, index) { muteCta.videoWrap = els.allVideoWrap[index]; muteCta.videoWrap.muteCta = muteCta; muteCta.video = els.allVideoWrap[index].querySelector('video'); muteCta.blind = muteCta.querySelector('.blind'); }, setMuteBlindText: function (muteCta) { muteCta.blind.innerText = muteCta.getAttribute('data-unmute'); }, click: function (muteCta) { muteCta.addEventListener('click', function () { let isMute = this.video.muted; if (!!isMute) { this.classList.remove('is-muted'); this.classList.add('is-unmuted'); this.blind.innerText = this.getAttribute('data-mute'); this.video.muted = false; setTagging.mute(this); } else { this.classList.remove('is-unmuted'); this.classList.add('is-muted'); this.blind.innerText = this.getAttribute('data-unmute'); this.video.muted = true; setTagging.unmute(this); } }); }, }; const eventList = { setScroller: function () { if (els.interactiveContent.scene == null) { els.interactiveContent.scene = SCROLLER({ trackElement: els.interactiveContent, useFixed: false }); } }, scrollEvent: function () { if (els.interactiveContent.scene != null) { if (els.interactiveContent.classList.contains('is-tutorial-opened')) { els.interactiveContent.scene.trackAnimation(function () { scrollProgress = this.progress; let activeVideo = els.tutorialVideoContainer.querySelector('.is-visible video'); let firstVideoHandler = els.videoWrap[0].video.videoHandler; let replayStatus = !document.documentElement.classList.contains('low_network') && activeVideo.paused && !els.videoWrap[0].classList.contains(firstVideoHandler.endedClass) && !els.videoWrap[0].classList.contains(firstVideoHandler.pauseClass) && scrollProgress > 0 && scrollProgress < 100; let resetStatus = scrollProgress === 0 || scrollProgress === 100; if (replayStatus) { if (els.videoWrap[0].video.readyState == 4 && els.videoWrap[0].video.paused) { els.videoWrap[0].video.play(); } else { els.videoWrap[0].video.addEventListener('canplay', function() { els.videoWrap[0].video.play(); }, {once:true}); } } if (resetStatus) { activeVideo.pause(); activeVideo.currentTime = 0; eventList.tutorialReset(); } }); } } }, videoController: function () { for (let i = 0; i < objs.videos.length; i++) { objs.videos[i].controller.addEventListener('click', function () { if (this.video.paused) { this.video.play(); } else { this.video.pause(); } }); } }, nextVideoPlay: function (index) { if (!!els.videoList[index].tooltip) { utils.onAccessibility(els.videoList[index].tooltip); } els.videoList[index + 1].classList.add('is-visible'); utils.onAccessibility(els.videoList[index]); if (els.videos[index + 1].readyState > 3) { els.videos[index + 1].play(); } else { els.videos[index + 1].addEventListener('loadeddata', function () { if (this.paused) this.play(); }); } els.videoList[index].classList.remove('is-visible'); }, click: { tooltipCta: function () { for (let i = 0; i < els.tooltipCta.length; i++) { els.tooltipCta[i].addEventListener('click', function () { eventList.nextVideoPlay(i); }); } } }, tutorialReset: function () { let firstVideoHandler = els.videoWrap[0].video.videoHandler; els.videoWrap[0].classList.remove(firstVideoHandler.playClass); els.videoWrap[0].classList.remove(firstVideoHandler.pauseClass); els.videoWrap[0].classList.remove(firstVideoHandler.endedClass); // video wrap if (!els.videoList[0].classList.contains('is-visible')) { els.videoList[0].classList.add('is-visible'); } // tooltip if (!!els.videoWrap[0].tooltip && els.videoWrap[0].tooltip.classList.contains('is-visible')) { els.videoWrap[0].tooltip.classList.remove('is-visible'); } // tootip accessibility utils.offAccessibility(els.videoWrap[0]); if (!!els.videoWrap[0].tooltip) utils.onAccessibility(els.videoWrap[0].tooltip); for (let i = 0; i < els.videoWrap.length; i++) { if (i != 0) { if (els.videoList[i].classList.contains('is-visible')) { els.videoList[i].classList.remove('is-visible'); } if (!els.videoWrap[i].video.paused) { els.videoWrap[i].video.pause(); els.videoWrap[i].video.currentTime = 0; } // tooltip if (!!els.videoWrap[i].tooltip && els.videoWrap[i].tooltip.classList.contains('is-visible')) { els.videoWrap[i].tooltip.classList.remove('is-visible'); } utils.onAccessibility(els.videoWrap[i]); if (!!els.videoWrap[i].tooltip) utils.onAccessibility(els.videoWrap[i].tooltip); } } // replay cta els.tutorialReplay.style.display = 'none'; els.tutorialReplay.setAttribute('aria-hidden', true); els.tutorialReplay.setAttribute('tabindex', -1); } }; const eventHandler = { scroll: function () { window.addEventListener('scroll', eventList.scrollEvent); eventList.scrollEvent(); } } const setVideos = function () { objs.videos = []; for (let i = 0; i < els.videoWrap.length; i++) { let isVideoWrap = els.videoWrap[i]; objs.videos.push(utils.videoHandler({ wrap: isVideoWrap, video: isVideoWrap.video, controller: isVideoWrap.controller, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); if (this.controller.style.display = 'none') { this.controller.style.display = ''; } } }, playCallback: function () { els.videoList[this.video.playIndex].removeAttribute('tabindex'); els.videoList[this.video.playIndex].removeAttribute('aria-hidden'); utils.offAccessibility(this.wrap.muteCta); if (!this.video.muted) { this.wrap.muteCta.classList.remove('is-unmuted'); this.wrap.muteCta.video.muted = true; this.wrap.muteCta.blind.innerText = this.wrap.muteCta.getAttribute('data-unmute'); setTagging.unmute(this.wrap.muteCta); } this.controller.style.display = 'block'; utils.offAccessibility(this.controller); setTagging.pause(this.controller); let nextPlayindex = this.video.playIndex + 1; if ((els.videos.length - 1) > this.video.playIndex && els.videos[nextPlayindex].readyState < 4) { if (!els.videos[nextPlayindex].classList.contains('is-video-load-complete')) { videoLoader.setResponsiveMedia([els.videos[nextPlayindex]]); } if (!els.videos[nextPlayindex].coverImage.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([els.videos[nextPlayindex].coverImage]); } } }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { if (!!this.wrap.tooltip && stepInfo[this.video.playIndex].tooltip == 'true') { let self = this; if (!!this.wrap.tooltipCta) this.wrap.tooltipCta.removeAttribute('disabled'); if (!!this.wrap.tooltip) this.wrap.tooltip.classList.add('is-visible'); utils.offAccessibility(this.wrap.tooltip); } if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } this.controller.style.display = 'none'; if ((els.videos.length - 1) == this.video.playIndex) { els.tutorialReplay.style.display = 'block'; els.tutorialReplay.removeAttribute('tabindex'); els.tutorialReplay.removeAttribute('aria-hidden'); } } })); } }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } }, mute: function (targetCta) { if (targetCta.hasAttribute('data-omni')) { let dataOmni = targetCta.getAttribute('data-omni').toLowerCase(); targetCta.setAttribute('data-omni', dataOmni.replace('unmute', 'mute')); } if (targetCta.hasAttribute('ga-la')) { let gaLa = targetCta.getAttribute('ga-la').toLowerCase(); targetCta.setAttribute('ga-la', gaLa.replace('unmute', 'mute')); } }, unmute: function (targetCta) { if (targetCta.hasAttribute('data-omni')) { let dataOmni = targetCta.getAttribute('data-omni').toLowerCase(); targetCta.setAttribute('data-omni', dataOmni.replace('mute', 'unmute')); } if (targetCta.hasAttribute('ga-la')) { let gaLa = targetCta.getAttribute('ga-la').toLowerCase(); targetCta.setAttribute('ga-la', gaLa.replace('mute', 'unmute')); } }, }; return { init: init } })();})();;(function () { window.flagship.features.interactive = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}, prevDevice = null, currDevice = resize.checkResolution(), scrollProgress = null; const init = function () { els.interactiveContents = document.querySelectorAll('.js-interactive'); if (!!els.interactiveContents && els.interactiveContents.length > 0) { for (let i = 0; i < els.interactiveContents.length; i++) { setProperty(els.interactiveContents[i], i); eventList.setIntroVideo(els.interactiveContents[i]); eventList.setIntroScene(els.interactiveContents[i]); bindEvents(els.interactiveContents[i], i); } } }; const setProperty = function (content, index) { // introVideo content.index = index; content.introVideo = content.querySelector('.js-interactive-intro-video video'); content.introVideo.videoWrap = content.querySelector('.js-interactive-intro-video'); content.introVideo.wrap = content.querySelector('.js-interactive-intro-video .js-video-wrap'); content.introVideo.parentWrap = content.parentElement; content.introVideo.controllerCta = content.introVideo.videoWrap.querySelector('.js-video-control'); content.introVideo.controllerCta.video = content.introVideo; content.introVideo.tooltip = content.querySelector('.js-tutorial-tooltip'); content.introVideo.tooltipCta = content.querySelector('.js-tutorial-tooltip-cta'); content.introVideo.tooltipCta.parentWrap = content; content.tutorialContentWrap = content.querySelectorAll('.js-tutorial-video'); content.tutorialContentWrap.tooltip = content.querySelectorAll('.js-tutorial-video .js-tutorial-tooltip'); // start, reverse point content.introVideo.wrap.startPoint = !!content.introVideo.wrap.getAttribute('data-start-point') ? parseInt(content.introVideo.wrap.getAttribute('data-start-point')) : undefined; content.introVideo.wrap.reversePoint = !!content.introVideo.wrap.getAttribute('data-reverse-point') ? parseInt(content.introVideo.wrap.getAttribute('data-reverse-point')) : undefined; content.introVideo.wrap.moStartPoint = !!content.introVideo.wrap.getAttribute('data-mo-start-point') ? parseInt(content.introVideo.wrap.getAttribute('data-mo-start-point')) : undefined; content.introVideo.wrap.moReversePoint = !!content.introVideo.wrap.getAttribute('data-mo-reverse-point') ? parseInt(content.introVideo.wrap.getAttribute('data-mo-reverse-point')) : undefined; // replayCta content.replayCta = content.querySelector('.js-replay-cta'); content.replayCta.parentWrap = content; }; const bindEvents = function (content, i) { eventHandler.click.introTooltipCta(content.introVideo.tooltipCta); eventHandler.click.replayCta(content.replayCta); eventHandler.click.videoController(content.introVideo.controllerCta); eventHandler.scroll(content); eventList.scroll(content); resize.add(function (currRes) { eventList.resize(currRes, content); }); }; const eventList = { setIntroVideo: function (content) { utils.videoHandler({ playType: 'scrollPlay', startPoint: content.introVideo.wrap.startPoint, reversePoint: content.introVideo.wrap.reversePoint, wrap: content.introVideo.wrap, video: content.introVideo, controller: content.introVideo.controllerCta, resetCallback: function () { if (this.wrap.classList.contains('is-completed')) { this.wrap.classList.remove('is-completed'); } if (this.wrap.classList.contains('is-started')) { this.wrap.classList.remove('is-started'); } if (this.video.tooltip.classList.contains('is-visible')) { this.video.tooltip.classList.remove('is-visible'); } content.introVideo.tooltip.classList.remove('is-visible'); utils.onAccessibility(content.introVideo.tooltip); utils.offAccessibility(content.introVideo.videoWrap); if (content.introVideo.controllerCta.style.display == 'none') { content.introVideo.controllerCta.style.display = 'block'; } }, playCallback: function () { if (!this.wrap.classList.contains('is-started')) { this.wrap.classList.add('is-started'); } setTagging.pause(this.controller); let videoWrap = content.tutorialContentWrap[0].querySelector('.js-video-wrap'); videoWrap.coverImg = videoWrap.querySelector('.common-video__cover-image'); videoWrap.video = videoWrap.querySelector('video'); if (!!videoWrap.coverImg && !videoWrap.coverImg.classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([videoWrap.coverImg]); } if (!!videoWrap.video && !videoWrap.video.classList.contains('is-video-load-complete')) { videoLoader.setResponsiveMedia([videoWrap.video]); } }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { let self = this; if (!this.wrap.classList.contains('is-completed')) { this.wrap.classList.add('is-completed'); } this.controller.style.display = 'none'; this.video.tooltip.classList.add('is-visible'); utils.offAccessibility(this.video.tooltip); } }); }, setIntroScene: function (content) { content.introVideo.scene = SCROLLER({ trackElement: content.introVideo, useFixed: false, resize: utils.detector.isTouchDevice ? false : true }); }, scroll: function (content) { if (!content.classList.contains('is-tutorial-opened')) { content.introVideo.scene.trackAnimation(function () { content.introVideo.videoHandler.scrollActive(this.progress); scrollProgress = this.progress; }); } }, click: { introVideoTooltipCta: function () { let content = this.parentWrap; content.classList.add('is-tutorial-opened'); content.introVideo.tooltip.classList.remove('is-visible'); utils.onAccessibility(content.introVideo.videoWrap); content.tutorialContentWrap[0].classList.add('is-visible'); utils.offAccessibility(content.tutorialContentWrap[0]); let videoWrap = content.tutorialContentWrap[0].querySelector('.js-video-wrap'); videoWrap.video.play(); }, replayCta: function () { let content = this.parentWrap; content.replayCta.style.display = 'none'; content.replayCta.setAttribute('aria-hidden', true); content.replayCta.setAttribute('tabindex', -1); for (let i = 0; i < content.tutorialContentWrap.length; i++) { content.tutorialContentWrap[i].classList.remove('is-visible'); if (!!content.tutorialContentWrap.tooltip[i]) { content.tutorialContentWrap.tooltip[i].classList.remove('is-visible'); } utils.onAccessibility(content.tutorialContentWrap[i]); setTimeout(function () { content.tutorialContentWrap[i].querySelector('video').currentTime = 0; }, 300); } content.introVideo.controllerCta.style.display = 'block'; content.introVideo.tooltip.classList.remove('is-visible'); utils.offAccessibility(content.introVideo.videoWrap); utils.onAccessibility(content.introVideo.tooltip); content.classList.remove('is-tutorial-opened'); content.introVideo.play(); }, videoController: function (e) { if (e.target == e.currentTarget) { if (e.currentTarget.video.paused) { e.currentTarget.video.play(); } else { e.currentTarget.video.pause(); } } }, }, reset: function (content) { if (content.classList.contains('is-tutorial-opened')) { content.classList.remove('is-tutorial-opened'); } // replay cta if (content.replayCta.style.display == 'block') { content.replayCta.style.display = 'none'; content.replayCta.setAttribute('aria-hidden', true); content.replayCta.setAttribute('tabindex', -1); } // tutorial video let tutorialWrap = content.tutorialContentWrap; for (let i = 0; i < tutorialWrap.length; i++) { tutorialWrap[i].classList.remove('is-visible'); utils.onAccessibility(tutorialWrap[i]); // video tutorialWrap[i].video = tutorialWrap[i].querySelector('video'); if (!tutorialWrap[i].video.paused) { tutorialWrap[i].video.pause(); tutorialWrap[i].video.currentTime = 0; } // tooltip if (!!tutorialWrap.tooltip[i]) { if (tutorialWrap.tooltip[i].classList.contains('is-visible')) { tutorialWrap.tooltip[i].classList.remove('is-visible'); } utils.onAccessibility(tutorialWrap.tooltip[i]); } } // intro video utils.offAccessibility(content.introVideo.videoWrap); if (content.introVideo.controllerCta.style.display == 'none') { content.introVideo.controllerCta.style.display = 'block'; } // intro tooltip if (content.introVideo.tooltip.classList.contains('is-visible')) { content.introVideo.tooltip.classList.remove('is-visible') } if (scrollProgress >= 40 && scrollProgress <= 60) { if (content.introVideo.paused) { content.introVideo.currentTime = 0; content.introVideo.play(); } } }, resize: function (currRes, content) { currDevice = currRes; if (prevDevice != currDevice) { eventList.reset(content); } prevDevice = currDevice; }, }; const eventHandler = { click: { replayCta: function (replayCta) { replayCta.addEventListener('click', eventList.click.replayCta); }, introTooltipCta: function (introTooltipCta) { introTooltipCta.addEventListener('click', eventList.click.introVideoTooltipCta); }, videoController: function (introVideoController) { introVideoController.addEventListener('click', eventList.click.videoController); } }, scroll: function (content) { window.addEventListener('scroll', function () { eventList.scroll(content); }); } }; const setTagging = { play: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('pause', 'play')); } }, pause: function (targetController) { if (targetController.hasAttribute('data-omni')) { let dataOmni = targetController.getAttribute('data-omni').toLowerCase(); targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause')); } if (targetController.hasAttribute('ga-la')) { let gaLa = targetController.getAttribute('ga-la').toLowerCase(); targetController.setAttribute('ga-la', gaLa.replace('play', 'pause')); } } }; return { init: init } })();})();;(function () { window.flagship.features.lowLightPortrait = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}, prevDevice = null, currDevice = resize.checkResolution(); const init = function () { els.section = document.querySelector('.features-lowlight-portrait'); if (!!els.section) { setElements(); bindEvents(); } }; const setElements = function () { els.image = els.section.querySelector('.features-lowlight-portrait__interaction-image'); els.videoWrap = els.section.querySelector('.js-portrait-video-wrap'); els.video = els.videoWrap.querySelector('.js-portrait-video'); }; const bindEvents = function () { resize.add(eventList.resize); eventList.setScene(); eventList.scroll(); eventHandler.scroll(); els.image.addEventListener('transitionend', eventList.videoPlay); }; const eventHandler = { scroll: function() { window.addEventListener('scroll', eventList.scroll); } } const eventList = { resize: function (currRes) { currDevice = currRes; if (currDevice != prevDevice) { prevDevice = currDevice; } }, setVideo: function() { let movPlayStatus = document.documentElement.classList.contains('ios') && document.documentElement.classList.contains('safari') || document.documentElement.classList.contains('mac') && document.documentElement.classList.contains('safari'); if (!movPlayStatus) { els.video.src = els.video.getAttribute('data-video-src'); } else { els.video.src = els.video.getAttribute('data-ios-video-src'); } els.video.classList.add('is-loaded'); }, setScene: function() { SCROLLER({ trackElement: els.section, }); }, scroll: function() { els.section.scroller.trackAnimation(function() { if (els.video.readyState < 4 && this.progress >= 0 && !els.video.classList.contains('is-loaded')) { eventList.setVideo(); } if (this.progress > 15) { if (!els.section.classList.contains('is-active')) els.section.classList.add('is-active'); } else if (this.wheelDirection == 'up' && this.progress <= 0) { if (els.section.classList.contains('is-active')) els.section.classList.remove('is-active'); } }); }, videoPlay: function() { clearTimeout(els.video.playState); els.video.currentTime = 0; els.video.play(); els.video.playState = setTimeout(() => { els.video.currentTime = 0; els.video.pause(); }, 1500); } }; return { init: init } })();})();(function () { window.flagship.features.moveFeature = (function () { const utils = window.flagship.common.utils; let els = {}; const init = function () { els.jumpCta = document.querySelectorAll('.js-jump-cta'); if (!!els.jumpCta) { setProperty(); bindEvents(); } }; const setProperty = function () { for (let i = 0; i < els.jumpCta.length; i++) { els.jumpCta[i].sectionId = els.jumpCta[i].getAttribute('href'); els.jumpCta[i].section = document.querySelector(`${els.jumpCta[i].sectionId}`); els.jumpCta[i].returnCta = els.jumpCta[i].section.querySelector('.js-return-cta'); els.jumpCta[i].returnCta.jumpCta = els.jumpCta[i]; els.jumpCta[i].returnCta.section = els.jumpCta[i].section; } }; const bindEvents = function () { eventHandler.click(); eventList.setScene(); eventHandler.scroll(); }; const eventHandler = { click: function () { for (let i = 0; i < els.jumpCta.length; i++) { els.jumpCta[i].addEventListener('click', eventList.clickJumpCta); els.jumpCta[i].returnCta.addEventListener('click', eventList.clickReturnCta); } }, scroll: function () { window.addEventListener('scroll', eventList.hideReturnCta); } }; const eventList = { setScene: function () { for(let i=0; i