Galaxy Z Fold4
- REVIEWS
- SPECIFICATIONS
- SUPPORT
- COMPARE
Buy now
- Highlights
- Showroom
- Accessories
- REVIEWS
- SPECIFICATIONS
- SUPPORT
- COMPARE
PRE-REGISTER Pre-order now BUY NOW WHERE TO BUY
Check out these fresh angles
-
@supersaf. Supersaf is seen in his studio speaking directly to the camera. Disclaimer: Tech reviewers share their thoughts on the Galaxy Z Fold4. No payment was made to create the review. A license was obtained for a fee after content was posted on YouTube. Availability of model and colors may vary by country and carrier. A view of the Main Screen, folded to stand vertically. Hear what the experts have to say. Galaxy Z Fold4. @mkbhd. MKBHD is in his studio. @unboxtherapy. On the table in front of Unbox Therapy are two black Galaxy smartphone boxes. Quote from Unbox Therapy: “A phone and a tablet that’s in your pocket at all times.” Supersaf holds a folded Galaxy Z Fold4 in Graygreen in his hand. Design. MKBHD twirls the device in his hand to provide a close up of various angles of the device, including a close shot of the rear cameras. Quote from MKBHD: “Firm and confidence-inspiring.” Next, a close up of the top edge of the device as it folds closed. Durability. Quote from Supersaf: “This is a little bit more durable for the back as well as the cover display.” Supersaf holds a folded Galaxy Z Fold4 device in each hand with the rear cover facing up. One is in Graygreen and one is in Phantom Black. Next, as MKBHD speaks, a close up view of the Cover Screen and hinge. Next, Supersaf excitedly sprays water from a garden hose. Quote from Supersaf: “It is still mind-blowing that we’ve got a foldable device that has water resistance.” Multitasking. On an unfolded Main Screen, the Setting menu is in Multi View. Then, the shot zooms in to the new Taskbar at the bottom of the display, including an App Pair icon. Supersaf demonstrates how to use the Taskbar by tapping on app icons to quickly switch between apps. Camera. Now, three Galaxy Z Fold4 devices are in front of Unbox Therapy, representing three available colors: Graygreen, Phantom Black and Beige. Next, the camera pans over the devices to showcase the three different colors. Next, a close up shot of the Under Display Camera. The display is rotated to an angle to reveal the hidden camera located on the Main Screen. Quote from MKBHD: “The hidden selfie camera is actually very impressive.” A shot of the Main Screen shows that the camera is not visible when viewed directly from the front. @gadgetmatch. Michael Josh from Gadget Match is in a city setting to demonstrate the camera features. He taps the Cover Screen Preview icon in the Camera app, and a popup indicates that the Cover screen preview is on. When viewed from the rear, the Cover Screen is displaying a live preview from the Rear Cameras like a mirror for the subject to see themselves. A friend takes photos of Gadget Match’s Michael Josh as he poses for the camera. The resulting photo is vivid with sharp details and well framed. Samsung dot com. Samsung logo.
Previous Slide Next Slide
Movie player Layer
-
"The Z Fold4 is still unmatched in terms of productivity and multitasking."
Forbes Patrick Moorhead
From Forbes. © 2022 Forbes. All rights reserved. Used under license.
Samsung Galaxy
Z Fold4 and Z Flip4"Foldable devices are about to be not just a thing, but THE thing"
TechRadar 08/2022
Previous Slide Next Slide
- Powerful. Productive
- Big, immersive display
- Our toughest foldable yet
- Nightography camera
- Unfold your world
Flex on all the others
FORM FACTOR
Stands out. Stands up. Unfolds
Easy to use in one hand with a 6.2-inch Cover Screen.1 In both hands, the 7.6-inch Main Screen makes it your ultimate do-more device.2 And when you need to go hands-free, simply set it down, find a good angle and leave it there while you get more done.3
- *Image simulated for illustrative purposes. Actual UI may be different.
- *Netflix streaming membership required.
Cover Screen
A wider aspect ratio lets your apps comfortably fill the screen, but still keeps keys within thumb’s reach for one-handed control.
- *Compared to Galaxy Z Fold3 5G.
SIZE & WEIGHT
A new spin on slim
It's basically two phones in one — with nearly the weight of a less-flexible phone. Slimmed down everywhere but the screen, minimized bezels and lightweight materials make Galaxy Z Fold4 even more pocket-friendly.
COLOURS
Finishes with finesse
The elegant combination of a unique form factor with naturally classic colours turns heads with every unfold. Select from Graygreen, Phantom Black or Beige.4
GalaxyZFold4 in Graygreen seen from three angles to show the corner, hinge and rear.
GalaxyZFold4 in Phantom Black seen from three angles to show the corner, hinge and rear.
GalaxyZFold4 in Beige seen from three angles to show the corner, hinge and rear.
ONLINE EXCLUSIVE COLOUR
A stand-out selection
Discover a Galaxy Z Fold4 that's even more exclusive.
Meet Galaxy Z Fold4 in Burgundy, only on Samsung.com.5, 6
Burgundy
Work-life balance brought to mobile
Partially unfolded GalaxyZFold4 Main Screen. Its screen is divided into two windows. One window is a memo in GalaxyNotes. The other window is a video being played in the Gallery app.
MULTITASKING
Do more than more
Accomplish more tasks with fewer taps. Add apps to the Taskbar, your multitasking secret weapon, for quick navigation and bouncing between windows when you're in the groove.7 And with App Pair, one tap launches up to three apps, all sharing one super-productive screen.8
- *Image simulated for illustration purposes. Actual UI may be different.
Unfolded GalaxyZFold4 with three windows open on the Main Screen. The Gallery app is open on the left half of the Main Screen. The right side is divided into two apps. Samsung Notes is open on the top right. The Messages app is open on the bottom right. A photo from the Gallery is placed in Samsung Notes and shared in the Messages chat.
MULTI VIEW
Give your back button a break
Whether toggling between texts or catching up on emails, take full advantage of the expansive Main Screen with Multi View. Apps optimized with One UI give you menus and more in a glance for faster, more efficient multitasking on a smartphone.
- *Image simulated for illustrative purposes. Actual UI may be different.
- *GalaxyZFold4 requires the latest Microsoft Outlook (minimum version 4.2222.0.) for this feature.
- *Screen layout adjustment availability may vary by app.
- *Availability of feature may vary by country or region.
SPEN
Write where you need it
Move beyond finger-to-screen with the compatible SPen.9 Get natural precision with every stroke that feels as familiar as pen on paper.
Better together
Standing Cover with Pen10
For hands-free viewing
GalaxyZFold4 in Phantom Black seen from the rear. An SPen Fold Edition is placed along the rear side.
IMMERSIVE VIEW
Immersive, impressive
Now you can really get into the zone. Pushed-back bezels plus an even more camouflaged Under Display Camera on a breathtaking 7.6-inch Infinity Flex Display means there's more screen and no black dot getting between you and your favourite games.2, 11, 12
- *© 2019-2022 Riot Games, Inc. LEAGUE OF LEGENDS: WILD RIFT and any associated logos are trademarks, service marks, and/or registered trademarks of Riot Games, Inc.
- *Image simulated for illustrative purposes. Actual UI may be different.
Enhance your large-screen experience with the immersive Dolby Atmos audio experience and stereo speakers.
Better together
Galaxy Buds2 Pro13
For crystal clear audio
Go to Galaxy Buds2 Pro
120HZ DISPLAY
120Hz.
Smooth gaming.
Smooth viewing
Swiping through the newsfeed or gliding through games, it all flows smoothly on a display that ramps up to 120Hz. This refreshingly responsive screen even adapts the refresh rate to optimize the view for you.14
- *Image simulated for illustrative purposes. Actual UI may be different.
120Hz
PARTNERSHIPS
Folding all your faves into one device
Out of the box, GalaxyZFold4 comes with plenty of tools to get your gears moving. And when you add third-party apps optimized for Multi View, you'll be unlocking new levels of convenience with every tap.
Layer Popup Close
These apps are lookin' good on Galaxy Z Fold4
Multi View has expanded to even more of your favorite third-party apps.
*YouTube, Google Photos, Gmail, Chrome and other marks are trademarks of Google LLC.
A collage of mobile app icons including Google Search, Chrome, YouTube, Youtube Music, Google Meet, Android Message, Google Photos, Gmail, Microsoft Outlook, Microsoft Teams, Microsoft office, Microsoft One Drive, Candy Camera, Microsoft OneNote, Microsoft To Do, Whatsapp, facebook, Instagram, Naver Series, Tik Tok, WPS Office, Clip Studio Paint, Noteshelf, Zoom, SofaScore, Apartment dotcom, Concepts, Signal, My Radar, Bluejeans, Art Flow, Netflix, Spotify, Adobe Acrobat Reader, and Ebay.
Unbelievable tech, unbreakable design
A folded GalaxyZFold4 seen at an angle showing its Cover Screen and bottom sides. The display has a colourful graphic wallpaper onscreen. The phone has water splashing around it.
IPX8 WATER RESISTANCE
The first foldables that can take on water
Be adventurous. You don't have to sweat the forecast when you've got one of the world's first water-resistant foldable smartphones.15
EXTERIOR
Prepared for impact
From the inside out, GalaxyZFold4 is made with materials that are not only stunning, but stand up to life's bumps and fumbles. From the glass to the metal, these are the toughest Samsung Galaxy foldables ever.
-
Rough days are no match for our toughest foldables ever with exclusive Corning® Gorilla® Glass Victus®+. The Cover Screen and back cover are ready to resist sneaky scrapes and scratches with confidence.
-
This phone is reinforced with our toughest aluminum frame. Appropriately named, Armor Aluminum acts like a suit of armor, protecting your folds from damage.
-
It's never been so strong. Foldable, limber and built to last, the unique composition of the Main Screen stands up to everyday wear and tear.
A collage of four GalaxyZFold4 phones. One phone is seen from the front at an angle with layers coming off of the display to represent its strength. Two phones are seen from the side to show the extruded shape and three lenses of the linear Rear Camera. The fourth is seen partially unfolded, its Main Screen facing forward. The display has a colourful graphic wallpaper onscreen.
SAMSUNG CARE+
Physical and Liquid damage can be forgiven
Enroll in a worry-free Samsung Care+ to stay protected from physical and liquid damage.16
LEARN MORE
Your nights just got more flexible
MULTI-CAMERA SYSTEM
Pro-grade Camera that stands on its own
With the upgraded Rear Camera, Space Zoom and Nightography, we're bringing a pro-level kit to the foldable form for the first time.17 Use the massive Main Screen as a viewfinder to flex your photo skills with new tech.
12MP Ultra Wide Camera
50MP Wide-angle Camera
10MP 3x Optical Zoom Telephoto Camera
4MP Under Display Camera
10MP Cover Camera
NIGHTOGRAPHY
Shots in the dark hit different
Play
#withGalaxy
When action-packed days turn to action-packed nights, details stay clear after dark. Advanced OIS and VDIS smooth out video while Super Night Solution limits noise — all for stunning low-light clips begging to be replayed.
#withGalaxy
It's never too late for great portraits. GalaxyZFold4's rear cameras use innovative hardware and software that work together to bring more light to low-light photos. From dusk to dawn and beyond, a powerful processor gives an intelligent boost of colour and clarity to every shot.
HIGH RESOLUTION
Nail the details
With the 50MP Wide-angle Camera, even quick snaps are high-resolution masterpieces. Elevate depth and sharpness with Detail Enhancer, taking the best aspects of your shots and leaving blur behind.
#withGalaxy
30X Space Zoom
30X SPACE ZOOM
Fold's best zoom, so far
Scooch in closer with 30X Space Zoom. The Telephoto Camera's 3x Optic Zoom teams up with Super Resolution Zoom to bring you closer to the action than ever before on a Fold.17
#withGalaxy
Camera Essentials
-
Dual Preview
Let your subject play creative director. The preview appears on the Cover Screen, giving them a chance to adjust and look their best before you snap.18
-
Capture View
Like a photo monitor in your pocket, Capture View shows you previews of the photos you just took, so you can check and reshoot with ease.
-
Rear Cam Selfie
Bust out the selfies in high resolution. The Cover Screen acts as viewfinder, letting you capture your best side with the 50MP Wide Camera.
-
Expert RAW
Pro mode leaps to another level when you download Expert RAW. Take full control over your shots and save the RAW files right to your Gallery.19
-
AI Edit
Now post-production takes place on your phone. Retouch photos with ease using Photo Remaster and remove the things you don't want with Object Eraser.
The connected power of Samsung Galaxy
Galaxy Z Flip4 LEARN MORE Pre-order now
Galaxy Watch5 LEARN MORE BUY NOW
Galaxy Buds2 Pro LEARN MORE
*GalaxyZFlip4, Galaxy Watch5 and Galaxy Buds2 Pro sold separately.
Smart Switch
Pick up where you left off
No matter what device you're laying to rest, move your favourite apps, photos, messages and even settings to your new GalaxyZFold4 in just a few simple steps.21
- *Image simulated for illustrative purposes. Actual UI may be different.
Go to Smart Switch
GALAXY EXCELLENCE The brilliance is built in
-
4NM PROCESSOR
More power to you
From video calls to rapid-fire edits, you need your day to run smoothly. And it will, on the most powerful chip now on a Samsung Galaxy foldable.22
-
5G
Fueled by 5G
Say goodbye to small talk while your download's progress bar crawls. Hyperfast 5G lets you send and receive massive files in a flash.23
-
Wi-Fi 6E
No mixed signals. Just speed
Wi-Fi 6E gives you faster, more stable access to new 6GHz bands, so you can connect and stay connected at cutting-edge internet speeds.24
-
INTELLIGENT DUAL BATTERY
Power past expectations
Designed to keep up with your routine. Two batteries total 4400mAh (typical) to power your day, then fuel up in a flash with Fast Charging.25, 26, 27
-
STORAGE
Space for your brainstorms
Ditch the briefcase and keep your files, photos and everything else on hand. With so much storage built in, there's space to balance work and life.28
Sync your Gallery with OneDrive, and enjoy 6 months of 100 GB OneDrive cloud storage with Galaxy Z Fold4 and Galaxy Z Flip4.29, 30 *Terms and conditions apply.
-
SIDE FINGERPRINT
One-touch VIP access
Masked up? Sunglasses on? No problem — the Main Screen's just a touch away. One finger on the side of the screen unlocks quickly and accurately.
-
SAMSUNG KNOX
Multi-layered security
Keep your private data private with Samsung Knox. Multi-layered security through hardware and software offers defense-grade protection.
-
ONE UI
What you need, where you need it
Fold owners know what it means to be unique. One UI lets you customize your digital experience to match your style and how you use your Android phone.
ACCESSORIES
Bring style into the Fold
LEARN MORE
Layer Popup Close
Frequently Asked Questions
-
GalaxyZFold4 comes in three basic colours — Graygreen, Phantom Black and Beige — as well as an online exclusive colour, Burgundy.4, 5, 6
GO TO COLOURS
-
GalaxyZFold4 is lighter and more durable than its predecessor. It now boasts the fastest processor in the Samsung GalaxyZFold series. With even more apps optimized for its large, foldable screen, GalaxyZFold4 is your ultimate multitasking device.8
-
Galaxy Z Fold4's Wide Camera has increased to 50MP and the Telephoto Camera has improved to 3x optical zoom, delivering 30X Space Zoom, our farthest zoom yet.17 You can now enjoy a premium-level Nightography experience with brighter, more detailed low-light photos.
GO TO CAMERA
-
Yes, you can use SPen Fold Edition and SPen Pro on GalaxyZFold4. However, SPens for other models may cause damage to the screen and should not be used on GalaxyZFold4.9
GO TO SPEN
-
GalaxyZFold4's Main Screen measures 7.6 inches and its Cover Screen measures 6.2 inches when measured diagonally. When accounting for the rounded corners, the screens measure 7.4 inches and 6.1 inches, respectively.1, 2
GO TO IMMERSIVE VIEW
-
GalaxyZFold4 is great for multitasking. It allows you to split the screen to use up to three apps at once, even supporting drag and drop across apps.8 Quickly move between apps with the improved Taskbar, and see more of your favourite apps with Multi View.7
GO TO MULTITASKING
Previous page Next page
- HIGHLIGHTS
- SHOWROOM
- ACCESSORIES
Go to GalaxyZFlip4
Make the Smart Switch
EXPLORE MORE
BUY NOW PRE-REGISTRATION Pre-order now WHERE TO BUY
Your Galaxy. Your way.
Galaxy devices give you more ways to connect and the freedom to make your experience exactly how you want it.
EXPLORE MORE
Welcome to the epic standard of doing business GO TO SAMSUNG BUSINESS
- High bandwidth mode - Low bandwidth mode
*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.
- Measured diagonally, Galaxy Z Fold4's Cover Screen size is 6.2" in the full rectangle and 6.1" accounting for the rounded corners; actual viewable area is smaller due to the rounded corners and camera hole.
- Measured diagonally, Galaxy Z Fold4's Main Screen size is 7.6" in the full rectangle and 7.4" accounting for the rounded corners; actual viewable area is less due to the rounded corners.
- Flex mode supported at angles between 75°and 115°. Some apps may not be supported in Flex mode. It is recommended to keep the phone stationary while in Flex mode.
- Colour availability may vary depending on country, region, or carrier.
- Exclusive color availability may vary depending on country, region, or carrier.
- Online exclusive colors need special production. Please allow 3 to 4 weeks (estimate) for delivery.
- Taskbar must be turned on under settings. Taskbar feature supported on the Main Screen only.
- Certain applications may not support Multi Active Window or App Pair.
- SPen Fold Edition sold separately. Only use the Samsung SPen Fold Edition designed exclusively for GalaxyZFold3 5G/Fold4 or SPen Pro. All other SPens or stylus pens not designed for GalaxyZFold4 (including those by other manufacturers) may damage the screen. The GalaxyZFold4 does not have a built in slot for the SPen. SPen support is limited to the Main Screen.
- Standing Cover with Pen sold separately.
- When compared to GalaxyZFold3 5G.
- UDC (Under Display Camera) supports up to 4MP.
- Galaxy Buds2 Pro sold separately.
- Adaptive refresh rate performance may vary depending on app and usage conditions, such as settings.
- Refers to GalaxyZFold4, Z Flip4, Z Fold3 5G and Z Flip3 5G. GalaxyZFold4 is rated as IPX8. IPX8 is based on test conditions for submersion in up to 1.5 meters of freshwater for up to 30 minutes. Not advised for beach or pool use. Not dust-resistant.
- Samsung Care+ coverage may vary by country and deductibles may apply.
- 30X Space Zoom includes 3x Optical Zoom and 30x digital zoom with AI Super Resolution technology. Zooming in past 3x may cause some image deterioration.
- Dual Preview supported on devices running One UI 2.1 and above.
- Expert RAW must be downloaded separately from the Galaxy Store, for free, before use.
- In order to send or receive files with Quick Share, both the sending and receiving devices must have Wi-Fi and the Quick Share feature turned on. Quick Share is available on Samsung Galaxy smartphones and tablets on Android OS version 10.0(Q) and One UI 2.1 or above, Galaxy Book Ion, Ion 2, Flex, Flex Alpha, Flex 2, Flex 2 Alpha and Galaxy Book S launched in or after May 2021 and Samsung Notebook Odyssey, Plus and Plus2 launched in or after 2020. Receiving Galaxy device(s) must support Wi-Fi Direct or Wi-Fi Aware. Transfer speed may vary depending on the device’s Wi-Fi connectivity specifications, Multi Device Experience availability, and network environment.
- Wired transfers require at least Android™ 4.3, iOS 5 or Windows Mobile OS 8.1 or OS 10 on your old device. Devices with an older OS must use wireless transfer options. If you do not have the required USB cable/connector for a wired transfer to Samsung Galaxy, you can also use wireless transfer options. Open Smart Switch Mobile in “Settings” on your new Galaxy phone or download Smart Switch for PC/Mac. Data and content available for transfer may vary by OS. To transfer data from iCloud or other cloud storage services, a data connection is required. To avoid disruption in text messaging when transferring from iOS, change your iMessage settings appropriately.
- Compared to previous Samsung Galaxy foldables.
- Requires optimal 5G connection. Actual speed may vary depending on country, carrier and user environment.
- Wi-Fi 6E availability may vary due to location, network conditions, and other factors. Wi-Fi 6E wireless network routers are required and sold separately.
- 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 4275mAh.
- Estimated against the usage profile of an average/typical user. Independently assessed by Strategy Analytics between 2022.07.07-07.12 in USA with pre-release versions of SM-F936U under default setting using 5G Sub6 networks (NOT tested under 5G mmWave network). Actual battery life varies by network environment, features and apps used, frequency of calls and messages, number of times charged, and many other factors.
- Fast Wireless Charger sold separately.
- Actual storage availability may vary depending on pre-installed software.
- Availability of Gallery sync through Microsoft OneDrive may vary depending on country or region. Requires set up of OneDrive syncing on your Samsung Galaxy device. Start with 5GB of free cloud storage or upgrade to a subscription for more storage.
- Six-month trial of OneDrive 100GB cloud storage available for consumers who have purchased a Galaxy Z Fold4 and Galaxy Z Flip4 only. Availability may vary. Google Play’s terms and conditions apply. Refer to https://www.microsoft.com/onedrive-samsung-offer for details.
" ); } else { $yvSlide .find("li:last > div") .attr("role", "list") .append( '
' + yvThumbArray[i] + "
" ); } } var omniTxt = modelData + $yvSlidePagingOmni; $yvSlide.find("li").each(function (i) { var n = i * thumbLength; var title = yvTitleArr.slice(n, n + thumbLength).toString(); $( '' + pageTitle + " " + (i + 1) + ":" + title + "" ).appendTo($yvSlidePaging); }); $yvSlide.find("li").each(function () { if ($(this).find("> div .thumb").length < 2) { $(this).find("> div").removeAttr("role"); $(this).find("> div .thumb").removeAttr("role"); } }); var meetSwipe = GALAXY.swipeAble; if ( ($html.hasClass("ie") || $html.hasClass("edge")) && $html.hasClass("rtl") ) { meetSwipe = false; } $yvSlide.xlider({ swipe: meetSwipe, endless: true, arrows: [ $yvWrap.find(".m_btn_type1-prev"), $yvWrap.find(".m_btn_type1-next"), ], paging: $yvSlidePaging, onMove: function onMove() { $yvSlideWrap .find("li") .removeClass("view") .removeAttr("aria-hidden tabindex"); $yvSlideWrap.removeClass("ie-error"); }, onChange: function onChange() { $yvSlideWrap .find("li") .removeClass("view") .removeAttr("aria-hidden tabindex"); $yvSlideWrap.removeClass("ie-error"); }, onChangeEnd: function onChangeEnd(i) { var select = $yvSlidePaging.data("btn-title"); sliderOmni.remove(); $yvSlideWrap .find(".xlider-current") .removeClass("view") .siblings() .addClass("view") .attr({ "aria-hidden": "true", tabindex: -1, }); $yvSlidePaging .find("a") .eq(i) .attr("title", select) .siblings() .attr("title", ""); $yvSlideWrap.addClass("ie-error"); }, }); $yvWrap .off("mousedown.yv keydown.yv") .on( "mousedown.yv keydown.yv", ".slide-paging a, .arrow-wrap a", function (e) { sliderOmni.add(e, this); } ); $yvSlide.find("li").each(function () { if ($(this).find(".thumb").length == 1) { $(this).removeAttr("role").find(".thumb").removeAttr("role"); } }); } else { $yvWrap.addClass("no-slide"); } }; var yvLoad = function yvLoad() { // if (!yvLoaded && window.pageYOffset > 10) { yvLoaded = true; GALAXY.sizeMode && $yvSlide.find("img").each(function (i, img) { this.src = GALAXY.getImageSources($(img))[GALAXY.sizeMode]; img.src = img.getAttribute("data-media-s4"); if (GALAXY.sizeMode >= 3) { img.src = img.getAttribute("data-media-s4"); } else if (GALAXY.sizeMode <= 2) { img.src = img.getAttribute("data-media-s2"); } }); // } }; var yvSlideDestroy = function yvSlideDestroy() { yvThumbArray = []; $yvSlidePaging.html(""); $yvSlide.removeAttr("style").xlider("remove"); $yvSlide.html(yvSlideHtml); $yvSlide.attr("role", "list"); $yvWrap.addClass("no-slide").addClass("set-youtube"); yvLoaded = false; setTimeout(function () { yvLoad(); }, 10); }; // quote slide var $quoteWrap = $(".quote-wrap"); var $quoteSlideWrap = $(".quote-slide"); var $quoteSlide = $quoteSlideWrap.find(".quote-list"); var $quoteSlidePaging = $quoteWrap.find(".slide-paging"); var $quoteSlidePagingOmni = $quoteSlidePaging.data("indicator-omni"); var quoteSlideHtml = $quoteSlide.html(); var quoteBoxArray = []; var quoteTitleArr = []; var quoteSlideInit = function () { if ($quoteWrap.hasClass("no-slide")) $quoteWrap.removeClass("no-slide"); var quateLength; if ($("html").hasClass("s34")) { quateLength = $quoteSlide.find(".quote-item").length > 3 ? true : false; } else if ($("html").hasClass("s2")) { quateLength = $quoteSlide.find(".quote-item").length > 2 ? true : false; } else { quateLength = $quoteSlide.find(".quote-item").length > 2 ? true : false; } if (quateLength) { GALAXY.unResize(quoteListHeight); GALAXY.resize(quoteListHeight); $quoteSlide.find(".quote-item").each(function (i) { var thisHtml = $(this).html(); quoteBoxArray.push(thisHtml); quoteTitleArr.push($(this).find("strong").text()); }); var pageTitle = $quoteSlidePaging.data("page-title"); $quoteSlide.attr("role", "list"); $quoteSlide.html(""); for (var i = 0; i < quoteBoxArray.length; i++) { if ($html.hasClass("s12")) { if (i % 2 == 0) $quoteSlide.append( '
' + quoteBoxArray[i] + "
" + "" ); if (i % 2 != 0) $quoteSlide .find("li:last-child") .append( '
' + quoteBoxArray[i] + "
" ); } else { if (i % 3 == 0) $quoteSlide.append( '
' + quoteBoxArray[i] + "
" + "" ); if (i % 3 != 0) $quoteSlide .find("li:last-child") .append( '
' + quoteBoxArray[i] + "
" ); } } var omniTxt = modelName + $quoteSlidePagingOmni; $quoteSlide.find("li").each(function (i) { var quateContLength = $(this).find(".quote-item").length; var title = $html.hasClass("s12") ? quoteTitleArr .slice(i * 2, i * 2 + quateContLength) .toString() : quoteTitleArr .slice(i * 3, i * 3 + quateContLength) .toString(); $( '
" ).appendTo($quoteSlidePaging); }); var meetSwipe = GALAXY.swipeAble; if ($html.hasClass("ie") && $html.hasClass("rtl")) { meetSwipe = false; } if ($html.hasClass("edge") && $html.hasClass("rtl")) { meetSwipe = false; } $quoteSlide.xlider({ swipe: meetSwipe, endless: true, arrows: [ $quoteWrap.find(".m_btn_type1-prev"), $quoteWrap.find(".m_btn_type1-next"), ], paging: $quoteSlidePaging, onMove: function () { $quoteSlideWrap .find("li") .removeClass("view") .removeAttr("aria-hidden tabindex"); $quoteSlideWrap.removeClass("ie-error"); }, onChange: function () { $quoteSlideWrap .find("li") .removeClass("view") .removeAttr("aria-hidden tabindex"); $quoteSlideWrap.removeClass("ie-error"); }, onChangeEnd: function (i) { var select = $quoteSlidePaging.data("btn-title"); sliderOmni.remove(); $quoteSlideWrap .find(".xlider-current") .removeClass("view") .siblings() .addClass("view") .attr({ "aria-hidden": "true", tabindex: -1 }); $quoteSlidePaging .find("li") .eq(i) .find("a") .attr("title", select) .closest("li") .siblings() .find("a") .attr("title", ""); $quoteSlideWrap.addClass("ie-error"); }, }); $quoteWrap .off("mousedown.quot keydown.quot") .on( "mousedown.quot keydown.quot", ".slide-paging a", function (e) { sliderOmni.add(e, this); } ); quoteListHeight(); } else { $quoteWrap.addClass("no-slide"); } }; var quoteListHeight = function () { var max = 0; $quoteSlide .find("li") .css({ height: "" }) .each(function () { max = Math.max($(this).outerHeight(), max); }) .css({ height: max }); }; var quoteSlideDestroy = function () { quoteBoxArray = []; $quoteSlidePaging.html(""); $quoteSlide.removeAttr("style").xlider("remove"); $quoteSlide.html(quoteSlideHtml); $quoteSlide.attr("role", "list"); $quoteWrap.addClass("no-slide"); $quoteWrap.addClass("set-quateSlide"); $quoteSlide .find("li") .css({ height: "" }) .attr("role", "presentation"); setTimeout(function () { $quoteSlide.find("img").each(function () { $(this).attr("src", $(this).attr("data-media-s4")); }); }, 10); }; var changeSizeMode = GALAXY.sizeMode; GALAXY.load(function () { yvSlideDestroy(); yvSlideInit(); quoteSlideDestroy(); quoteSlideInit(); }); GALAXY.resize(function () { var _sizeMode = GALAXY.sizeMode; if (_sizeMode != changeSizeMode) { changeSizeMode = _sizeMode; yvSlideDestroy(); yvSlideInit(); quoteSlideDestroy(); quoteSlideInit(); } }); GALAXY.scroll(function () { // yvLoad(); }); // youtube modals $(".youtube-wrap").on("click", "a", function (e) { e.preventDefault(); GALAXY.vodPlayer.show(this.href, this, true); var $desc = $(this).parent().find(".youtube-desc").length ? $(this) .parent() .find(".youtube-desc") .clone() .removeAttr("aria-hidden") : null; var $ytModal = $(".m_layer-youtube.show"); if ($("html").hasClass("safari") && $("html").hasClass("mobile")) $("html").css("height", "100vh"); $ytModal.find("h3").empty().text(""); $ytModal .find("iframe") .attr("title", $(this).find("img").attr("alt")); setTimeout(function () { $ytModal.find(".c_btn_close-type1").focus(); }, 1500); $ytModal.on("click", ".modals_close-area", function (e) { $ytModal.find(".c_btn_close_area button").trigger("click"); if ($("html").hasClass("safari") && $("html").hasClass("mobile")) $("html").css("height", ""); }); if ($desc != null) $ytModal.find(".m_video_view").append($desc); if (GALAXY.isGalaxy && $(this).parents(".youtube-slide").length) GALAXY.omniture($(this).attr("data-omni")); if ($("html").hasClass("dotcom")) { accessibillityLayers.on($("#teconsent, .QSIFeedbackButton")); $("html").addClass("is-modal-opened"); } }); //wa $(document).on( "click", ".m_layer-youtube .c_btn_close-type1", function (e) { if ($("html").hasClass("dotcom")) { accessibillityLayers.off($("#teconsent, .QSIFeedbackButton")); $("html").removeClass("is-modal-opened"); $("#QSIFeedbackButton-btn").css("width", "37px"); } } ); // overview nav $(".overview-nav a").on("click", function (e) { var scrollTimeout = null; var $target = $($(this).attr("href")); var duration = 750; if ($target.length) { GALAXY.setSmoothScrollTop( $target.offset().top, duration, function () { clearTimeout(scrollTimeout); scrollTimeout = setTimeout(function () { $target.find("button").focus(); }, 300); } ); } e.preventDefault(); }); $(".f_cate-overview-wrap a").on("click", function (e) { var scrollTimeout = null; var $target = $($(this).attr("href")); var duration = 750; var onBlur = function onBlur() { $(this).removeAttr("tabindex"); }; if ($target.length) { var targetOffsetTop = $target.offset().top; if ( parseInt(getComputedStyle($target[0]).paddingTop) < $("#subnav").height() ) { targetOffsetTop -= $("#subnav").height() + 10; } if ( parseInt(getComputedStyle($target[0]).paddingTop) < $(".pd-g-floating-nav").height() ) { targetOffsetTop -= $(".pd-g-floating-nav").height() + 10; } GALAXY.setSmoothScrollTop(targetOffsetTop, duration, function () { clearTimeout(scrollTimeout); scrollTimeout = setTimeout(function () { var focusable = $target .closest("[class*=f_header-], [class*=m_feature]") .find("h3"); if (focusable.length > 0) { $(focusable[0]).attr("tabindex", "0"); $(focusable[0]).focus().one("blur", onBlur); } else { focusable = $target .closest("[class*=f_header-], [class*=m_feature]") .find("button"); focusable[0].focus(); } }, 300); }); } e.preventDefault(); }); })(); var overview = function overview(section, options) { var $section = $(section); if (!$section.length) return false; if ($("html").hasClass("ie") || $("html").hasClass("sL")) { var $texts = $section.find(".text-item"); $texts.length && $texts.each(function (idx, e) { var $text = $(e); var io = new IntersectionObserver( function (entries) { entries.forEach(function (entry) { if (entry.isIntersecting) { $texts.removeClass("active"); $text.addClass("active"); } else $text.removeClass("active"); }); }, { rootMargin: "-45% 0px -45%", } ); io.observe(e); }); return false; } var defaultOptions = { horizontal: true, }; options = Object.assign(defaultOptions, options); var $stickyInner; var $videoWrap; var $videoFigure; var $videoGradient; var $textList; var $text; var videoTypes; var videoPlayed; var gradientTimeout; var clipTimeout; var clipStatus; var clipDuration = 0.4; var videoDuration = 5; var loaded; var halfSize; var areaWidth; var areaHeight; var isMobileSize; var heightDiff; var textNumber; var prevIndex; var prevHeight; var isReady; var checkMobile = function checkMobile() { return $(window).width() < 768; }; var init = function init() { loaded = true; $stickyInner = $section.find(".sticky-inner"); $videoWrap = $section.find(".content-wrap"); $videoFigure = $section.find(".mask-video figure"); $videoGradient = $videoFigure.find(".video-gradient"); if (options.horizontal) $videoFigure.addClass("horizontal"); videoTypes = ["webm", "mp4"]; createVideo($videoFigure); $videoFigure.video.muted = true; $maskWrap = $section.find(".mask-wrap"); $textList = $section.find(".text-list"); $text = $section.find(".text-item"); textNumber = $text.length - 1; prevIndex = -1; videoPlayed = false; isMobileSize = checkMobile(); reset(); }; var createVideo = function createVideo($videoFigure) { var mobileTag = checkMobile() ? "_s" : ""; var source = $videoFigure.data("src"); var $videoTag; if (!$videoFigure.$video) { $videoTag = $('
'); $videoTag.appendTo($videoFigure); } else { $videoTag = $videoFigure.find("video").html(""); } videoTypes.forEach(function (type) { $("
") .attr({ type: "video/".concat(type), src: "//images.samsung.com/ca/smartphones/galaxy-z-fold4/videos/" .concat(source + mobileTag, ".") .concat(type), }) .appendTo($videoTag); }); $videoTag[0].load(); $videoTag.one("canplay", function () { if ($videoTag[0].readyState > 2 && !isReady) { isReady = true; playVideo(); } }); $section.find(".mask-video").css({ "background-image": "url(//images.samsung.com/ca/smartphones/galaxy-z-fold4/images/".concat( source + "_start" + mobileTag, ".jpg)" ), }); $videoFigure.$video = $videoTag; $videoFigure.video = $videoTag[0]; }; var reset = function reset() { areaWidth = $stickyInner.width(); areaHeight = $stickyInner.height(); var sizeMobile = checkMobile(); halfSize = options.horizontal ? areaWidth / 2 : areaHeight / 2; if (options.horizontal) $videoFigure.css({ transform: "", }); var margin = sizeMobile ? 104 : 130; var textArea = $textList.height() + margin * 2; if (areaHeight - textArea < 0) { $textList.parent().addClass("overH"); heightDiff = areaHeight - textArea; } else { $textList.parent().removeClass("overH"); $textList.__css({ transform: "", }); heightDiff = 0; } if (sizeMobile && !isMobileSize) { isMobileSize = true; videoPlayed = false; createVideo($videoFigure); _scroll(0.01); GALAXY.scrollTop > $section.offset().top && _scroll(0.99); } else if (!sizeMobile && isMobileSize) { isMobileSize = false; videoPlayed = false; createVideo($videoFigure); _scroll(0.01); GALAXY.scrollTop > $section.offset().top && _scroll(0.99); } if (options.horizontal) { var windowRatio = areaWidth / areaHeight; var videoWidth = $videoFigure.$video.width(); var videoHeight = checkMobile() ? videoWidth : $videoFigure.$video.height(); videoScale = windowRatio > videoWidth / videoHeight ? areaWidth / videoWidth : areaHeight / videoHeight; $videoFigure.css({ transform: "scale(".concat(videoScale * 1.02, ")"), }); } if (areaHeight != prevHeight) { prevHeight = areaHeight; if (clipStatus) { if (clipStatus == "open") { TweenMax.to($videoWrap, 0, { clip: "rect(0px, " .concat(areaWidth, "px, ") .concat(areaHeight, "px, 0px)"), }); } else if (clipStatus == "close") { TweenMax.to($videoWrap, 0, { clip: options.horizontal ? "rect(0px, " .concat(halfSize, "px, ") .concat(areaHeight, "px, ") .concat(halfSize, "px)") : "rect(" .concat(halfSize, "px, ") .concat(areaWidth, "px, ") .concat(halfSize, "px, 0px)"), }); } } } }; var _scroll = function scroll(percent) { percent = percent || 0; var perText = stickyPercent(percent, 0, 0.7); var index = Math.floor(perText / (1 / textNumber)); if (index != prevIndex) { prevIndex = index; $text.removeClass("active").eq(index).addClass("active"); } heightDiff && $textList.__css({ y: heightDiff * perText, }); var perMask = stickyPercent(percent, 0.75, 0.25); if (perMask > 0) { open(); } else { if (percent > 0 && percent < 1) close(); } }; var open = function open() { if (clipStatus != "open") { clipStatus = "open"; clearTimeout(clipTimeout); clipTimeout = setTimeout(function () { if ($videoGradient) { $videoGradient.__css({ opacity: 1, }); clearTimeout(gradientTimeout); gradientTimeout = setTimeout(function () { TweenMax.to($videoGradient, videoDuration * 0.1, { opacity: 0, }); }, videoDuration * 0.9 * 1000); } TweenMax.to($videoWrap, clipDuration, { clip: "rect(0px, " .concat(areaWidth, "px, ") .concat(areaHeight, "px, 0px)"), ease: Circ.easeOut, onStart: function onStart() { pauseVideo(); playVideo(); }, }); }, 0); } }; var close = function close() { if (clipStatus != "close") { clipStatus = "close"; clearTimeout(clipTimeout); clearTimeout(gradientTimeout); clipTimeout = setTimeout(function () { TweenMax.to($videoWrap, clipDuration, { clip: options.horizontal ? "rect(0px, " .concat(halfSize, "px, ") .concat(areaHeight, "px, ") .concat(halfSize, "px)") : "rect(" .concat(halfSize, "px, ") .concat(areaWidth, "px, ") .concat(halfSize, "px, 0px)"), ease: Circ.easeOut, onComplete: function onComplete() { clipStatus == "close" && videoPlayed && pauseVideo(); }, }); }, 0); } }; var playVideo = function playVideo() { if (isReady) { videoPlayed = true; $videoFigure.video.currentTime = 0.01; $videoFigure.video.play(); } }; var pauseVideo = function pauseVideo() { if (isReady) { videoPlayed = false; $videoFigure.video.pause(); $videoFigure.video.currentTime = 0.01; } }; if (!loaded && window.pageYOffset > 10) init(); GALAXY.scroll(function () { if (!loaded && window.pageYOffset > 10) init(); }); new scrollSticky("".concat(section, " .sticky-wrap"), { scroll: function scroll(percent) { loaded && _scroll(percent); }, resize: function resize() { loaded && reset(); }, }); var isShift = false, isTab = false; $(window).on("keydown", function (e) { if (e.shiftKey) isShift = true; else isShift = false; if (e.keyCode == 9) isTab = true; else isTab = false; }); $(".f_cate-overview-wrap a").on("focus", function (e) { e.preventDefault(); var itemIndex = $(".f_cate-overview-wrap .text-item").index( $(this).parent() ); if (isTab) { clipStatus = "open"; if ( (!isShift && itemIndex == 0) || (isShift && itemIndex > $(".f_cate-overview-wrap .text-item").length - 2) ) { $("html, body") .stop() .scrollTop($(".m_content-overview").offset().top); } setTimeout(function () { _scroll(0.15 * (itemIndex + 1)); }, 30); } }); }; var dropdown = function dropdown() { var $section = $(".dropdown-wrap"), $item_q, $item_a, $item_btns, $item_all; var omni = { open: ":expand:", close: ":collapse:", }; var asset = function asset() { $item_all = $section.find(".dropdown_item"); $item_q = $section.find(".dropdown_item_q"); $item_a = $section.find(".dropdown_item_a"); $item_btns = $item_q.find("button"); }; var bindEvent = function bindEvent() { $item_btns.off("click").on("click", showContent); }; var init = function init() { if (!$section.length) { return false; } asset(); bindEvent(); return this; }; var showContent = function showContent() { var $item_btn = $(this); var curIndex = $item_btns.index(this); var $item = $item_btn.closest(".dropdown_item"); var omniture = this.dataset.omni; var $content = $item_a.eq(curIndex); if (!$item.hasClass("is-open")) { $item.addClass("is-open"); $item_btn.attr({ "aria-expanded": "true", }); $content.stop().slideDown(400); } else { $item.removeClass("is-open"); $item_btn.attr({ "aria-expanded": "false", }); $content.stop().slideUp(400); } return false; }; init(); }; GALAXY.load(function () { dropdown(); }); var faveColorChip = function faveColorChip( $colors, $images, onchange, oninit ) { var $inputs = $colors.find("input:radio"); var colorTimeout; var _init = function _init() { if ($colors.find("input:checked").length == 0) { $inputs.each(function (i) { if (i == 0) { this.checked = true; } }); } _setImage(); if (oninit) { oninit(); } $inputs.on("change focus", function () { var $this = $(this); clearTimeout(colorTimeout); colorTimeout = setTimeout(function () { _setImage(); if (onchange) { onchange.call($this); } }, 0); }); }; var _setImage = function _setImage() { var currentColor = $inputs.filter(":checked").val(); $images.each(function () { $(this).removeClass("active").attr("aria-hidden", true); if ($(this).data("color-name") === currentColor) { $(this).addClass("active").removeAttr("aria-hidden"); } }); }; GALAXY.load(function () { _init(); }); }; var Modals = (function () { var $window = $(window); var $document = $(document); var $modals = $( '
' ); var $baseContentsArea = $("#wrap"), $baseContentsClickable; var $ctrl = null; var $modalContent, saveScrollTop, isKeyDown = false; var isModalShow = false; var showroomUid = null; var showroomDataInit = false; var isHashCheck = false; var focusSetTime1; var focusSetTime2; var isShow = false; var showroom; var showroomColor = ""; var init = function init() { $("body").append($modals); setHashCheck(); $document.on("click.openModal", ".o_modal_controller", openModel); $document.on("click.openShowroom", ".showroom-btn", openShowroom); return this; }; var openModel = function openModel() { if (!isShow) { $modals.removeClass("modal-showroom"); isShow = true; $ctrl = this; var target = this.dataset.target || this.getAttribute("href"); show(target); } return false; }; var openShowroom = function openShowroom() { if (!isShow) { isShow = true; $ctrl = this; var uid = this.dataset.target || this.getAttribute("href"); var $target = $(".showroom_modal").clone(); showroomColor = ""; if (this.dataset.target == "see-in-360") { showroomColor = $(this) .closest("article") .find("input:radio:checked") .attr("value") || "burgundy"; } showroomUid = uid; if (showroomDataInit === false) { callShowroomPage(); } else { $target .find(".modal-contents.showroom-con") .html($("#showroom-" + uid).html()); $target .find(".modal-contents.showroom-con article") .removeAttr("id"); } show($target); } return false; }; var callShowroomPage = function callShowroomPage() { $.ajax({ url: "./showroom/", dataType: "text", }) .done(setupShowroom) .fail(function () { window.location.href = "./showroom/#" + showroomUid; }); }; var setupShowroom = function setupShowroom(datas) { // Add Css var css = datas.split("/*!--GALAXY-SHOWROOM-CSS--*/")[1]; css = css.split("/*!--//GALAXY-SHOWROOM-CSS--*/")[0]; css = css.replace( /\.\/images\//g, "//images.samsung.com/ca/smartphones/galaxy-z-fold4/showroom/images/" ); css = css.replace( /\.\.\/common\/images\//g, "/samsung/resources/global/galaxy-z-fold4/common/images/" ); $("
", { attr: { type: "text/css", }, html: css, appendTo: "head", }); // Add Script var js = datas.split("/*!--GALAXY-SHOWROOM-JS--*/")[1]; js = js.split("/*!--//GALAXY-SHOWROOM-JS--*/")[0]; var newscript = document.createElement("script"); var insertScript = document.createTextNode(js); newscript.appendChild(insertScript); document.body.appendChild(newscript); // Add HTML Data var store = datas.split("
")[1]; store = store.split("
")[0]; $("
", { attr: { tabindex: -1, "aria-hidden": true, class: "overview-container", }, css: { display: "none", }, appendTo: "body", html: contReplace(store), }); // Add Html var contents = datas.split("
")[1]; contents = contents.split("
")[0]; function contReplace(str) { var s = str || ""; s = s.replace(/\.\//g, "./showroom/"); s = s.replace( /\.\.\/common\/images\//g, "/samsung/resources/global/galaxy-z-fold4/common/images/" ); s = s.replace( /\.\.\/showroom\/common\//g, "/samsung/resources/global/galaxy-z-fold4/common/" ); s = s.replace(/:showroom:/g, ":highlights:popup^"); return s; } var $contents = $("
", { html: contReplace(contents), }); var $articles = $contents.find("article"); var s = []; for (var i = 0, l = $articles.length, article; i < l; i++) { article = $articles[i]; s.push( '
" ); } $("body").append(s.join("\n ")); showroom = new Showroom({ device: document.getElementById("contents").dataset.model, options: { tracker: false, progress: false, navigator: false, isShowroom: false, }, }); showroom.init(); $('.modal[role="dialog"]') .find(".modal-contents.showroom-con") .html($("#showroom-" + showroomUid).html()); $('.modal[role="dialog"]') .find(".modal-contents.showroom-con article") .removeAttr("id"); if ($modals.hasClass("show-end")) { var $loadingBar = $modals.find(".load-bar"); $loadingBar.get(0) && $loadingBar.remove(); showroom.renderFeature(showroomUid, showroomColor); } showroomDataInit = true; }; var btnShowSet; var btnShowSet2; var ieCloseBtnShow = function ieCloseBtnShow() { clearTimeout(btnShowSet); clearTimeout(btnShowSet2); if ($("html").hasClass("ie")) { if (!$(".modal_close").hasClass("close-show")) { $(".modal_close").addClass("close-show"); $(".modal_close a").focus(); } else { $(".modal_close").addClass("close-show-end"); $(".modal_close a").focus(); } } }; var setHashCheck = function setHashCheck() { var hash = location.href.split("#")[1]; if (!hash) { return; } var checkHash = function checkHash() { var target = this.dataset.target || this.getAttribute("href"); var $this = $(this); if (hash == this.dataset.hash) { isShow = true; if ($(this).hasClass("showroom-btn")) { showroomColor = ""; if (this.dataset.target == "see-in-360") { showroomColor = $(this) .closest("article") .find("input:radio:checked") .attr("value") || "burgundy"; } showroomUid = target; callShowroomPage(); show($(".showroom_modal").clone()); } else { show(target); } if (!$this.data("hash-scroll-target")) { isHashCheck = $this.closest("section").offset().top; setTimeout(function () { GALAXY.setScrollTop($this.closest("section").offset().top); }, 100); } else { setTimeout(function () { var $scrollTarget = $( "#" + $this.data("hash-scroll-target") ); isHashCheck = $scrollTarget.get(0) ? $scrollTarget.offset().top : 0; $scrollTarget.get(0) && GALAXY.setScrollTop($scrollTarget.offset().top); }, 100); } } }; $(".o_modal_controller").each(checkHash); $(".showroom-btn").each(checkHash); }; var show = function show(target) { $("#wrap").css("opacity", 0.99); var $target = $(target); var $loadingBar = $target.find(".load-bar"); $loadingBar.get(0) && $loadingBar.find("span").text($loadingBar.data("load-txt")); // if ( !$target.length ) return false; isKeyDown = false; isModalShow = true; $modals.html($target.html()); $modalContent = $modals.find(".modal_contents-area"); !showroomUid && $modalContent .find("a, button") .off(GALAXY.tracking) .on("click", GALAXY.tracking); $modals .find( ".modal_close > a, .modal_close > button, .modal_close-area" ) .one("click.modalHide", hide) .on("keydown.modalHide", hideKeyDown); if (!GALAXY.sizeMode) { var width = window.innerWidth; //document.documentElement.offsetWidth; GALAXY.sizeMode = width > 1440 ? 4 : width > 1023 ? 3 : width > 767 ? 2 : 1; } imageLoadCheck(); Accessibillity.on(); setTimeout(function () { $modalContent.addClass("modal_open"); shown(); }, 0); $modals.addClass("show"); saveScrollTop = GALAXY.scrollTop; GALAXY.noScroll.on(); $("#wrap").css({ position: "fixed", width: "100%", paddingRight: GALAXY.scrollBarWidth, left: 0, right: 0, top: -saveScrollTop, "z-index": -1, }); $(".overview-bg").css({ opacity: 0, }); if (!GALAXY.isGalaxy) $(".floating-navigation__wrap").css({ paddingRight: GALAXY.scrollBarWidth, }); $(".footer").css({ "padding-top": saveScrollTop, }); clearTimeout(focusSetTime2); focusSetTime2 = setTimeout(function () { $modals.find(".modal_close a").focus(); }, 1000); }; $modals .off("blur.modalClose") .on("blur.modalClose", ".modal_close a", function () { $(this).removeClass("focus-visible"); }); var shown = function shown() { $modals.addClass("show-end"); $("body") .off("keydown.closeModals") .on("keydown.closeModals", function (e) { if ( $modals.hasClass("show-end") && (e.key == "Escape" || e.keyCode == 27) ) { isKeyDown = true; hide(); } }); if (showroomUid && showroomDataInit) { var $loadingBar = $modals.find(".load-bar"); $loadingBar.get(0) && $loadingBar.remove(); showroom.renderFeature(showroomUid, showroomColor); } }; var hide = function hide() { $("#wrap").css("opacity", ""); $modals.removeClass("show"); $window.off("resize.modals"); Accessibillity.off(); if ($("html").hasClass("ie")) $(".modal_close").removeClass("close-show close-show-end"); if (isHashCheck !== false) { GALAXY.setScrollTop(isHashCheck); } isHashCheck = false; // showroomUid && showroom.destroyFeature(); showroomUid = null; clearTimeout(focusSetTime1); $(".footer").css({ "padding-top": "", }); GALAXY.noScroll.off(); $("#wrap").css({ position: "", width: "", left: "", paddingRight: "", right: "", top: "", "z-index": "", }); $(".overview-bg").css({ opacity: "", }); if (!GALAXY.isGalaxy) $(".floating-navigation__wrap").css({ paddingRight: "", }); saveScrollTop && GALAXY.setScrollTop(saveScrollTop); saveScrollTop = 0; focusSetTime1 = setTimeout(function () { $ctrl && $ctrl.focus(); $ctrl = null; }, 500); isShow = false; if (typeof window.modalCloseCallback == "function") { window.modalCloseCallback(); } $modalContent = null; $modals.removeClass("show-end"); $("body").off("keydown.closeModals"); $modals.empty().addClass("modal-showroom"); isKeyDown = false; isModalShow = false; return false; }; var hideKeyDown = function hideKeyDown(e) { if (e.keyCode == 13 || e.keyCode == 32) { isKeyDown = true; } }; var Accessibillity = { on: function on() { $baseContentsArea.attr({ "aria-hidden": "true", tabindex: -1, }); $baseContentsClickable = $baseContentsArea.find( "a,input,select,textarea,button,video,iframe, svg" ); $baseContentsClickable.each(function () { var tabindex = $(this).attr("tabindex"); if (tabindex !== undefined && tabindex !== null) { $(this).data("prev-tabindex", tabindex); $(this).attr("aria-hidden", "true"); } $(this).attr("tabindex", "-1"); $(this).attr("aria-hidden", "true"); }); if ($("html").hasClass("dotcom")) { $("html").addClass("is-modal-opened"); } }, off: function off() { $baseContentsArea.removeAttr("aria-hidden tabindex"); $baseContentsClickable.each(function () { var tabindex = $(this).data("prev-tabindex"); if (tabindex !== undefined && tabindex !== null) { $(this).attr("tabindex", tabindex); $(this).removeAttr("aria-hidden"); } else { $(this).removeAttr("tabindex"); $(this).removeAttr("aria-hidden"); } }); if ($("html").hasClass("dotcom")) { $("html").removeClass("is-modal-opened"); $("#QSIFeedbackButton-btn").css("width", "37px"); } }, }; var imageLoadCheck = function imageLoadCheck() { var $images = $modals.find("img"), lens = $images.length, count = 0; var loadCheck = function loadCheck() { if (++count >= lens) { showImageLoadEnd(); } }; $images.each(function (i, image) { var $image = $(image); GALAXY.loadImage($image, loadCheck); this.src = GALAXY.getImageSources($image)[GALAXY.sizeMode]; }); if (!lens) { showImageLoadEnd(); } }; var showImageLoadEnd = function showImageLoadEnd() {}; var changeSizeMode = function changeSizeMode() { isModalShow && imageLoadCheck(); }; return { init: init, show: show, hide: hide, showEnd: showImageLoadEnd, }; })(); GALAXY.load(function () { Modals.init(); }); var ecosystem = function ecosystem() { var $popupElem = $(".eco-popup"); var $openBtn = $(".btn-open"); var $closeBtn = $(".btn-close"); var $index = 0; var ecosystemElem = document.querySelector(".m_content-ecosystem"); var ecosystemBg = document.querySelector(".gradient-wrap"); var scrollValue = 0; var currentScroll = 0; var ratio = 0; var settingValue = 20; var heightRatio = 0.3; ecosystemBg.style.transform = "translate3d(-50%," + settingValue + "%,0)"; var ecoPopup = { open: function open(index) { ecoPopup.allClosed(); $popupElem.eq(index).stop().fadeIn(200); $popupElem.eq(index).find(".btn-close").focus(); }, closed: function closed(index) { $popupElem.eq(index).stop().fadeOut(200); $popupElem.eq(index).prev(".eco-item").find(".btn-open").focus(); }, focus: function focus() { $popupElem.stop().fadeOut(200); $openBtn.removeClass("open"); }, allClosed: function allClosed() { $popupElem.stop().fadeOut(200); }, exClosed: function exClosed(e) { if ( $popupElem.has(e.target).length === 0 && $(e.target)[0].classList[0] != "btn-open" ) { ecoPopup.allClosed(); $openBtn.removeClass("open"); } }, router: function router() { switch ($(this)[0].classList[0]) { case "btn-open": $index = $openBtn.index(this); if ($(this).attr("class").split(" ").indexOf("open") != -1) { $(this).removeClass("open"); ecoPopup.closed($index); } else { $openBtn.removeClass("open"); $(this).addClass("open"); ecoPopup.open($index); checkViewPopup(ecosystemElem); } break; case "btn-close": $index = $closeBtn.index(this); $openBtn.eq($index).removeClass("open"); ecoPopup.closed($index); break; } }, parallax: function parallax() { scrollValue = pageYOffset; currentScroll = Math.max( 0, pageYOffset - (ecosystemElem.offsetTop - ecosystemElem.offsetHeight * heightRatio) ); ratio = currentScroll / ecosystemElem.offsetHeight; trasformValue = settingValue - settingValue * ratio; if ( scrollValue > ecosystemElem.offsetTop - ecosystemElem.offsetHeight * heightRatio && scrollValue < ecosystemElem.offsetTop - ecosystemElem.offsetHeight * heightRatio + ecosystemElem.offsetHeight ) { ecosystemBg.style.transform = "translate3d(-50%," + trasformValue + "%,0)"; } else if ( scrollValue < ecosystemElem.offsetTop - ecosystemElem.offsetHeight * heightRatio ) { ecosystemBg.style.transform = "translate3d(-50%," + settingValue + "%,0)"; } else if ( scrollValue > ecosystemElem.offsetTop - ecosystemElem.offsetHeight * heightRatio + ecosystemElem.offsetHeight ) { ecosystemBg.style.transform = "translate3d(-50%,0%,0)"; } }, }; var addEvent = function addEvent() { $openBtn.on({ "click.eco": ecoPopup.router, "focus.eco": ecoPopup.focus, }); $closeBtn.on("click.eco", ecoPopup.router); $(document).on({ "click.eco": ecoPopup.exClosed, "scroll.ecosystem": ecoPopup.parallax, }); }; var checkViewPopup = function checkViewPopup(target) { var callback = function callback(entries, observer) { entries.forEach(function (entry) { if (!entry.isIntersecting) { $popupElem.stop().fadeOut(200); $openBtn.removeClass("open"); } }); }; var io = new IntersectionObserver(callback); io.observe(target); }; var init = function init() { addEvent(); }; init(); }; GALAXY.load(function () { ecosystem(); }); var excellenceMotion = function excellenceMotion() { var excellence = document.querySelector(".m_content-excellence"); var excellenceList = document.querySelector(".excellence-list"); var excellenceListUl = excellenceList.querySelector("ul"); var excellenceMobileMove = excellenceList.querySelector(".mobile-move"); var excellenceTitle = excellence.querySelector(".f_header-type1"); var eCard = excellenceList.querySelectorAll(".e-card"); var _this; var totalW = 0; var excellenceSticky; var cloneList; var arrowClick = false; var blankDiv; var $subNavElem = $("#subnav"); var $dotNav = $(".floating-navigation"); var $stickyInner = $(".m_content-excellence .sticky-inner"); var $sitckyHeader = $( ".m_content-excellence .sticky-inner>.f_header-type1" ); var $eCard = $(".e-card"); var $subNavHt; var $stickyInnerHt; var $stickyTop; var $totalHt; var $eCardHt; var init = function init() { _this = this; _this.resize(); stickyMotion(); slideMotion(); }; // excellence sticky var stickyMotion = function stickyMotion() { var titleL = 0; var totalH = 0; var titleW = 0; var progress = 0; var _init = function _init() { cloneList = excellenceListUl.cloneNode(true); cloneList.setAttribute("aria-hidden", "true"); cloneList.classList.add("clone-list"); excellenceList.appendChild(cloneList); blankDiv = document.createElement("div"); blankDiv.classList.add("blank-div"); excellenceList.appendChild(blankDiv); _resize(); if (document.documentElement.classList.contains("ie11")) { excellence.querySelector(".sticky-inner").style.marginTop = -totalH / 2 + "px"; } }; var _option = { align: "center", scroll: function scroll(percent) { _scroll(percent); }, resize: function resize() { _this.resize(); _resize(); _scroll(progress); }, }; var _scroll = function _scroll(scroll) { var p = stickyPercent(scroll, 0, 0.9); var distance; if (!document.documentElement.classList.contains("rtl")) { distance = titleL - (totalW - titleW) * p; } else { distance = -titleL + (totalW - titleW) * p; } if (!document.documentElement.classList.contains("s1")) _this.move(distance); }; var _jump = function _jump(idx) { var percent = idx / eCard.length; var fakeDiv = (excellence.clientHeight - window.innerHeight) * percent; setTimeout(function () { window.scrollTo(0, excellence.offsetTop + fakeDiv); }, 300); }; var _keyup = function _keyup(el, idx) { if (!document.documentElement.classList.contains("s1")) { excellence.querySelector(".sticky-inner").scrollLeft = 0; _jump(idx); } }; var _resize = function _resize() { titleL = excellenceTitle.offsetLeft; titleW = excellenceTitle.clientWidth; totalH = excellenceTitle.clientHeight; if (!document.documentElement.classList.contains("dotcom")) { $subNavHt = $subNavElem.height(); } else { $subNavHt = $dotNav.height(); } $stickyInnerHt = $stickyInner.height(); $totalHt = $stickyInnerHt + 50; $stickyTop = $subNavHt; $eCardHt = $eCard.height(); if (innerHeight - $subNavHt > $totalHt) { $stickyInner.css("top", $stickyTop + 50 + "px"); } else { $stickyInner.css( "top", -totalH + $subNavHt + (innerHeight - $subNavHt - $eCardHt) / 2 + "px" ); } }; _init(); var selectPostion = function selectPostion() { if (innerHeight - $subNavHt > $totalHt) { Object.assign(_option, { align: "top", }); } else { Object.assign(_option, { align: "center", }); } excellenceSticky = new scrollSticky(excellence, _option); }; // excellenceSticky = new scrollSticky(excellence, _option); var positionCheck = function positionCheck() { isSticky = $(".m_content-excellence") .find(".sticky-inner") .css("position"); if (isSticky == "static") { $(".m_content-excellence").addClass("_static"); } }; var fucusMove = function fucusMove() { var $excellence = $(".m_content-excellence"), $stickyInner = $excellence.find(".sticky-inner"), $listWrap = $excellence.find(".mobile-move"), $cardElem = $listWrap.find(".e-card"); var $innerTop, $calcValue, $offsetTop, $currentIndex = 0, $result; var focusMove = { focus: function focus() { if ($(this).index() >= $cardElem.length - 2) { $currentIndex = $cardElem.length - 1; } else { $currentIndex = $(this).index(); } $cardWidth = parseInt( (($excellence.height() + $innerTop) * 0.9) / ($cardElem.length + 2) ); $calcValue = $cardWidth * $currentIndex; $offsetTop = $excellence.offset().top - $innerTop; $result = $offsetTop + $calcValue; window.scrollTo(0, $result); }, }; var defaultSet = function defaultSet() { $innerTop = $stickyInner.css("top").split("px")[0] * 1; }; var bindEvent = function bindEvent() { $cardElem.on("keyup.focusMove", focusMove.focus); }; var init = function init() { defaultSet(); bindEvent(); }; init(); }; GALAXY.load(function () { selectPostion(); positionCheck(); fucusMove(); }); }; // excellence slide var slideMotion = function slideMotion() { var arrowWrap = excellenceList.querySelector( ".excellence-arrow-wrap" ); var startP = window.innerWidth / 2 - eCard[0].clientWidth / 2; var endP = window.innerWidth / 2 - eCard[0].clientWidth / 2; var downStart = false; var totalIdx = 0; var slideMove = false; var _init = function _init() { _resize(); // _this.move(startP); var startEvent = ["mousedown", "touchstart"]; var moveEvent = ["mousemove", "touchmove"]; var endEvent = ["mouseup", "touchend"]; startEvent.forEach(function (__this) { excellenceListUl.addEventListener(__this, function (e) { _touch.start(e); }); }); moveEvent.forEach(function (__this) { document.addEventListener( __this, function (e) { _touch.move(e); }, { passive: false, } ); }); endEvent.forEach(function (__this) { document.addEventListener(__this, function (e) { _touch.end(e); }); }); arrowWrap .querySelector(".prev") .addEventListener("click", function (e) { _prev(); }); arrowWrap .querySelector(".next") .addEventListener("click", function (e) { _next(); }); window.addEventListener("resize", function (e) { _resize(); }); }; var _touch = { prevX: 0, prevY: 0, currentX: 0, moveX: startP, dragX: 0, endIdx: 0, start: function start(e) { if (!slideMove) { downStart = true; this.prevX = e.type != "touchstart" ? e.pageX : e.changedTouches[0].clientX; this.prevY = e.type != "touchstart" ? e.pageY : e.changedTouches[0].clientY; } }, move: function move(e) { if ( downStart && !slideMove && document.documentElement.classList.contains("s1") ) { this.currentX = e.type != "touchmove" ? e.pageX : e.changedTouches[0].clientX; this.currentY = e.type != "touchmove" ? e.pageY : e.changedTouches[0].clientY; if (!document.documentElement.classList.contains("rtl")) { this.dragX = Math.min( startP, this.moveX + (this.currentX - this.prevX) ); this.dragX = Math.max( -totalW + window.innerWidth - endP, this.dragX ); if (this.prevX - this.currentX > 0) { this.endIdx = Math.floor( (eCard[0].clientWidth - this.dragX) / eCard[0].clientWidth ); } else { this.endIdx = Math.floor( (window.innerWidth / 4 - this.dragX) / eCard[0].clientWidth ); } } else { this.dragX = Math.max( -startP, this.moveX + (this.currentX - this.prevX) ); this.dragX = Math.min( totalW - window.innerWidth + endP, this.dragX ); if (this.prevX - this.currentX < 0) { this.endIdx = Math.floor( (eCard[0].clientWidth + this.dragX) / eCard[0].clientWidth ); } else { this.endIdx = Math.floor( (window.innerWidth / 4 + this.dragX) / eCard[0].clientWidth ); } } if ( this.currentX > this.currentY && Math.abs(this.prevY - this.currentY) <= 80 ) { e.preventDefault(); } e.preventDefault(); _this.move(this.dragX); } }, end: function end() { downStart = false; if (Math.abs(this.currentX) > 0) _jump(this.endIdx); this.prevX = 0; this.currentX = 0; }, }; var cardAriaHidden = function cardAriaHidden(idx) { eCard.forEach(function (i, index) { if (idx !== index) { i.setAttribute("aria-hidden", true); i.setAttribute("tabindex", -1); i.querySelectorAll("a").forEach(function (j) { j.setAttribute("aria-hidden", true); j.setAttribute("tabindex", -1); }); } else { i.removeAttribute("aria-hidden"); i.removeAttribute("tabindex"); i.querySelectorAll("a").forEach(function (j) { j.removeAttribute("aria-hidden"); j.removeAttribute("tabindex"); }); } if (!document.documentElement.classList.contains("s1")) { i.removeAttribute("aria-hidden"); i.removeAttribute("tabindex"); i.querySelectorAll("a").forEach(function (j) { j.removeAttribute("aria-hidden"); j.removeAttribute("tabindex"); }); } }); }; var _jump = function _jump(idx) { if (!slideMove) { slideMove = true; var cardStart = eCard[idx].clientWidth * idx; var cardMargin; if (!document.documentElement.classList.contains("rtl")) { cardMargin = parseInt( window .getComputedStyle(eCard[eCard.length - 1]) .getPropertyValue("margin-left"), 10 ) * idx; } else { cardMargin = parseInt( window .getComputedStyle(eCard[eCard.length - 1]) .getPropertyValue("margin-right"), 10 ) * idx; } var cardCenter = window.innerWidth / 2 - eCard[idx].clientWidth / 2; var cardMove; var marginLeft = parseInt( (innerWidth - $( ".m_content-excellence .sticky-inner > .f_header-type1" ).width()) / 2 ); var cardPadding = $(".e-card") .first() .css("padding-left") .split("px")[0]; if (!document.documentElement.classList.contains("rtl")) { if (!document.documentElement.classList.contains("s1")) { cardMove = -cardStart - cardMargin + cardCenter; } else { if (idx == "0") { cardMove = parseInt(marginLeft - cardPadding); } else { cardMove = -cardStart - cardMargin + cardCenter; } } } else { if (!document.documentElement.classList.contains("s1")) { cardMove = cardStart + cardMargin - cardCenter; } else { if (idx == "0") { cardMove = -parseInt(marginLeft - cardPadding); } else { cardMove = cardStart + cardMargin - cardCenter; } } } if (idx === 0) { arrowWrap .querySelector(".prev") .setAttribute("aria-hidden", "true"); arrowWrap .querySelector(".prev") .setAttribute("tabIndex", "-1"); arrowWrap.querySelector(".prev").classList.add("hide"); if (arrowClick) { setTimeout(function () { arrowWrap.querySelector(".next").focus(); }, 300); } } else { arrowWrap .querySelector(".prev") .setAttribute("aria-hidden", "false"); arrowWrap.querySelector(".prev").removeAttribute("tabIndex"); arrowWrap.querySelector(".prev").classList.remove("hide"); } if (idx >= eCard.length - 1) { arrowWrap .querySelector(".next") .setAttribute("aria-hidden", "true"); arrowWrap .querySelector(".next") .setAttribute("tabIndex", "-1"); arrowWrap.querySelector(".next").classList.add("hide"); if (arrowClick) { setTimeout(function () { arrowWrap.querySelector(".prev").focus(); }, 300); } } else { arrowWrap .querySelector(".next") .setAttribute("aria-hidden", "false"); arrowWrap.querySelector(".next").removeAttribute("tabIndex"); arrowWrap.querySelector(".next").classList.remove("hide"); } var moveElement = !document.documentElement.classList.contains( "s1" ) ? excellenceListUl : excellenceMobileMove; TweenMax.fromTo( moveElement, 0.5, { x: _touch.dragX, }, { x: cardMove, ease: Quint.easeOut, onComplete: function onComplete() { _touch.moveX = cardMove; _touch.dragX = cardMove; totalIdx = idx; slideMove = false; arrowClick = false; cardAriaHidden(idx); }, } ); } }; var _prev = function _prev() { arrowClick = true; totalIdx = Math.max(0, totalIdx - 1); _jump(totalIdx); }; var _next = function _next() { arrowClick = true; totalIdx = Math.min(eCard.length - 1, totalIdx + 1); _jump(totalIdx); }; var fakeDiv = document.createElement("div"); var _resize = function _resize() { startP = window.innerWidth / 2 - eCard[0].clientWidth / 2; endP = window.innerWidth / 2 - eCard[0].clientWidth / 2; if (document.documentElement.classList.contains("s1")) _jump(totalIdx); blankDiv.style.height = "var(--snbh)"; var _snbh = blankDiv.clientHeight; if (window.innerHeight - cloneList.clientHeight - _snbh < 0) { // static excellence.classList.add("static"); } else { // sticky excellence.classList.remove("static"); } }; GALAXY.load(function () { _init(); }); }; var move = function move(_move) { var moveElement = !document.documentElement.classList.contains("s1") ? excellenceListUl : excellenceMobileMove; moveElement.style.transform = "translate3d(" + _move + "px,0px,0px) rotate(0.001deg)"; }; var resize = function resize() { totalW = 0; eCard.forEach(function (_this) { var _marginLeft; if (!document.documentElement.classList.contains("rtl")) { _marginLeft = parseInt( window .getComputedStyle(_this) .getPropertyValue("margin-left"), 10 ); } else { _marginLeft = parseInt( window .getComputedStyle(_this) .getPropertyValue("margin-left"), 10 ); } totalW += _this.clientWidth + _marginLeft; }); excellenceListUl.style.width = totalW + "px"; }; return { init: init, move: move, resize: resize, }; }; excellenceMotion() && excellenceMotion().init(); var faqList = (function () { var $section = $(".m_faq-banner"), $item_q, $item_a, $item_btns, $item_cont_btns; var omni = { open: ":expand:", close: ":collapse:", }; var asset = function asset() { $item_q = $section.find(".faq_item_q"); $item_a = $section.find(".faq_item_a"); ($item_btns = $item_q.find("button")), ($item_cont_btns = $item_a.find("a.o_btn-type1")); }; var bindEvent = function bindEvent() { $item_btns.off("click").on("click", showContent); $item_cont_btns .off("click.focusMove") .on("click.focusMove", moveSection); }; var init = function init() { if (!$section.length) { return false; } asset(); bindEvent(); return this; }; var moveSection = function moveSection() { var targetId = $(this).attr("href"); var $target = $(targetId); var $title = "H2|H3".indexOf($target[0].tagName) > -1 ? $target : $target.find("h2,h3"); setTimeout(function () { if ($title.find("button").length) { $title.find("button").focus(); } else { $title .attr({ tabindex: 0, }) .css({ outline: 0, }) .focus() .one("blur", function () { $(this).removeAttr("tabindex").css("outline", ""); }); } GALAXY.setScrollTop($target.offset().top); }, 100); return false; }; var showContent = function showContent() { var $item_btn = $(this); var curIndex = $item_btns.index(this); var $item = $item_btn.closest(".faq_item"); var omniture = this.dataset.omni; if (!$item.hasClass("is-open")) { $item.addClass("is-open"); $item_btn.attr({ "aria-expanded": "true", "ga-la": omniture.replace(omni.open, omni.close), "data-omni": omniture.replace(omni.open, omni.close), }); $item_a.eq(curIndex).stop().slideDown(300); } else { $item.removeClass("is-open"); $item_btn.attr({ "aria-expanded": "false", "ga-la": omniture.replace(omni.close, omni.open), "data-omni": omniture.replace(omni.close, omni.open), }); $item_a.eq(curIndex).stop().slideUp(250); } GALAXY.omniture(omniture); return false; }; init(); })(); // yk var designMotion = function designMotion() { var $section = $(".m_feature-design"); if (!$section.length || $("html").hasClass("sL")) return false; var $videoFigure; var $imgContainer; var $vidContainer; var videoTypes; var videoPlayed; var loaded; var isMobileSize; var canPlay; var motionReady = true; var motionDuration = 0.8; var checkMobile = function checkMobile() { return $(window).width() < 768; }; var init = function init() { loaded = true; $vidContainer = $section.find(".motion-vid"); $imgContainer = $section.find(".motion-img"); $videoFigure = $vidContainer.find("figure"); videoTypes = ["webm", "mp4"]; createVideo($videoFigure); $videoFigure.video.muted = true; videoPlayed = false; isMobileSize = checkMobile(); var io1 = new IntersectionObserver( function (entries) { entries.forEach(function (entry) { if (entry.isIntersecting) on(); }); }, { rootMargin: "0px 0px -10% 0px", } ); io1.observe($videoFigure[0]); var io2 = new IntersectionObserver(function (entries) { entries.forEach(function (entry) { if (!entry.isIntersecting) off(); }); }); io2.observe($section[0]); reset(); }; var on = function on() { if (motionReady) { motionReady = false; startMotion(); } }; var off = function off() { if (GALAXY.scrollTop < $section.offset().top) { if (!motionReady) { motionReady = true; resetMotion(); } } }; var createVideo = function createVideo($videoFigure) { var mobileTag = checkMobile() ? "_s" : ""; var source = $videoFigure.data("src"); var $videoTag; if (!$videoFigure.$video) { $videoTag = $('
'); $videoTag.appendTo($videoFigure); } else { $videoTag = $videoFigure.find("video").html(""); } videoTypes.forEach(function (type) { $("
") .attr({ type: "video/".concat(type), src: "".concat(source + mobileTag, ".").concat(type), }) .appendTo($videoTag); }); $videoTag[0].load(); $videoTag.one("canplay", function () { if ($videoTag[0].readyState > 2 && !canPlay) { canPlay = true; } }); $videoFigure.$video = $videoTag; $videoFigure.video = $videoTag[0]; }; var playVideo = function playVideo() { if (canPlay) { videoPlayed = true; $videoFigure.video.play(); } }; var pauseVideo = function pauseVideo() { if (canPlay) { videoPlayed = false; $videoFigure.video.pause(); $videoFigure.video.currentTime = 0; } }; var reset = function reset() { var sizeMobile = checkMobile(); if (sizeMobile && !isMobileSize) { isMobileSize = true; videoPlayed = false; createVideo($videoFigure); } else if (!sizeMobile && isMobileSize) { isMobileSize = false; videoPlayed = false; createVideo($videoFigure); } scroll(); }; var startMotion = function startMotion() { TweenMax.fromTo( $imgContainer, motionDuration * 0.8, { opacity: 0, }, { opacity: 1, delay: motionDuration * 0.2, ease: Power2.easeOut, } ); TweenMax.fromTo( $section.find(".motion-img.left figure"), motionDuration, { x: "50%", y: "-40%", }, { x: "0%", y: "0%", ease: Power2.easeOut, onComplete: function onComplete() { $vidContainer.addClass("show"); $imgContainer.addClass("hide"); playVideo(); }, } ); TweenMax.fromTo( $section.find(".motion-img.right figure"), motionDuration, { x: "-50%", y: "40%", }, { x: "0%", y: "0%", ease: Power2.easeOut, } ); }; var resetMotion = function resetMotion() { $vidContainer.removeClass("show"); $imgContainer.removeClass("hide").__css({ opacity: 0, }); $section.find(".motion-img.left figure").__css({ x: "50%", y: "-40%", }); $section.find(".motion-img.right figure").__css({ x: "-50%", y: "40%", }); pauseVideo(); }; GALAXY.resize(function () { loaded && reset(); }); if (!loaded && window.pageYOffset > 10) init(); GALAXY.scroll(function () { if (!loaded && window.pageYOffset > 10) init(); }); }; var stickyStatic = function stickyStatic(section) { var sections = [ ".m_feature-formfactor", ".m_feature-experience_120hz", ]; var minHeight = 360; var resizing; var decideMode = function decideMode() { sections.forEach(function (e, i) { var $section = $(e); if ($section.length) { if (GALAXY.areaHeight < minHeight) { $section.addClass("static-mode"); } else { $section.removeClass("static-mode"); } } }); }; decideMode(); GALAXY.resize(function () { clearTimeout(resizing); resizing = setTimeout(function () { decideMode(); }, 50); }, true); }; var videoWrap = function videoWrap() { var io = new IntersectionObserver(function (entries) { entries.forEach(function (entry) { if (!entry.isIntersecting) { $(entry.target).closest("article").trigger("invisible"); } }); }); var load = function load() { $(".m_video-wrap").each(function (i, wrap) { io.observe(wrap); }); }; GALAXY.load(function () { load(); }); }; var $colors = $(".m_feature-colors .color-item"); var $colorImages = $(".m_feature-colors .colorset"); new faveColorChip($colors, $colorImages); new scrollActive(".m_feature-multicamera .tag", 0.7); new videoWrap(); GALAXY.load(function () { new stickyStatic(); new overview(".m_content-overview"); new designMotion(); }); // chloe var setStickyCopyHeight = function setStickyCopyHeight( _section, _at, _nextAt ) { var $section = $(".m_content-" + _section); var $article = $section.find(".m_feature-" + _section + "_" + _at); var $nextArticle = $section.find( ".m_feature-" + _section + "_" + _nextAt ); var $copyWrap = $article.find(".copy-wrap"); var totalHeight = 0; if (!GALAXY.sizeMode) return false; if (GALAXY.sizeMode < 2 && !$("html").hasClass("ie")) { totalHeight = 0; $copyWrap.find(".sticky-height").each(function () { totalHeight = totalHeight + $(this).innerHeight(); }); $nextArticle.css("margin-top", -1 * totalHeight - 1); } }; GALAXY.resize(function () { setStickyCopyHeight("experience", "immersive-view", "120hz"); }); var immersiveSticky = (function () { var $article = $(".m_feature-experience_immersive-view"); var isCheckIe = $("html").hasClass("ie"); var poniner = $article.offset().top; var minH = GALAXY.sizeMode > 2 ? 900 : GALAXY.sizeMode > 1 ? 900 : 500; var _resize = function _resize() { minH = GALAXY.sizeMode > 2 ? 900 : GALAXY.sizeMode > 1 ? 900 : 500; if (GALAXY.areaHeight < minH) { $article.removeClass("sticky-enter"); } else { $article.addClass("sticky-enter"); _init(); } }; var _init = function _init() { poniner = $article.offset().top; if ( GALAXY.scrollTop > poniner - GALAXY.areaHeight / 2 + GALAXY.navHeight * 1.3 ) { $article.find(".content-wrap").addClass("enter-motion"); } else { $article.find(".content-wrap").removeClass("enter-motion"); } }; if (!isCheckIe) { GALAXY.load(_init); GALAXY.scroll(_resize); GALAXY.resize(_resize); } })(); GALAXY.load(function () { var $experienceArticle = $(".m_feature-experience"); var $figure = $(".experience-video-wrap .experience-video"); $experienceArticle.off("visible invisible"); $experienceArticle.find("video").length && $experienceArticle.find("video").one("canplay", function () { $experienceArticle.trigger("videoOn"); }); var ob = new IntersectionObserver(function (entries, observer) { $.each(entries, function (i, entry) { if (entry.isIntersecting) { $experienceArticle.trigger("videoOn"); setTimeout(function () { $(window).trigger("scroll"); }, 50); } else { $experienceArticle.trigger("videoOff"); setTimeout(function () { $(window).trigger("scroll"); }, 50); } }); }); ob.observe($figure[0]); }); //
}) .then(function () { GALAXY.initialize(); }); });