Galaxy S25

シンプルながら心に残る

ネイビーのGalaxy S25が画面内に飛び込んできて、縦向きの背面が見える。

Galaxy S25をご紹介します。臨場感あるディスプレイ、洗練されたカメラ、スリム化して持ちやすくなったデバイスは、強力なアルミフレームに包まれ、おしゃれで高級感あるデザインになっています。,

フレッシュなカラーでフレッシュなスタートを

アングルのプリセット

アングルのプリセット

サイズを比較する

5.8

163

200

見た目はおしゃれ、つくりは頑丈

Galaxy S25+の角のクローズアップで、アルミフレームが見える。

軽量アルミフレームに包まれた頑丈なGalaxy S25は、どんなシチュエーションでも使えるおしゃれなデザインです。

Galaxy AI

Now Brief(ナウブリーフ)のアラートが表示されたNow Bar(ナウバー)が、右から左へと画面に入ってくる。Now BarはGalaxy S25のメインディスプレイ下部に移動し、焦点が当てられる。Now Barの他の3つのアラートが重ねて表示される。上からタイマー、音楽、エクササイズ。

さまざまなニーズを叶える一歩先を行く、AIがパートナーになる、次世代のモバイルAIが到来。日常会話のように話しかけるだけで、日々のタスクを簡単に確認できます。

押して話すだけで完了

メイン画面にYouTubeが表示されたGalaxy S25 Plusデバイスを持つ手が見える。サイドボタンを長押しし、Google Geminiに自然な言葉遣いで、動画で話題にあがった場所のリストを作成してノートとして保存するよう依頼すると、さまざまなアプリケーションを経由してオンライン検索を行ってから、ノートを作成し保存する。

さまざまなアプリを切り替えることなく、シームレスに作業を行うことができます。サイドボタンを長押しするだけでGoogle Geminiを起動できます。1

リアルタイムに知りたいことが分かる

Google Gemini Liveが起動し、Talk Liveが選択されている。次に、1件の画像が添付されてGemini Liveに送信される。Gemini Liveが画像を解析すると、自然言語を使用してそのコンテンツについて会話することができる。

Gemini Liveで自由に会話してみましょう。画像を添付したり、会話内容に沿った回答をリアルタイムに得られるので、アイデア出しやプレゼンテーションの準備などもスムーズに行えます。

一目で毎日を整理できるパーソナルブリーフィング

Now Brief(ナウブリーフ)は、一目で毎日を整理できるパーソナルブリーフィングです。朝のブリーフィングは天気やEnergy Score(エナジースコア)の最新情報、日中のブリーフィングは運転のヒントや期限が近いクーポンの情報、夜のブリーフィングはギャラリーの写真を使用して1日を振り返ります。

新たな機能「Now Brief」で、一目で毎日を整理できるパーソナルブリーフィングを取得できます。 朝は、最新のエナジースコアや忙しいスケジュール、リマインダーも、さっと確認してから一日をスタートしましょう。夜は、日課のアクティビティに対するインサイトや一日の出来事も振り返れます。

サウンドスタジオが手の中に

中央に音の波形が映っている被写体の映像。Audio Eraser(オーディオ消しゴム)で、不要なノイズが選択され、0から-100に下げられる。-100になると、ミュートがハイライト表示される。

オーディオ消しゴムで、背景の不要なノイズを動画から簡単に除去し、共有できるクオリティーの動画に引き上げることができます。話し声や音楽、風の音といったさまざまな種類の音を調整し、音声を最適化できます。

ハイライト動画も簡単に

Auto Trim(自動トリミング)を使い、多数のさまざまな動画のハイライトが一緒に編集されている。

動画を並べて、「自動トリミング」を選ぶだけで、簡単に映像を作成できます。生成AIが動作を検出し、トリミングしてハイライト動画を作ってくれます。好きな長さに簡単に変更もできます。

パーソナライズされた未来の健康管理

Galaxy S25のメインディスプレイが見える。Now Briefが起動している。朝のブリーフィングには今日のエナジースコアが表示され、Galaxy Watchにも同期されている。

エナジースコアを追跡して、健康目標達成を目指しましょう。Galaxy Watchと同期すると、睡眠、アクティビティ、心拍数の分析など、パーソナライズされたインサイトやコーチング情報が受けられます。,

パーソナルデータは自分で管理

Personal Data Engineがユーザーのプライマリデータを組み合わせて処理し、ユーザーに合わせた提案を提供します。このデータは暗号化されてKnox Vaultでデバイス上に保存されるため、他の人がアクセスすることはできません。

最先端のAI ProVisual engine

Galaxy S25+のカメラのレンズが画角に入り、デバイス全体が回転して後ろ向きになる。もう1台のデバイスが後ろ側に前向きで見え、フロントカメラが見える。

ProVisual engineが、強力なプロセッサによって進化しました。高度なクリエイティブシステムで、驚異の撮影、鑑賞、編集体験をお楽しみください。,

フロントカメラ
  • 約1,200万画素 セルフィーカメラ
リアカメラ
  • 約1,200万画素 超広角
  • 約5,000万画素 広角 光学相当2倍ズーム
  • 約1,000万画素 望遠 光学3倍ズーム

カメラを比較する

光学3倍ズーム、光学相当2倍ズーム、最大30倍のデジタルズーム ,,

ハイブリッド光学3倍ズーム、デジタルズーム最大30倍 ,,
光学3倍ズーム、最大30倍のデジタルズーム ,,

進化したナイトグラフィービデオで、ノイズを少なく、よりクリアに

2人の被写体が、夜にバスケットボールをしている。Galaxy S25+のカメラで、映像がクリア。

進化した10bit HDRで、より美しい映像撮影が実現しました。また、次世代APがより繊細なノイズ除去を行うため、夜間でも心配せずに撮影体験を楽しめます。,

どの瞬間も壮大なポートレートに

屋外で撮影された、一人の女性のポートレート写真。照明が正確で、被写体の顔立ちが正確に写っている。
ご覧ください。さまざまな照明環境に対応する強化された被写体認識エンジンで、目に見えるものがカメラでも捉えられます。肌の色や質感まで、肉眼で見たままに撮影しましょう。

自分だけのフィルター

波止場にいる複数の友人の写真が、フィルターが適用された状態で撮影されている。撮影中にさまざまなマイフィルターが適用できる。
自分専用にパーソナライズされたフィルターを使えば、より生き生きとした写真に。Galaxy AIがお気に入りの写真を分析し、それぞれの場面に合わせたフィルターを作成してくれます。フィルターはそのまま使ったり、気分に合わせて彩度や輝度などをカスタマイズしたりすることもできます。

電光石火の写真撮影

高度なProVisual engineとセンサーが一体化し、速いシャッタースピードでも高画質の画像を撮影できるようになりました。動いている被写体も、より鮮明に撮影することができます。

Samsung Galaxy用にカスタマイズされたパワフルなプロセッサ

チップボードの上に「Customized for Galaxy AP(Galaxy AP向けにカスタマイズ)」が浮かび、その後、上部に停止する。APからさまざまな光線が放出され、Galaxy S25のデバイスに変身する。デバイスの側面が水平に見えており、それが回転してメインディスプレイにWuthering Wavesの試合のシーンが映る。Snapdragon® 8 Elite for Galaxyが搭載されています。

Samsung Galaxy用にカスタマイズされたパワフルなプロセッサをご紹介します。Snapdragon® 8 Elite Mobile Platform for Galaxyの搭載により、向上したリアルタイムのレイトレーシングとVulkan(グラフィックAPI)の最適化や、さらに臨場感あるアクション、最高にスムーズなゲームプレイで、アクションを深く掘り下げることができます。,,,

Snapdragon® 8 Elite for Galaxy

効率化した長持ちバッテリー

Galaxy S25+の長時間バッテリーで、昼間から夜間まで29時間30分撮影された、街並みのタイムラプス。

専用のモバイルAPに搭載されたSamsungの先駆的なmDNIe技術と、ソフトウェアの最適化により、Galaxy S25のバッテリー駆動時間は向上し、長時間の動画視聴も楽しめます。,

  • 最長の動画視聴時間

    約29 時間 Galaxy S25

バッテリーを比較する

,

,

ストレージは最大512GB

12GBのメモリと、Galaxy S25は256GB、512GBから選べるストレージで、さまざまなファイルを保存できます。

AIに対応した新開発のOne UI 7

Galaxy S25+のメイン画面に、さまざまなウィジェットが表示されている。デバイスは他のウィジェットや通知に囲まれている。左側には、Gallery(ギャラリー)ウィジェット、天気ウィジェット、そして、音楽、エクササイズ、タイマーのNow Bar(ナウバー)アラート。右側には通知が見える。

Samsung Galaxyデバイスと連携すれば、もっと便利に

Galaxy S25をほかのSamsung Galaxyデバイスと同期すれば、スマートで便利なデバイス体験を実現できます。

Samsungの未来志向的なアプローチ

物事は巡り巡って返ってくるといいます。Samsungは、デバイス製造のライフサイクルにおけるエネルギー効率と資源の循環を重視しています。小さな努力の積み重ねが大きな力となることを信じ、私たちはさらなる活動に取り組んでいきます。

ケースで保護しながら、自分らしさを演出

さまざまなケースが、多様なスタイルにフィットするようデザインされています。自分らしさを表現できる、機能的なアクセサリーを探してみてください。

4台のGalaxy S25 Seriesのデバイスにさまざまなケースが装着され、後ろ向きで平面に対角線上に並べられている。右上から時計回りに、レッドのSilicone Case(シリコンケース)のGalaxy S25+、ブラックのRugged Case(ラギッドケース)で、その隣にS Penが付いたGalaxy S25 Ultra。さらに、グレーのStanding Grip Case(スタンディンググリップケース)が装着されたGalaxy S25+、Flipsuit Case(フリップスーツケース)にKeith Haring(キース・ヘリング)のグラフィックが施されたフリップカードが装着された、同じくGalaxy S25+が並んでいる。

よくある質問

Galaxy S25 Ultra

Galaxyで広がる新たな暮らし

  1. GeminiはGoogle LLCの商標です。表示結果はイメージです。インターネット接続とGoogleアカウントへのログインが必要です。サービスの利用可否は、国や地域、言語、デバイスモデルによって異なる場合があります。互換性のあるアプリで機能します。サブスクリプションの利用有無によって使用できる機能や、得られる結果が異なる場合があります。一部の機能やアプリはセットアップが必要な場合があります。結果の正確性は保証いたしません。
  2. 仕上がりは、照明環境や撮影状況(複数の対象物、ピンボケ、動く対象物など)により異なる場合があります。
  3. 従来モデルとの比較。
  4. 発売前の所定のモデルをBluetoothでイヤホンに接続し、初期設定のままLTEで通信した場合のSamsung社内試験条件によるものです。バッテリー容量と、動画再生中(動画ファイル解像度720p、デバイスに保存)のバッテリー消費電力で測定された電圧に基づく推定値。実際の動画再生時間は、ネットワークの接続状況、設定、動画ファイルの形式、画面の明るさ、バッテリーの状態などさまざまな要因で異なる可能性があります。
  5. アーマーアルミフレームには、音量やサイドキー、SIMトレイは含まれていません。
  6. 完全な長方形として対角線を測定した場合の画面サイズです。角の丸みやカメラホールを考慮すると、実際の表示可能領域は対角線測定値より小さくなります。Galaxy S25のメインディスプレイの画面サイズは、対角線で測定した場合、完全な長方形で約6.2インチ、角の丸みを考慮すると約6.0インチとなります。Galaxy S25 Ultraのメインディスプレイの画面サイズは、対角線で測定した場合、完全な長方形で約6.9インチ、角の丸みを考慮すると約6.8インチとなります。角の丸み、カメラホールにより、実際の表示可能領域は対角線測定値より小さくなります。
  7. 標準値は第三者の研究所の条件下で試験されたものです。標準値とは、IEC 61960規格に基づく試験でのバッテリーサンプル間の容量偏差を考慮した、推定平均値です。定格容量はGalaxy S25が約3,885mAh、Galaxy S25 Ultraが約4,855mAhです。実際のバッテリー駆動時間は、ネットワーク環境、使用パターン、その他の要因によって異なる場合があります。
  8. カラーバリエーションは、国や地域、キャリアによって異なります。
  9. Samsung.com限定での取り扱いカラーです。
  10. デバイスの前面と背面パネルはCorning® Gorilla® Glass Victus® 2を使用しています。
  11. 最大水深1.5メートルの淡水に最大30分間水没させた研究所での試験結果に基づく情報です。粉塵の侵入なし。接触に対する完全な保護(防塵)。デバイスの防水・防塵性能は恒久的でないため、通常の摩損により時間と共に劣化する可能性があります。
  12. GeminiはGoogle LLCの商標です。表示結果はイメージです。Gemini Live機能には、インターネット接続とGoogleアカウントへのログインが必要です。サービスの利用可否は、国や地域、言語、デバイスモデルによって異なる場合があります。サブスクリプションの利用有無によって使用できる機能や、得られる結果が異なる場合があります。一部の機能およびアカウントと互換性があります。18歳以上の方のみご利用いただけます。結果の正確性は保証いたしません。
  13. 「Now Brief」機能の使用には、Samsungアカウントへのログインが必要です。サービスの利用可否は、国や地域、言語、デバイスモデル、アプリによって異なる場合があります。状況に応じたルーチンの提案でPersonal Data Engineを使うには、モードとルーチンを有効にする必要があります。写真、動画、音声ファイル、カレンダーのイベントなどのアクセス権限に同意する必要があります。公開の範囲のポリシーによっては、モーメントが表示されない場合があります。モーメントが提供する写真の説明は、ユーザーの意図と異なる場合があります。イベントの通知は、Samsungの「カレンダー」アプリをインストールし、Androidのカレンダーデータベースを利用するカレンダーアプリに対応している場合のみ利用できます。クーポンの通知は、「Samsung Wallet」アプリにクーポンの期限が追加されている場合のみ利用可能です。エナジースコアを確認するには、Samsung Galaxy WatchまたはSamsung Galaxy Ringで計測した健康データを「Samsung Health」アプリとの同期が必要です。一般的なウェルネス・フィットネスとしての使用のみを目的としており、睡眠障害や疾患の検出、診断、治療での使用を目的としたものではありません。測定値は、個人的な参考情報としてご使用ください。医療的なアドバイスは、医療専門家にご相談ください。
  14. かこって検索はGoogle LLCの商標です。画像や動画は一部省略したシミュレーションであり、実際のUIとは異なる場合があります。表示結果はイメージです。サービスの利用可否は、国や地域、デバイスのモデルによって異なる場合があります。インターネット接続とAndroidとGoogleアプリを最新バージョンにアップデートする必要があります。結果は合致したビジュアルによって異なる場合があります。結果の正確性は保証いたしません。互換性のあるアプリおよび動作環境、環境音楽でのみ機能します。ヘッドフォンからの音楽や電話の音量がオフの場合には特定できません。
  15. 動画や、動画内の音声出力方法によって、結果が異なる場合があります。Samsungアカウントへのログインが必要です。音声、音楽、風、自然、人込み、ノイズの6種類の音を検出できます。音源や動画の状態によって、実際の音声検出が異なる場合があります。結果の正確性は保証いたしません。
  16. フォトアシストの「自動トリミング」機能を使用して編集する場合のクリップの最長時間は90分です。フォトアシストの自動トリミングを使用して編集する場合の統合したクリップの最長時間は180分です。編集可能なクリップ数は、動画1件につき60クリップです。結果の正確性は保証いたしません。
  17. エナジースコアはAndroidのスマートフォン(Android 11以降)でご利用いただけます。「Samsung Health」アプリ(v6.27以降)が必要です。Samsungアカウントへのログインが必要です。サービスの利用可否は、国や地域によって異なる場合があります。エナジースコアを確認するには、Samsung Galaxy Watch(OS 5.0以上を使用するGalaxy Watch4シリーズ以降のモデル)かSamsung Galaxy Ringで計測した健康データを「Samsung Health」アプリとの同期が必要です。少なくとも前日の活動データと睡眠、睡眠中の心拍データが必要です。一般的なウェルネス・フィットネスとしての使用のみを目的としており、睡眠障害や疾患の検出、診断、治療での使用を目的としたものではありません。測定値は、個人的な参考情報としてご使用ください。医療的なアドバイスは、医療専門家にご相談ください。
  18. Galaxy Watchは別売りです。
  19. Knox Matrixは、One UI 7.0以降に対応するSamsung Galaxyスマートフォンとタブレットでサポートされています。利用可否は国や地域によって異なる場合があります。
  20. アダプティブピクセルセンサーにより、光学相当ズームが可能です。
  21. Galaxy S24との比較。
  22. 記載されたモバイルAPのパフォーマンスはGalaxy S24と比較したものです。実際の性能はユーザーの環境、使用条件、プリインストールされたソフトウェアやアプリケーションによって異なります。
  23. 『鳴潮』(Wuthering Waves)は、Kuro Gamesの商標および/または登録商標です。「Galaxy Store」アプリにてダウンロード購入できます。作品の著作権はKuro Gamesに帰属します。国や地域、キャリアによってサービスが異なる場合があります。
  24. Snapdragonは、Qualcomm Technologies, Inc.およびその子会社の製品です。Snapdragonは、Qualcomm Incorporatedの登録商標です。
  25. ストレージ容量のラインナップは、国や地域、キャリアによって異なる場合があります。実際に使用できるストレージ容量はプリインストールされたソフトウェアによって異なる場合があります。
  26. 一部の機能ウィジェットの使用には、ネットワーク接続とSamsungアカウントへのログインが必要です。 アプリ内でサポートされる機能の利用可否は、国によって異なる場合があります。
  27. Android™デバイスから有線でデータを転送する場合、受信デバイスはAndroid™ 4.3以降、送信デバイスはAndroid 4.3™以降に対応していることが必要です。ワイヤレス接続を使用する場合、ケーブルなしでの転送が可能です。ワイヤレス接続の場合、受信デバイスはAndroid™ 4.0以降、送信デバイスはAndroid™ 4.0以降に対応していることが必要です。受信するSamsung Galaxyのデバイスで「設定」の「Smart Switch」を開くか、「Galaxy Store」アプリで「Samsung Smart Switch Mobile」アプリのダウンロードが必要です。転送可能なデータとコンテンツは、転送方法によって異なる場合があります。
  28. iOSデバイスから有線でデータを転送する場合、受信デバイスはAndroid™ 4.3以降、送信デバイスはiOS 5以降であることが必要です。ワイヤレス接続またはiCloudを使用する場合、ケーブルなしでの転送が可能です。ワイヤレス接続の場合、受信デバイスはAndroid™ 4.0以降、送信デバイスはiOS12以降であることが必要です。iCloudで転送する場合、受信デバイスはAndroid™ 4.0以降、送信デバイスはiOS 5以降であることが必要です。受信するSamsung Galaxyデバイスで「設定」の「Smart Switch」を開くか、「Galaxy Store」アプリで「Smart Switch Mobile」アプリのダウンロードが必要です。ワイヤレス転送を行う場合、お使いのiPhoneまたはiPadで、App Storeから「Smart Switch for iOS」のダウンロードが必要です。転送可能なデータとコンテンツは、転送方法によって異なる場合があります。
  29. 一度にさまざまなデータセットを転送する場合は、有線接続の使用をお勧めします。
  30. Galaxy Buds3 Pro、Galaxy Watch7、Galaxy Tab S10 Ultraは別売りです。
  31. 重さは、国や地域によって異なる場合があります。
  32. 3倍は光学ズーム、2倍は光学相当ズームです。
  33. 30倍スペースズームには、光学3倍ズームと、スーパーリゾリューションテクノロジーによる30倍デジタルズームが含まれます。3倍を超えるズームを行うと、画像の劣化が生じる場合があります。
  34. AIズームはデジタルズームの距離に適用されます。結果の正確性は保証いたしません。
  35. 実際のバッテリー駆動時間は、ネットワーク環境、使用する機能やアプリ、通話やメッセージの頻度、充電回数、その他の要因によって異なる場合があります。
')); } } } } return { init: init, } })(); })(); ; (function () { window.flagship.features.colorsViewer = (function () { const utils = window.flagship.common.utils, resize = window.flagship.common.resize, isLow = utils.isLowNetwork(); let els = {}, currDevice = resize.checkResolution(), pdViewer, isPresetOpenDown, isViewerLoaded = utils.isLowNetwork ? true : false; const init = function () { els.viewerBtn = document.querySelector('.viewer-btn'); els.section = document.querySelector('.js-colors'); els.popup = document.querySelector('.js-viewer'); // viewer els.viewerParent = document.querySelector('.features-colors__viewer360-content'); if (!!isLow) { if (!els.viewerBtn) return; els.currentWrap = els.popup; setElements(); setProperty(); popupEvents.set(); bindEvents(); } else { if (!els.section) return; els.currentWrap = els.section; setElements(); setProperty(); bindEvents(); insertViewer(); } }; const setElements = function () { els.wrapEl = document.querySelector('#wrap'); els.contents = document.querySelector('#contents'); // viewer controls els.resetBtn = els.currentWrap.querySelector('.js-reset-btn'); // viewer els.viewerSection = els.section.querySelector('.js-colors-viewer'); // angle preset els.presetOpen = els.currentWrap.querySelector('.js-preset-open'); els.presetClose = els.currentWrap.querySelector('.js-preset-close'); els.presetLayer = els.currentWrap.querySelector('.js-preset-layer'); els.angleCta = els.currentWrap.querySelectorAll('.js-angle-cta'); }; const insertViewer = function () { const viewerAssetsPath = `/samsung/resources/global/galaxy-s25/common/viewer/`; const viewerBackupPath = `/samsung/resources/global/galaxy-s25/common/vendor/viewer/assets/`; const viewerInitModel = els.viewerSection.getAttribute('data-product-name') || 'galaxy-s25-plus'; const viewerInitColor = els.viewerSection.getAttribute('data-product-color') || 'navy'; const viewerOptions = { assetsPath: viewerAssetsPath, backupPath: viewerBackupPath, bgcolor: 'transparent', gestureGuide: null, useZoom: false, usePan: false, x: -180, y: 0, minAngleX: -180, minAngleY: -90, maxAngleX: 180, maxAngleY: 90, zoom: currDevice = 'tablet' ? 95 : unll }; const modelOptionList = [{ modelName: viewerInitModel, autoRotation: null, color: viewerInitColor, screen: true, screenMode: 'on', statusToggle: false, rotation: { x: 0, y: 0, z: 0 }, position: { x: 0, y: 0, z: 0 }, introPose: '', introPoseOnce: '', introPoseHold: '', introPoseHoldLimit: '' }, ]; insertViewerHTML(els.viewerParent) .then(() => { PDVIEWER.makeViewer(null, viewerOptions, modelOptionList); pdViewer = PDVIEWER.getViewer(); // Viewer Loader image lazy load imageLoader.getLazyMedia(); imageLoader.setLazyMedia(); }); } const setProperty = function () { // timeout els.viewerParent.isHash = false; els.viewerParent.isIntroposeReady = false; els.viewerParent.resetTimeout = null; }; const insertViewerHTML = function (targetEl) { return new Promise((res) => { const target = targetEl ? targetEl : document.body; const viewrHTML = `
`; target.insertAdjacentHTML('beforeend', viewrHTML); res(); }); }; const bindEvents = function () { eventHandler.viewerEvents(); eventHandler.click(); eventHandler.mousedown(); eventHandler.mouseup(); if (!isLow) { eventList.setScene(); } }; const eventHandler = { viewerEvents: function () { window.addEventListener('introPoseReady', eventList.introPoseReady); window.addEventListener('viewerLoadEnd', eventList.viewerLoadEnd); }, click: function () { els.resetBtn && els.resetBtn.addEventListener('click', eventList.clickReset); els.presetOpen && els.presetOpen.addEventListener('click', eventList.openPresetPopup); for (let i = 0; i < els.angleCta.length; i++) { els.angleCta[i].addEventListener('click', eventList.setAngle); } els.contents.addEventListener('click', function (e) { if (e.target.classList.contains('js-reset-btn') || e.target.classList.contains('js-fold-btn') || e.target.classList.contains('js-preset-open') || e.target.closest('.js-preset-layer')) return; eventList.closePresetPopup(); }); }, scroll: function () { window.addEventListener('scroll', eventList.runIntroPose); }, mousedown: function () { els.presetOpen.addEventListener('mousedown', eventList.presetOpenDown); els.presetOpen.addEventListener('touchstart', eventList.presetOpenDown); }, mouseup: function () { els.presetOpen.addEventListener('mouseup', eventList.presetOpenUp); els.presetOpen.addEventListener('touchend', eventList.presetOpenUp); }, presetOpen: function () { window.addEventListener('focusin', eventList.focusInPreset); }, presetClose: function () { window.removeEventListener('focusin', eventList.focusInPreset); } }; const eventList = { viewerLoadEnd: function () { pdViewer.hideLoader(); eventList.setViewerAltText(); isViewerLoaded = true; }, introPoseReady: function () { if (!isLow) { els.viewerParent.isIntroposeReady = true; eventHandler.scroll(); eventList.runIntroPose(); } else { els.viewerParent && pdViewer.runIntroPoseAll(); } }, setScene: function () { els.sceneObj = SCROLLER({ trackElement: els.section, useFixed: false }); }, runIntroPose: function () { els.sceneObj.trackAnimation(function () { let progress = currDevice.indexOf('mobile') > -1 ? 50 : 30; if (this.progress >= progress && !!els.viewerParent.isIntroposeReady) { els.viewerParent && pdViewer.runIntroPoseAll(); window.removeEventListener('scroll', eventList.runIntroPose); } }); }, clickReset: function () { if (!isViewerLoaded) return; pdViewer.reset(); }, presetOpenDown: function () { isPresetOpenDown = true; }, presetOpenUp: function () { isPresetOpenDown = false; }, focusInPreset: function () { if (isPresetOpenDown) return; const isAngleCtaFocus = Array.from(els.angleCta).find((el) => el === document.activeElement); if (els.presetClose !== document.activeElement && !isAngleCtaFocus) { eventList.closePresetPopup(); } }, openPresetPopup: function () { if (!els.presetLayer.classList.contains('is-active')) { els.presetOpen.classList.add('is-open'); els.presetLayer.classList.add('is-active'); els.presetOpen.setAttribute('aria-expanded', true); els.presetClose.focus(); eventHandler.presetOpen(); } else { eventList.closePresetPopup(); } els.presetClose && els.presetClose.addEventListener('click', eventList.closePresetPopup); }, closePresetPopup: function (e) { if (els.presetLayer.classList.contains('is-active')) { els.presetOpen.classList.remove('is-open'); els.presetLayer.classList.remove('is-active'); els.presetOpen.setAttribute('aria-expanded', false); if (e && e.target.classList.contains('js-preset-close')) { els.presetOpen.focus(); } eventHandler.presetClose(); } }, setAngle: function () { if (!isViewerLoaded) return; let target = this, targetAngle = target.getAttribute('data-js-angle'); pdViewer.setModelDirection(targetAngle); accessibility.selected(target); }, setViewerAltText: function () { let altText = ''; if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { const activeModel = els.viewerSection.getAttribute('data-product-name'); altText = activeModel === 'galaxy-s25-plus' ? LOCAL_VARI.viewer.altTextPlus : LOCAL_VARI.viewer.altTextBasic; } pdViewer.setCanvasAltText(altText); } }; const accessibility = { selected: function (target) { for (let i = 0; i < els.angleCta.length; i++) { els.angleCta[i].removeAttribute('title'); if (els.angleCta[i].classList.contains('is-selected')) { els.angleCta[i].classList.remove('is-selected'); } } if (!target.classList.contains('is-selected')) { target.classList.add('is-selected'); } if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.setAttribute('title', LOCAL_VARI.selected); } else { target.setAttribute('title', 'Selected'); } } }; return { init: init } })(); })(); (function () { window.flagship.features.colors = (function () { const utils = window.flagship.common.utils; let els = {}, colorchips = document.querySelectorAll('.js-colorchip'), isViewerLoaded = utils.isLowNetwork ? true : false; const init = function () { els.section = document.querySelector('.js-colors'); 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]); } setElements(); bindEvents(); initialize(); eventList.setActiveModel(els.viewerSection.getAttribute('data-product-name')); } const setElements = function () { // model group els.modelGroupBtns = els.section.querySelectorAll('.js-model-button'); // panel els.panelWrap = els.section.querySelector('.js-panel-wrap'); els.panelInner = els.section.querySelectorAll('.js-panel-inner'); // viewer els.viewerSection = els.section.querySelector('.js-colors-viewer'); els.viewerWrap = els.viewerSection.querySelector('.features-colors__viewer360-content'); // colorchip els.allColorchip = els.section.querySelectorAll('.features-colors__colorchip'); els.allColorchipButtons = els.section.querySelectorAll('.js-colorchip-button'); els.highColorchipWrap = els.section.querySelector('.features-colors__colorchip--high'); els.highColorchipButtons = els.highColorchipWrap.querySelectorAll('.js-colorchip-button'); els.lowColorchipWrap = els.section.querySelector('.features-colors__colorchip--low'); els.colorchipNameBtns = els.section.querySelectorAll('.features-colors__chip-product-text'); els.colorchipButtons = els.lowColorchipWrap.querySelectorAll('.js-colorchip-button'); }; const bindEvents = function () { eventHandler.click(); eventHandler.viewerEvents(); } const initialize = function () { if (els.modelGroupBtns.length === 0) { els.allColorchip.forEach((colorchipWrap) => colorchipWrap.classList.add('is-single')); } } const eventHandler = { click: function () { for (let i = 0; i < els.modelGroupBtns.length; i++) { els.modelGroupBtns[i].addEventListener('click', eventList.clickModelButton); } }, viewerEvents: function () { if (!PDVIEWER.getViewer()) return; window.addEventListener('viewerLoadEnd', eventList.viewerLoadEnd); } } const eventList = { clickModelButton: async function () { if (!isViewerLoaded) return; const modelName = this.getAttribute('data-model-name'); if (modelName === els.viewerSection.getAttribute('data-product-name')) return; if (!utils.isLowNetwork()) { const viewerObj = PDVIEWER.getViewer(); if (!viewerObj || viewerObj.viewer.isChanging) return; const activeColorchipEl = Array.from(els.highColorchipButtons).find((el) => el.classList.contains('is-active')); const colorName = activeColorchipEl.getAttribute('data-colors'); viewerObj.showLoader(); await viewerObj.fadeChangeModel(modelName, colorName); viewerObj.hideLoader(); } els.viewerSection.setAttribute('data-product-name', modelName); eventList.setActiveModel(modelName); }, setActiveModel: function (activeName) { eventList.fadeOut(activeName); eventList.setModelName(activeName); eventList.setColorchip(activeName); eventList.setColorchipName(activeName); if (!utils.isLowNetwork()) { eventList.setCanvasAltText(activeName); } }, setModelName: function (activeName) { for (let i = 0; i < els.modelGroupBtns.length; i++) { const targetBtn = els.modelGroupBtns[i]; targetBtn.classList.remove('is-active'); targetBtn.removeAttribute('title'); if (targetBtn.getAttribute('data-model-name') === activeName) { targetBtn.classList.add('is-active'); accessibility.selected(targetBtn); } } }, setPanel: function (activeName) { for (let i = 0; i < els.panelInner.length; i++) { const panel = els.panelInner[i]; const panelModelName = panel.getAttribute('data-panel-model'); if (panelModelName === activeName) { panel.classList.add('is-active'); eventList.setPanelItem(panel); } else { panel.classList.remove('is-active'); accessibility.inactivePanel(panel) } } }, setPanelItem: function (panelInnerEl) { const activeColorchip = Array.from(els.colorchipButtons).find((el) => el.classList.contains('is-active')); const activeColorName = activeColorchip.getAttribute('data-colors'); const panelItems = panelInnerEl.querySelectorAll('.js-panel-item'); for (let i = 0; i < panelItems.length; i++) { const item = panelItems[i]; if (item.classList.contains('is-active')) item.classList.remove('is-active'); if (item.getAttribute('id') === activeColorName) item.classList.add('is-active'); } accessibility.activePanel(panelInnerEl, activeColorName); }, setColorchip: function (activeName) { for (let i = 0; i < els.allColorchipButtons.length; i++) { const colorchipWrap = els.allColorchipButtons[i].parentElement; const enableModels = colorchipWrap.getAttribute('data-active-model').split(','); const isEnableModel = enableModels.find((name) => name === activeName); if (!isEnableModel) { colorchipWrap.style.display = 'none'; } else { colorchipWrap.style.display = 'block'; } } }, setColorchipName: function (activeName) { for (let i = 0; i < els.colorchipNameBtns.length; i++) { const chipNameBtn = els.colorchipNameBtns[i]; const chipModel = chipNameBtn.getAttribute('data-color-model'); if (chipModel === activeName) { chipNameBtn.classList.add('is-active'); } else { chipNameBtn.classList.remove('is-active'); } } }, fadeOut: function (activeName) { if (utils.isLowNetwork()) { els.panelWrap.removeEventListener('transitionend', eventList.fadeIn.bind(null, activeName)); els.panelWrap.removeEventListener('transitionend', eventList.onFadeIn); els.panelWrap.style.transition = 'opacity .3s ease-in-out'; els.panelWrap.style.opacity = 0; els.panelWrap.addEventListener('transitionend', eventList.fadeIn.bind(null, activeName)); } }, fadeIn: function (activeName) { if (utils.isLowNetwork()) { eventList.setPanel(activeName); els.panelWrap.style.opacity = 1; els.panelWrap.removeEventListener('transitionend', eventList.fadeIn.bind(null, activeName)); els.panelWrap.addEventListener('transitionend', eventList.onFadeIn); } }, onFadeIn: function () { if (utils.isLowNetwork()) { els.panelWrap.style.transition = ''; els.panelWrap.removeEventListener('transitionend', eventList.onFadeIn); } }, setCanvasAltText: function (activeName) { let altText = ''; if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { altText = activeName === 'galaxy-s25-plus' ? LOCAL_VARI.viewer.altTextPlus : LOCAL_VARI.viewer.altTextBasic; } if (PDVIEWER.getViewer()) PDVIEWER.getViewer().setCanvasAltText(altText); }, viewerLoadEnd: function () { isViewerLoaded = true; } }; const accessibility = { selected: function (target) { if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.setAttribute('title', LOCAL_VARI.selected); } else { target.setAttribute('title', 'Selected'); } }, activePanel: function (activePanel, activeColor) { const panelItems = activePanel.querySelectorAll('.js-panel-item'); for (let i = 0; i < panelItems.length; i++) { const item = panelItems[i]; if (item.getAttribute('id') === activeColor) { item.setAttribute('aria-hidden', false); } else { item.setAttribute('aria-hidden', true); } } }, inactivePanel: function (panel) { const panelItems = panel.querySelectorAll('.js-panel-item'); for (let i = 0; i < panelItems.length; i++) { panelItems[i].setAttribute('aria-hidden', true); } } } return { init: init } })(); window.flagship.features.colorchip = function (colorchipWrap) { const utils = window.flagship.common.utils, resize = window.flagship.common.resize; let els = {}, activeClass = 'is-active', middleClass = 'is-middle', endClass = 'is-end', currentDevice = resize.checkResolution(), prevDevice = null, currentSlidesPerView = currentDevice.indexOf('mobile') > -1 ? 5 : 7, isViewerLoaded = utils.isLowNetwork ? true : false; 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.panelInner = els.panelWrap.querySelectorAll('.js-panel-inner'); // 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'); // viewer els.viewerSection = els.section.querySelector('.js-colors-viewer'); els.viewerWrap = els.viewerSection.querySelector('.features-colors__viewer360-content'); }; 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(); eventHandler.viewerEvents(); if (!utils.isLowNetwork()) { eventHandler.clickHighColorchip(); } }; const eventHandler = { click: function () { for (let i = 0; i < els.colorchipButtons.length; i++) { els.colorchipButtons[i].addEventListener('click', eventList.clickColorchip); } 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); }, viewerEvents: function () { if (!PDVIEWER.getViewer()) return; window.addEventListener('viewerLoadEnd', eventList.viewerLoadEnd); }, clickHighColorchip: function () { els.swiperContainer.addEventListener('click', eventList.colorchipsEnable); } }; 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); window.removeEventListener('scroll', eventList.scroll); } }, 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.setColorchip(activeIndex); eventList.setPanel(activeIndex); eventList.setColorName(activeIndex); // viewer if (PDVIEWER.getViewer()) { eventList.setViewerColor(activeIndex) } }, resize: function (currRes) { currentDevice = currRes; if (currentDevice !== prevDevice) { currentSlidesPerView = currentDevice.indexOf('mobile') > -1 ? 5 : 7; prevDevice = currentDevice; eventList.checkColorchipSwiper(); } }, clickColorchip: async function () { if (!isViewerLoaded) return; if (!utils.isLowNetwork() && PDVIEWER.getViewer()) { if (PDVIEWER.getViewer().viewer.isChanging) return; } const targetColor = this; eventList.setColors(targetColor.index); }, setViewerColor: async function (activeIndex) { const modelName = els.viewerSection.getAttribute('data-product-name'); const colorName = els.colorchipButtons[activeIndex].getAttribute('data-colors'); await PDVIEWER.getViewer().changeColor(modelName, colorName); }, setColorchip: function (activeIndex) { let targetcolorchipButton = els.colorchipButtons[activeIndex]; for (let i = 0; i < els.colorchipButtons.length; i++) { els.colorchipButtons[i].classList.remove(activeClass); els.colorchipButtons[i].removeAttribute('title'); } if (!targetcolorchipButton.classList.contains(activeClass)) { targetcolorchipButton.classList.add(activeClass); accessibility.selected(targetcolorchipButton); } }, setPanel: function (activeIndex) { if (!colorchipWrap.isStatic) return; const activePanelInner = Array.from(els.panelInner).find((el) => el.classList.contains('is-active')); if (!activePanelInner) return; const panelItems = activePanelInner.querySelectorAll('.js-panel-item'); for (let i = 0; i < panelItems.length; i++) { if (panelItems[i].classList.contains(activeClass)) { panelItems[i].classList.remove(activeClass); panelItems[i].setAttribute('aria-hidden', true); } } if (!panelItems[activeIndex].classList.contains(activeClass)) { panelItems[activeIndex].classList.add(activeClass); panelItems[activeIndex].setAttribute('aria-hidden', false); } }, setColorName: function (activeIndex) { for (let i = 0; i < els.colorchipNames.length; i++) { if (i !== activeIndex) { utils.onAccessibility(els.colorchipNames[i]); } if (els.colorchipNames[i].classList.contains(activeClass)) { els.colorchipNames[i].classList.remove(activeClass); } } if (!els.colorchipNames[activeIndex].classList.contains(activeClass)) { els.colorchipNames[activeIndex].classList.add(activeClass); utils.offAccessibility(els.colorchipNames[activeIndex]); } }, viewerLoadEnd: function () { isViewerLoaded = true; }, colorchipsEnable: function () { if (!PDVIEWER.getViewer().viewer.isChanging) { els.section.classList.remove('is-viewer-loading'); } } }; 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); accessibility.colorchipArrow(els.colorchipSwiper); }, slideChange: function () { accessibility.colorchip(els.colorchipSwiper); accessibility.colorchipArrow(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.swiperContainer.parentElement.classList.remove(middleClass); els.swiperContainer.parentElement.classList.remove(endClass); 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.swiperContainer.parentElement.classList.remove(middleClass); els.swiperContainer.parentElement.classList.add(endClass); clearTimeout(arrowTimeout); arrowTimeout = setTimeout(function () { els.swiperPrevArrow.focus(); }, 300); clearTimeout(arrowStyleTimeout); arrowStyleTimeout = setTimeout(function () { els.swiperNextArrow.style.display = ''; }, 400); } if (!els.colorchipSwiper.isBeginning && !els.colorchipSwiper.isEnd) { els.swiperContainer.parentElement.classList.remove(endClass); els.swiperContainer.parentElement.classList.add(middleClass); } } }, 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); } } }, colorchipArrow: function (swiperObj) { if (swiperObj.isBeginning && !swiperObj.isEnd) { utils.onAccessibility(els.swiperPrevArrow); utils.offAccessibility(els.swiperNextArrow); } else if (!swiperObj.isBeginning && !swiperObj.isEnd) { utils.offAccessibility(els.swiperPrevArrow); utils.offAccessibility(els.swiperNextArrow); } else { utils.onAccessibility(els.swiperNextArrow); utils.offAccessibility(els.swiperPrevArrow); } }, selected: function (target) { if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.setAttribute('title', LOCAL_VARI.selected); } else { target.setAttribute('title', 'Selected'); } } }; return init(colorchipWrap); }; })(); (function () { window.flagship.features.compares = (function () { const init = function () { const compares = document.querySelectorAll('.js-compare'); for (let i = 0; i < compares.length; i++) { compares[i].type = compares[i].getAttribute('data-compare-type') || null; flagship.features.compare(compares[i]); } } return { init: init } })(); window.flagship.features.compare = function (compareWrap) { const resize = window.flagship.common.resize, compareOption = window.flagship.features.compareOption; let els = {}, prevDevice = null, currDevice = resize.checkResolution(), isMousedown = false; els.currentOldValue = null, els.compareOldValue = null; const compareData = { 'SM-S931': { modelName: 'galaxy-s25', modelText: 'Galaxy S25', weight: { A: 162, B: 162, }, thickness: 7.2, hrs: { A: 29, B: 29, } }, 'SM-S936': { modelName: 'galaxy-s25-plus', modelText: 'Galaxy S25+', weight: { A: 190, B: 190, }, thickness: 7.3, hrs: { A: 30, B: 30, } }, 'SM-S916': { modelName: 'galaxy-s23-plus', modelText: 'Galaxy S23+', weight: { A: 196, B: 195, }, thickness: 7.6, hrs: { A: 27, B: 27, } }, 'SM-S911': { modelName: 'galaxy-s23', modelText: 'Galaxy S23', weight: { A: 168, B: 168, }, thickness: 7.6, hrs: { A: 22, B: 22, } }, 'SM-S906': { modelName: 'galaxy-s22-plus', modelText: 'Galaxy S22+', weight: { A: 196, B: 195, }, thickness: 7.6, hrs: { A: 21, B: 22, } }, 'SM-S901': { modelName: 'galaxy-s22', modelText: 'Galaxy S22', weight: { A: 168, B: 168, }, thickness: 7.6, hrs: { A: 18, B: 19, } }, 'SM-G991': { modelName: 'galaxy-s21', modelText: 'Galaxy S21 5G', weight: { A: 171, B: 171, }, thickness: 7.9, hrs: { A: 19, B: 20, } } } const init = function () { els.section = compareWrap; if (!!els.section) { setElements(); setProperty(); bindEvents(); eventList.setCompareVari(); eventList.getDeviceInfo().then((modelCode) => { if (!modelCode || !Object.keys(compareData).find((sku) => sku === modelCode) || (modelCode === 'SM-S931' || 'SM-S911')) { modelCode = 'SM-S911'; } const currentModel = 'SM-S931'; eventList.setDefault(els.currentVisual, currentModel); eventList.selectItem(els.currentVisual, currentModel); eventList.setDefault(els.compareVisual, modelCode); eventList.selectItem(els.compareVisual, modelCode); }); } }; const setElements = function () { els.visualEls = []; els.currentVisual = els.section.querySelector('.js-current-visual'); els.compareVisual = els.section.querySelector('.js-compare-visual'); els.visualEls.push(els.currentVisual, els.compareVisual); els.visualEls.forEach((visualEl) => visualEl.dropdown = visualEl.querySelector('.js-dropdown')); if (els.section.type === 'camera') { els.zoomTexts = els.section.querySelectorAll('.js-copy-zoom'); } else if (els.section.type === 'design') { els.thicknessTexts = els.section.querySelectorAll('.js-copy-thickness'); els.weightTexts = els.section.querySelectorAll('.js-copy-weight'); els.visualEls.forEach((visualEl) => { visualEl.compareThickness = visualEl.querySelector('.js-thickness-value'); visualEl.compareWeight = visualEl.querySelector('.js-weight-value'); visualEl.thicknessUnits = visualEl.querySelectorAll('.js-thickness-unit'); visualEl.weightUnits = visualEl.querySelectorAll('.js-weight-unit'); }); } else if (els.section.type === 'battery') { els.playbackTexts = els.section.querySelectorAll('.js-copy-playback'); els.visualEls.forEach((visualEl) => { visualEl.compareHrs = visualEl.querySelector('.js-hrs-value'); visualEl.batteryUnits = visualEl.querySelectorAll('.js-battery-unit'); }) } }; const setProperty = function () { els.visualEls.forEach((visualEl) => { visualEl.dropdown.selectBox = visualEl.dropdown.querySelector('.js-select-box'); visualEl.dropdown.button = visualEl.dropdown.querySelector('.js-select-button'); visualEl.dropdown.list = visualEl.dropdown.querySelector('.js-select-list'); visualEl.dropdown.listItem = visualEl.dropdown.list.querySelectorAll('.js-select-item'); }); if (els.section.type === 'camera') { els.zoomTexts.forEach((textEl) => { textEl.key = 'zoom'; textEl.defaultText = 'Zoom'; }) } else if (els.section.type === 'design') { els.thicknessTexts.forEach((textEl) => { textEl.key = 'thickness'; textEl.defaultText = 'Thickness'; }); els.weightTexts.forEach((textEl) => { textEl.key = 'weight'; textEl.defaultText = 'Weight'; }); els.visualEls.forEach((visualEl) => { for (let i = 0; i < visualEl.thicknessUnits.length; i++) { visualEl.thicknessUnits[i].key = 'mm'; visualEl.thicknessUnits[i].defaultText = 'mm'; } for (let i = 0; i < visualEl.weightUnits.length; i++) { visualEl.weightUnits[i].key = 'g'; visualEl.weightUnits[i].defaultText = 'g'; } }); } else if (els.section.type === 'battery') { els.playbackTexts.forEach((textEl) => { textEl.key = 'playback' textEl.defaultText = 'Video Playback'; }); els.visualEls.forEach((visualEl) => { for (let i = 0; i < visualEl.batteryUnits.length; i++) { visualEl.batteryUnits[i].key = 'hrs'; visualEl.batteryUnits[i].defaultText = 'hrs'; } }); } }; const bindEvents = function () { resize.add(eventList.resize); eventHandler.click(); eventHandler.mousedown(); eventHandler.mouseup(); eventHandler.change(); eventHandler.resize(); eventHandler.offFocusSelect() }; const eventHandler = { click: function () { els.section.addEventListener('click', function (event) { const isButton = event.target.classList.contains('js-select-button'); const isOption = event.target.classList.contains('js-select-item'); if (isButton) { eventHandler.dropdownClickCheck(event); eventList.dropdowntoggle(event); accessibility.changeAriaHidden(); } else if (isOption) { eventList.clickCompareModel(event.target); eventList.clickOption(event.target); eventList.dropdownClose(); accessibility.dropdownFocus(event.target); } }); els.visualEls.forEach((visualEl) => visualEl.dropdown.selectBox.addEventListener("click", eventList.clickSelect)); }, change: function () { els.visualEls.forEach((visualEl) => { visualEl.dropdown.selectBox.addEventListener('change', function (event) { eventList.clickOption(event.target); eventList.changeSelectBox(event.target); }); }); }, resize: function () { window.addEventListener('resize', function () { accessibility.changeAriaHidden(); }); }, mousedown: function () { els.visualEls.forEach((visualEl) => { visualEl.dropdown.button.addEventListener('mousedown', function () { isMousedown = true; }); }); }, mouseup: function () { els.visualEls.forEach((visualEl) => { visualEl.dropdown.button.addEventListener('mouseup', function () { isMousedown = false; }); }); }, dropdownClickCheck: function () { document.addEventListener('click', eventList.checkDropdownClick); }, offDropdownClickCheck: function () { document.removeEventListener('click', eventList.checkDropdownClick); }, onFocusInDropdown: function () { eventHandler.offFocusInDropdown(); document.addEventListener('focusin', eventList.focusInDropdown); }, offFocusInDropdown: function () { document.removeEventListener('focusin', eventList.focusInDropdown); }, offFocusSelect: function () { els.visualEls.forEach((visualEl) => { visualEl.dropdown.selectBox.addEventListener('blur', eventList.offFocusSelect) }); } } const eventList = { isDropdownSelect: function () { return els.visualEls.every((visualEl) => visualEl.dropdown.selectBox.clientHeight > 0); }, dropdowntoggle: function (event) { const isExpanded = event.target.getAttribute('aria-expanded') === 'true'; event.target.setAttribute('aria-expanded', !isExpanded); if (!isExpanded) { event.target.classList.add('is-active'); eventHandler.onFocusInDropdown(); setTagging.close(event.target); } else { event.target.classList.remove('is-active'); setTagging.open(event.target); } }, checkDropdownClick: function (event) { const isButton = event.target.classList.contains('js-select-button'); const isOption = event.target.classList.contains('js-select-item'); if (!isButton && !isOption) { eventList.dropdownClose(); } }, dropdownClose: function () { els.visualEls.forEach((visualEl) => { visualEl.dropdown.button.setAttribute('aria-expanded', 'false'); visualEl.dropdown.button.classList.remove('is-active'); const button = visualEl.dropdown.button; if (!(button.getAttribute('aria-expanded') === 'true')) { setTagging.open(button); } }); eventHandler.mouseup(); eventHandler.offDropdownClickCheck(); eventHandler.offFocusInDropdown(); accessibility.changeAriaHidden(); }, focusInDropdown: function (event) { const isInList = event.target.closest('.js-select-list'); const isButton = event.target.classList.contains('js-select-button'); if (!isInList && !(isButton && isMousedown)) { eventList.dropdownClose(); } }, clickOption: function (target) { const targetParent = target.closest('.js-dropdown'); targetParent.selectBoxButton = targetParent.querySelector('.js-select-button'); if (eventList.isDropdownSelect()) { const selectIndex = targetParent.selectBox.selectedIndex, optionList = targetParent.selectBox.options; Array.from(optionList).forEach(option => option.removeAttribute('selected')); optionList[selectIndex].setAttribute('selected', true) targetParent.button.textContent = optionList[selectIndex].textContent; } else { const selectItemDataValue = target.getAttribute('data-value'); Array.from(targetParent.selectBox.children).forEach((optionEl) => { const value = optionEl.getAttribute('value'); if (value !== selectItemDataValue) { optionEl.removeAttribute('selected'); } else { optionEl.setAttribute('selected', 'true'); } }); targetParent.selectBox.value = selectItemDataValue; targetParent.button.textContent = target.textContent; } }, setDefault: function (visualEl, modelValue) { const { modelText } = compareData[modelValue]; visualEl.dropdown.button.innerText = modelText; accessibility.changeAriaHidden(); }, changeDescription: function (modelValue, visualEl) { const textLists = visualEl.querySelectorAll('.js-camera-text-change'); if (textLists.length > 0) { textLists.forEach(function (list) { const matchDataItems = list.dataset.value.split(' '); const isMatched = matchDataItems.some(item => item === modelValue); !isMatched ? accessibility.ariaHiddenTrue(list) : accessibility.ariaHiddenFalse(list); if (isMatched && !els.targetOldValue) { list.classList.add('is-init'); } else if (els.targetOldValue && els.targetOldValue !== modelValue) { list.classList.remove('is-active'); list.classList.remove('is-show'); list.classList.remove('is-init'); if (isMatched) { accessibility.ariaHiddenFalse(list); list.classList.add('is-show'); setTimeout(function () { list.classList.add('is-active'); }) } } }) } }, clickCompareModel: function (optionEl) { const modelValue = optionEl.getAttribute('data-value') || ''; const targetVisualEl = els.visualEls.find((visualEl) => Array.from(visualEl.dropdown.listItem).includes(optionEl)); eventList.selectItem(targetVisualEl, modelValue); }, changeSelectBox: function (selectEl) { const targetVisualEl = els.visualEls.find((visualEl) => visualEl.dropdown.selectBox === selectEl); const selectedEl = Array.from(selectEl.childNodes).find((el) => el.selected); const modelValue = selectedEl.value; eventList.selectItem(targetVisualEl, modelValue); }, resize: function (currRes) { currDevice = currRes; if (currDevice != prevDevice) { eventList.responsive(); prevDevice = currDevice; } eventList.dropdownClose(); els.visualEls.forEach((visualEl) => visualEl.dropdown.selectBox.classList.remove("is-active")); }, responsive: function () {}, getDeviceInfo: function () { return new Promise((resolve, reject) => { if (navigator.userAgentData) { navigator.userAgentData.getHighEntropyValues(['model']).then((uaData) => { const modelCode = uaData.model ? uaData.model.slice(0, 7) : null; resolve(modelCode); }).catch((err) => reject(err)); } else { const compareModelList = Object.keys(compareData); const sku = compareModelList.find((sku) => navigator.userAgent.includes(sku)); resolve(sku); } }); }, setCompareVari: function () { let targetTexts = []; if (els.section.type === 'design') { targetTexts = Array.from(els.thicknessTexts).concat(Array.from(els.weightTexts)); els.visualEls.forEach((visualEl) => { targetTexts = targetTexts.concat(Array.from(visualEl.thicknessUnits)) .concat(Array.from(visualEl.weightUnits)) }); } else if (els.section.type === 'camera') { targetTexts = Array.from(els.zoomTexts); } else if (els.section.type === 'battery') { targetTexts = Array.from(els.playbackTexts); els.visualEls.forEach((visualEl) => { targetTexts = targetTexts.concat(Array.from(visualEl.batteryUnits)) }) } targetTexts.forEach((el) => { const { key, defaultText } = el; if (typeof COMPARE_VARI != 'undefined' && !!COMPARE_VARI) { el.innerText = COMPARE_VARI[key] || defaultText; } else { el.innerText = defaultText; } }); }, setCompareValueText: function (visualEl, modelValue) { const { thickness, weight, hrs } = compareData[modelValue]; if (els.section.type === 'design') { const weightType = weight[compareOption.type] ? weight[compareOption.type] : weight['B']; visualEl.compareThickness.innerText = thickness; visualEl.compareWeight.innerText = weightType; } else if (els.section.type === 'camera') { eventList.changeDescription(modelValue, visualEl); } else if (els.section.type === 'battery') { const hrsType = hrs[compareOption.type] ? hrs[compareOption.type] : hrs['B']; visualEl.compareHrs.innerText = hrsType; } }, selectItem: function (visualEl, modelValue) { els.targetOldValue = visualEl.classList.contains('js-current-visual') ? els.currentOldValue : els.compareOldValue; eventList.setCompareValueText(visualEl, modelValue); if (els.targetOldValue && els.targetOldValue !== modelValue) { const textAreaList = visualEl.querySelectorAll('.js-text-change'); textAreaList.forEach((textEl) => textEl.classList.remove('is-active')); setTimeout(() => textAreaList.forEach((textEl) => textEl.classList.add('is-active')), 0); } accessibility.changeSelected(visualEl, modelValue); if (els.targetOldValue === els.currentOldValue) { els.currentOldValue = modelValue; } else { els.compareOldValue = modelValue; } }, clickSelect: function (event) { event.target.classList.toggle("is-active"); }, offFocusSelect: function () { els.visualEls.forEach((visualEl) => { if (visualEl.dropdown.selectBox.classList.contains("is-active")) { visualEl.dropdown.selectBox.classList.remove("is-active"); } }); } }; const accessibility = { changeSelected: function (visualEl, modelCode) { const targetDropdownItem = visualEl.querySelectorAll('.js-select-item'); const target = Array.from(targetDropdownItem).find((el) => el.getAttribute('data-value') === modelCode); const selectBoxOptions = visualEl.querySelector('.js-select-box').options; for (let i = 0; i < selectBoxOptions.length; i++) { const optionValue = selectBoxOptions[i].getAttribute('value'); if (optionValue !== modelCode) { selectBoxOptions[i].removeAttribute('selected'); } else { selectBoxOptions[i].setAttribute('selected', true) } } for (let i = 0; i < targetDropdownItem.length; i++) { if (targetDropdownItem[i] !== target) { targetDropdownItem[i].removeAttribute('title'); } else { accessibility.selected(target); } } }, changeAriaHidden: function () { els.visualEls.forEach((visualEl) => { eventList.isDropdownSelect(); if (eventList.isDropdownSelect()) { accessibility.ariaHiddenTrue(visualEl.dropdown.list); accessibility.ariaHiddenTrue(visualEl.dropdown.button); if (visualEl.dropdown.selectBox.hasAttribute('aria-hidden')) { accessibility.ariaHiddenFalse(visualEl.dropdown.selectBox); } } else { const isOpened = visualEl.dropdown.button.getAttribute('aria-expanded') === 'true'; setTimeout(() => { // Console warning on aria-hidden on focus element accessibility.ariaHiddenTrue(visualEl.dropdown.selectBox); accessibility.ariaHiddenFalse(visualEl.dropdown.button); if (isOpened) { accessibility.ariaHiddenFalse(visualEl.dropdown.list); } else { accessibility.ariaHiddenTrue(visualEl.dropdown.list); } }); } }); }, ariaHiddenTrue: function (element) { element.setAttribute('aria-hidden', true); element.setAttribute('tabindex', '-1'); }, ariaHiddenFalse: function (element) { element.removeAttribute('aria-hidden'); element.removeAttribute('tabindex'); }, dropdownFocus: function (target) { const targetVisual = target.closest('.js-current-visual') ? target.closest('.js-current-visual') : target.closest('.js-compare-visual') targetVisual.dropdown.button.focus(); }, selected: function (target) { if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.setAttribute('title', LOCAL_VARI.selected); } else { target.setAttribute('title', 'Selected'); } } } const setTagging = { open: function (target) { if (target.hasAttribute('data-omni')) { let dataOmni = target.getAttribute('data-omni').toLowerCase(); target.setAttribute('data-omni', dataOmni.replace('close', 'open')); } if (target.hasAttribute('ga-la')) { let gaLa = target.getAttribute('ga-la').toLowerCase(); target.setAttribute('ga-la', gaLa.replace('close', 'open')); } }, close: function (target) { if (target.hasAttribute('data-omni')) { let dataOmni = target.getAttribute('data-omni').toLowerCase(); target.setAttribute('data-omni', dataOmni.replace('open', 'close')); } if (target.hasAttribute('ga-la')) { let gaLa = target.getAttribute('ga-la').toLowerCase(); target.setAttribute('ga-la', gaLa.replace('open', 'close')); } } }; return init(compareWrap); }; })(); (function () { window.flagship.features.designSpec = (function () { const utils = window.flagship.common.utils; let els = {}; let status = {}; const init = function () { els.section = document.querySelector('.features-design-spec'); els.layerPopup = document.querySelector('.js-compare-popup'); if (!!els.section && !!els.layerPopup) { setElements(); setStatus(); bindEvents(); } }; const setElements = function () { els.contents = document.querySelector('#contents'); els.popupDimmed = document.querySelector('.js-compare-popup__dimmed'); els.openCta = document.querySelector('.js-compare-popup-opener'); els.closeCta = document.querySelectorAll('.js-compare-popop__close-cta'); els.popupWrapper = document.querySelector('.features-design-spec-popup__wrapper'); els.supClicker = els.layerPopup.querySelectorAll('a.click_sup'); els.hashPopupOpener = null; }; const setStatus = function () { status.isHash = false; } const bindEvents = function () { eventList.setPopup(); for (let i = 0; i < els.supClicker.length; i++) { if (!!els.supClicker) { els.supClicker[i].addEventListener('click', eventList.onClickSup); } } }; const eventList = { setPopup: function () { utils.layerPopup({ layerPopup: els.layerPopup, layerPopupClass: '.js-compare-popup', openerEvent: { element: els.openCta, }, closeCtas: els.closeCta, dimmed: els.popupDimmed, moveTarget: document.documentElement, contents: els.contents, show: { start: function () { els.layerPopup.removeAttribute('aria-hidden'); els.layerPopup.removeAttribute('tabindex'); els.layerPopup.classList.add('is-init'); if (`#${els.openCta.getAttribute('data-hash')}` == window.location.hash) { status.isHash = true; els.hashPopupOpener = els.openCta; } }, end: function () { els.layerPopup.classList.add('is-open'); }, }, hide: { start: function () { els.layerPopup.classList.remove('is-open'); }, end: function (target) { if (utils.detector.isIosDevice) target.openerCta.style.display = ''; setTimeout(function () { els.layerPopup.classList.remove('is-init'); }, 300); if (els.popupWrapper) { els.popupWrapper.scrollTop = 0; } if (status.isHash && els.hashPopupOpener) { els.hashPopupOpener.focus(); setTimeout(function () { els.hashPopupOpener.focus(); status.isHash = false; els.hashPopupOpener = null; }, 300); } } } }); }, onClickSup: function () { els.layerPopup.hide(); }, }; return { init: init, } })(); })(); (function () { window.flagship = window.flagship || {}; window.flagship.features = window.flagship.features || {}; window.flagship.features.display = (function () { const utils = window.flagship.common.utils; const resize = window.flagship.common.resize; let els = {}; let objs = {}; let status = {}; let currDevice = resize.checkResolution(); let prevDevice = null; const init = function () { els.section = document.querySelector('.features-display'); if (!!els.section) { setElements(); setStatus(); bindEvents(); } }; const setElements = function () { els.resizeTimeout = null; els.displayBarWrap = els.section.querySelector('.features-display__bar'); els.displayBar = els.displayBarWrap.querySelector('.features-display__bar-line'); els.displayImage = els.section.querySelector('.features-display__image'); els.displayCoverImage = els.section.querySelector('.features-display__cover'); els.isGrab = false; els.isAction = false; els.displayCoverLeftWrap = els.section.querySelector('.features-display__tap--left'); els.displayCoverLeftBtn = els.section.querySelector('.features-display__tap--left button'); els.displayCoverRightBtn = els.section.querySelector('.features-display__tap--right button'); els.controller = els.section.querySelector('.features-display__button'); els.imgWrap = els.section.querySelector('.features-display__image-inner'); els.tabWrap = els.section.querySelector('.features-display__tap-wrap'); maxPercent = currDevice === 'mobileS' ? 0.805 : currDevice === 'mobile' ? 0.845 : 0.985; minPercent = currDevice === 'mobileS' ? 0.193 : currDevice === 'mobile' ? 0.155 : 0.015; }; const setStatus = function () { status.isTabMove = false; }; const bindEvents = function () { window.addEventListener('DOMContentLoaded', onLoadHandler, { once: true }); window.addEventListener('scroll', onScrollHandler); els.section.addEventListener('click', grabEventHandler.onMoveEvent); els.section.addEventListener('mousedown', grabEventHandler.onStart); els.section.addEventListener('mousemove', grabEventHandler.onMove); els.section.addEventListener('mouseup', grabEventHandler.onEnd); els.section.addEventListener('mouseleave', grabEventHandler.onEnd); els.section.addEventListener('touchstart', grabEventHandler.onStart); els.section.addEventListener('touchmove', grabEventHandler.onMove); els.section.addEventListener('touchend', grabEventHandler.onEnd); els.section.addEventListener('touchcancel', grabEventHandler.onEnd); els.section.addEventListener('touchmove', grabEventHandler.moveDisabled); els.section.addEventListener('mousemove', grabEventHandler.moveDisabled); els.section.addEventListener('click', grabEventHandler.moveDisabled); resize.add(onResizeHandler); } const setAnimations = function () { let minValue = currDevice.indexOf('mobile') > -1 ? 27.5 : 25; let maxValue = currDevice.indexOf('mobile') > -1 ? 72.5 : 75; TweenMax.set(els.displayBar, { left: `${minValue}%`, ease: Power2.easeOut }); TweenMax.set(els.controller, { left: `${minValue}%`, ease: Power2.easeOut }); TweenMax.set(els.displayCoverImage, { width: `${minValue}%`, ease: Power2.easeOut }); objs.barAnim = new TimelineLite(); objs.barAnim .to(els.displayBar, 1, { left: `${maxValue}%`, ease: Power2.easeOut }) .to(els.displayBar, 1, { left: 50 + '%', ease: Power2.easeOut }); objs.buttonAnim = new TimelineLite(); objs.buttonAnim .to(els.controller, 1, { left: `${maxValue}%`, ease: Power2.easeOut }) .to(els.controller, 1, { left: 50 + '%', ease: Power2.easeOut }); objs.imgAnim = new TimelineLite(); objs.imgAnim .to(els.displayCoverImage, 1, { width: `${maxValue}%`, ease: Power2.easeOut }) .to(els.displayCoverImage, 1, { width: 50 + '%', ease: Power2.easeOut }); TweenMax.set(els.displayCoverLeftWrap, { width: `${minValue}%`, ease: Power2.easeOut }); objs.imgAnim = new TimelineLite(); objs.imgAnim .to(els.displayCoverLeftWrap, 1, { width: `${maxValue}%`, ease: Power2.easeOut }) .to(els.displayCoverLeftWrap, 1, { width: 50 + '%', ease: Power2.easeOut }); }; const onLoadHandler = function () { onScrollHandler(); }; const onResizeHandler = function (currRes) { currDevice = currRes; clearTimeout(els.resizeTimeout); els.resizeTimeout = setTimeout(function () { onScrollHandler(); }, 150); if (currDevice != prevDevice) { onResponsiveHandler(); prevDevice = currDevice; } }; const onResponsiveHandler = function () { maxPercent = currDevice === 'mobileS' ? 0.805 : currDevice === 'mobile' ? 0.845 : 0.985; minPercent = currDevice === 'mobileS' ? 0.193 : currDevice === 'mobile' ? 0.155 : 0.015; TweenMax.set(els.displayBar, { left: 50 + '%' }); TweenMax.set(els.controller, { left: 50 + '%' }); TweenMax.set(els.displayCoverImage, { width: 50 + '%' }); TweenMax.set(els.displayCoverLeftWrap, { width: 50 + '%' }); }; const onScrollHandler = function () { let winOffsetTop = window.pageYOffset + utils.getNavHeight(); let winOffsetBottom = window.pageYOffset + window.innerHeight; let targetRect = els.displayImage.getBoundingClientRect(); let targetOffsetTop = window.pageYOffset + targetRect.top; let targetOffsetBottom = window.pageYOffset + targetRect.bottom; if ((winOffsetBottom - (window.innerHeight * 0.25) > targetOffsetTop && winOffsetTop + (window.innerHeight * 0.25) < targetOffsetBottom) && !els.isAction) { setAnimations(); els.isAction = true; } }; const grabEventHandler = { onStart: function (e) { e.target.matches('.features-display__button') && (els.isGrab = true); }, onEnd: function () { els.isGrab = false; }, onMove: function (e) { if (els.isGrab) { e && e.preventDefault(); let wrapRect = els.displayBarWrap.getBoundingClientRect(); let wrapMaxWidth = wrapRect.width * maxPercent; let wrapMinWidth = wrapRect.width * minPercent; let xPosition = !e.touches ? e.pageX : e.touches[0].pageX; let barPosition = xPosition - wrapRect.left; if (barPosition > wrapMaxWidth) barPosition = wrapMaxWidth; else if (barPosition < wrapMinWidth) barPosition = wrapMinWidth; let barPercent = ((barPosition / wrapRect.width) * 100); els.displayBar.style.left = barPercent + '%'; els.controller.style.left = barPercent + '%'; els.displayCoverImage.style.width = barPercent + '%'; grabEventHandler.setArrowSize(barPercent); } }, onMoveEvent: function (e) { let wrapRect = els.displayBarWrap.getBoundingClientRect(); let wrapMaxWidth = wrapRect.width * maxPercent; let wrapMinWidth = wrapRect.width * minPercent; let barRect = els.displayBar.getBoundingClientRect(); let barPosition = barRect.left - wrapRect.left; let moveValue = Math.ceil(wrapMaxWidth / ((currDevice.indexOf('desktop') > -1) ? 8 : 5.5)); let isMove = e.target.classList.contains('features-display__tap-button') || e.target.classList.contains('features-display__button'); if (isMove) { status.isTabMove = true; if (e.type == 'click' && e.target.classList.contains('features-display__tap-button')) { let leftBtn = 'features-display__tap--left'; let rightBtn = 'features-display__tap--right'; if (e.target.parentElement.classList.contains(leftBtn)) { barPosition -= moveValue; } else if (e.target.parentElement.classList.contains(rightBtn)) { barPosition += moveValue; } } if (e.target.classList.contains('features-display__button') && (e.keyCode == 39 || e.keyCode == 37)) { e && e.preventDefault(); if (e.keyCode == 39) barPosition += moveValue; else if (e.keyCode == 37) barPosition -= moveValue; } if (barPosition < wrapMinWidth) barPosition = wrapMinWidth; else if (barPosition > wrapMaxWidth) barPosition = wrapMaxWidth; let barPercent = ((barPosition / wrapRect.width) * 100); TweenMax.to(els.displayBar, 0.3, { left: barPercent + '%', ease: Power2.easeOut }); TweenMax.to(els.controller, 0.3, { left: barPercent + '%', ease: Power2.easeOut }); TweenMax.to(els.displayCoverImage, 0.3, { width: barPercent + '%', ease: Power2.easeOut }); grabEventHandler.setArrowSize(barPercent); } }, moveDisabled: function () { const controllerObserver = new MutationObserver(() => { setTimeout(() => { const leftValue = els.controller.style.left; if (leftValue >= Math.trunc(maxPercent * 100) + "%") { els.displayCoverRightBtn.disabled = true; if(els.displayCoverRightBtn.disabled == true) { utils.onAccessibility(els.displayCoverRightBtn); els.displayCoverLeftBtn.focus(); } } else if (leftValue == minPercent * 100 + "%") { els.displayCoverLeftBtn.disabled = true; if(els.displayCoverLeftBtn.disabled == true) { utils.onAccessibility(els.displayCoverLeftBtn); els.displayCoverRightBtn.focus(); } } else { els.displayCoverRightBtn.removeAttribute("disabled"); els.displayCoverLeftBtn.removeAttribute("disabled"); utils.offAccessibility(els.displayCoverRightBtn); utils.offAccessibility(els.displayCoverLeftBtn); } }, 0); }); controllerObserver.observe(els.controller, { attributes: true, attributeFilter: ['style'] }); }, setArrowSize: function (barPercent) { let imgWidth = els.imgWrap.getBoundingClientRect().width; let tabWidth = els.tabWrap.getBoundingClientRect().width; let imgValue = imgWidth * (barPercent * (1 / 100)); let tabValue = (imgWidth - tabWidth) / 2; let moveTabBtnValue = Math.floor(imgValue - tabValue); if (status.isTabMove) { TweenMax.to(els.displayCoverLeftWrap, 0.3, { width: moveTabBtnValue + 'px', ease: Power2.easeOut }); status.isTabMove = false; } else { els.displayCoverLeftWrap.style.width = moveTabBtnValue + 'px'; } } }; return { init: init } })(); })(); ; (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 = 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; const Swiper = window.flagship.Swiper; let els = {}; let prevDevice; let swiperObj = {}; let pointerOffset = {}; let currDevice = resize.checkResolution(); let ctaPlayStatus = true; let scrollProgress = null; let lowNetwork = document.documentElement.classList.contains('low_network'); 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.mediaWrap = els.mainContainer.querySelectorAll('.features-highlights__content'); els.indication = els.section.querySelector('.common-carousel__pagination'); els.prevArrow = els.mainContainer.parentElement.querySelector('.swiper-button-prev'); els.nextArrow = els.mainContainer.parentElement.querySelector('.swiper-button-next'); els.featureTagging = els.mainContainer.getAttribute('data-tagging-feature'); els.scrollbar = els.section.querySelector('.js-highlights-scrollbar'); }; const setProperty = function () { els.mainContainer.autoPlay = true; for (let i = 0; i < els.mediaWrap.length; i++) { els.mediaWrap[i].isVideo = els.mediaWrap[i].classList.contains('is-video'); els.mediaWrap[i].isImage = els.mediaWrap[i].classList.contains('is-image'); if (els.mediaWrap[i].isVideo) { els.mediaWrap[i].videoWrap = els.mediaWrap[i].querySelector('.js-video-wrap'); els.mediaWrap[i].video = els.mediaWrap[i].querySelector('.common-video__video'); els.mediaWrap[i].coverImageHighband = els.mediaWrap[i].querySelector('.common-video__cover-image--highband'); els.mediaWrap[i].coverImageLowband = els.mediaWrap[i].querySelector('.common-video__cover-image--lowband'); els.mediaWrap[i].controller = els.mediaWrap[i].querySelector('.js-video-control'); els.mediaWrap[i].controller.video = els.mediaWrap[i].video; els.mediaWrap[i].progressBar = els.mediaWrap[i].querySelector('.common-video__control-progress-bar'); els.mediaWrap[i].startPoint = els.mediaWrap[i].getAttribute('data-start-point'); els.mediaWrap[i].reversePoint = els.mediaWrap[i].getAttribute('data-reverse-point'); els.mediaWrap[i].moStartPoint = els.mediaWrap[i].getAttribute('data-mo-start-point'); els.mediaWrap[i].moReversePoint = els.mediaWrap[i].getAttribute('data-mo-reverse-point'); } else if (els.mediaWrap[i].isImage) { els.mediaWrap[i].img = els.mediaWrap[i].querySelector('.js-image-wrap > 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); }); els.scrollbar.addEventListener('mousedown', function () { els.mainContainer.autoPlay = false; }); els.scrollbar.addEventListener('mouseleave', function () { els.mainContainer.autoPlay = false; }); }, click: function () { for (let i = 0; i < els.mediaWrap.length; i++) { if (els.mediaWrap[i].isVideo) { els.mediaWrap[i].controller.addEventListener('click', eventList.clickVideoCta); els.mediaWrap[i].controller.addEventListener('click', eventList.stopAutoPlay); } } if (els.prevArrow && els.nextArrow) { 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', function (e) { eventList.stopAutoPlay(e); }); }, scroll: function () { window.addEventListener('scroll', eventList.scroll); } } const eventList = { load: function () { swiperEvents.set(); swiperObj.main.init(); eventList.setVideo(); eventList.setScene(); eventList.scroll(); }, resize: function () { currDevice = resize.checkResolution(); if (prevDevice != currDevice) { eventList.responsive(); prevDevice = currDevice; } }, responsive: function () { swiperObj.main.slideTo(0, false); }, setVideo: function () { for (let i = 0; i < els.mediaWrap.length; i++) { if (els.mediaWrap[i].isVideo) { utils.videoHandler({ playType: 'scrollPlay', startPoint: (currDevice.indexOf('mobile') > -1) ? els.mediaWrap[i].moStartPoint : els.mediaWrap[i].startPoint, reversePoint: (currDevice.indexOf('mobile') > -1) ? els.mediaWrap[i].moReversePoint : els.mediaWrap[i].reversePoint, wrap: els.mediaWrap[i].videoWrap, video: els.mediaWrap[i].video, controller: els.mediaWrap[i].controller, playCallback: function () { setTagging.pause(this.controller); this.video.timeupdateEvent = function () { if (this.currentTime > 0) { if (!this.videoHandler.wrap.classList.contains('is-started', 'is-playing')) { this.videoHandler.wrap.classList.add('is-started', 'is-playing'); } eventList.setProgerssDuration(i); this.removeEventListener('timeupdate', this.timeupdateEvent); } } this.video.addEventListener('timeupdate', this.video.timeupdateEvent); this.video.removeEventListener('canplay', eventList.playVideoOnce); }, pauseCallback: function () { setTagging.play(this.controller); }, endCallback: function () { eventList.autoSlideNext(1000); } }); } } }, autoSlideNext: function (time) { if (els.mainContainer.autoPlay) { if (scrollProgress > 40 && scrollProgress < 55) { clearTimeout(swiperObj.main.videoTiming); swiperObj.main.videoTiming = setTimeout(() => { swiperObj.main.slideNext(); }, time); } else { clearTimeout(swiperObj.main.videoTiming); } } }, playVideoOnce: function () { this.play(); }, playVideo: function (video) { for (let i = 0; i < els.mediaWrap.length; i++) { if (els.mediaWrap[i].isVideo && video.readyState >= 1) { video.play(); } else { video.addEventListener('canplay', eventList.playVideoOnce, { 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('common-carousel__pagination-button') || e.target.classList.contains('js-highlights-scrollbar') ) { els.mainContainer.autoPlay = false; } }, swiperArrowVisibility: function () { let mainSlidesLength = els.mainSwiperSlides.length - 1; let mainSwiper = swiperObj.main; let prevArrow = mainSwiper.previousIndex > mainSwiper.realIndex; let nextArrow = mainSwiper.previousIndex < mainSwiper.realIndex; if (els.prevArrow && els.nextArrow) { 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 () { let isIndex = swiperObj.main.realIndex; els.section.scene.trackAnimation(function () { scrollProgress = this.progress; if (els.mediaWrap[isIndex].isVideo) { let isMainVideoHandler = els.mediaWrap[isIndex].video.videoHandler; if (!lowNetwork && ctaPlayStatus) isMainVideoHandler.scrollActive(scrollProgress); } else if (els.mediaWrap[isIndex].isImage) { eventList.slideVideoPlay(); } }) }, slideVideoPlay: function () { let isIndex = swiperObj.main.realIndex; if (els.mediaWrap[isIndex].isVideo) { let isMainVideoHandler = els.mediaWrap[isIndex].video.videoHandler; isMainVideoHandler.eventList.reset.call(isMainVideoHandler); els.mediaWrap[isIndex].videoWrap.classList.remove('is-started'); setTimeout(function () { if (ctaPlayStatus) { eventList.playVideo(els.mediaWrap[isIndex].video); setTimeout(function () { if (els.mainContainer.autoPlay) isMainVideoHandler.controller.blur(); if (els.mainContainer.autoPlay) isMainVideoHandler.controller.focus(); if (isIndex == (swiperObj.main.slides.length)) { els.mainContainer.autoPlay = false; } }, 900); } }, 50); } else if (els.mediaWrap[isIndex].isImage && ctaPlayStatus) { eventList.autoSlideNext(3000); } }, setProgerssDuration: function (index) { let isDuration = els.mediaWrap[index].video.duration; if (!!!els.mediaWrap[index].durationSet) { els.mediaWrap[index].progressBar.style.animationDuration = `${isDuration}s`; els.mediaWrap[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 (els.mediaWrap[i].isVideo) { if (mainVideoloadComplateLength != videoLength && !els.mediaWrap[i].video.classList.contains('is-video-load-complete')) { if (!els.mediaWrap[i].video.classList.contains('is-mp4video-load-complete')) { if (!!els.mediaWrap[i].video) videoLoader.setResponsiveMedia([els.mediaWrap[i].video]); if (!lowNetwork) { if (!!els.mediaWrap[i].coverImageHighband) imageLoader.setResponsiveMedia([els.mediaWrap[i].coverImageHighband]); } else { if (!!els.mediaWrap[i].coverImageLowband) imageLoader.setResponsiveMedia([els.mediaWrap[i].coverImageLowband]); } } } } } }, pauseVideo: function (swiper) { for (let i = 0; i < swiper.slides.length; i++) { if (els.mediaWrap[i].isVideo) { let slideVideo = swiper.slides[i].querySelector('video'); if (!slideVideo.paused) { slideVideo.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 }); }, 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, speed: 600, slidesPerView: 'auto', scrollbar: { el: els.scrollbar, }, pagination: { el: els.indication, clickable: true, renderBullet: function (index, className) { const slide = this.slides[index]; const slideTitle = slide.getAttribute('data-slide-title') || ''; const tagging = { omniType: "microsite_gallery", actionType: "gallery", contentType: "feature gallery", taggingValue: els.featureTagging + ":sldr-dots:" + `${index + 1}` } this.slideTitle = slideTitle; return ` `; } }, a11y: false, }); swiperObj.main.on('init', swiperEvents.init); swiperObj.main.on('slideChange', swiperEvents.slideChange); swiperObj.main.on('transitionEnd', swiperEvents.transitionEnd); swiperObj.main.on('paginationUpdate', swiperEvents.paginationUpdate); } if (els.prevArrow) { els.prevArrow.style.display = 'none'; } }, init: function () { if (els.prevArrow && els.nextArrow) { 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); }, paginationUpdate: function () { const bullets = this.pagination.bullets; const slides = this.slides; for (let i = 0; i < bullets.length; i++) { const slideTitle = i < slides.length ? this.slides[i].getAttribute('data-slide-title') : ""; const bullet = bullets[i]; const button = bullet.querySelector('button'); const isActive = bullet.classList.contains('swiper-pagination-bullet-active'); const selected = isActive ? ` ${LOCAL_VARI.selected}` : ''; button.setAttribute('aria-label', `${LOCAL_VARI.slide}${i + 1}${selected}: ${slideTitle}`); } }, slideChange: function () { accessibility.slide(this); eventList.pauseVideo(this); if (this.realIndex > 0) eventList.setMedia(this.realIndex); if (!lowNetwork) eventList.slideVideoPlay(); eventList.swiperArrowVisibility(); }, 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 secondSlide = this.slides[lastIndex - 2]; let lastSlideIsVideo = lastSlide.querySelector('.features-highlights__content.is-video'); let lastBeforeSlideIsVideo = lastBeforeSlide.querySelector('.features-highlights__content.is-video'); let isIndex = swiperObj.main.previousIndex; let isMoveSize = currDevice != 'mobile' ? carouselInfo.isMoveSize : carouselInfo.isMoveSize + Math.abs(carouselInfo.slideMargin); if (els.mediaWrap[isIndex].isVideo) els.mediaWrap[isIndex].video.pause(); if (carouselInfo.lastBeforeSize + (carouselInfo.slideWidth / 2) < isMoveSize && carouselInfo.maxMoveSize - (carouselInfo.slideWidth / 2) <= isMoveSize) { if (currDevice.indexOf('mobile') > -1) { eventList.pauseVideo(this); if (!lowNetwork && ctaPlayStatus && lastSlideIsVideo) { lastSlide.querySelector('video').play(); } lastSlide.classList.add('swiper-slide-active'); lastBeforeSlide.classList.add('swiper-slide-prev'); lastSlide.classList.remove('swiper-slide-next'); lastBeforeSlide.classList.remove('swiper-slide-active'); secondSlide.classList.remove('swiper-slide-prev'); if (els.nextArrow) { if (els.nextArrow.style.display != 'none') { els.nextArrow.style.display = 'none'; setTimeout(() => { els.prevArrow.blur(); els.prevArrow.focus(); }, 300); } } utils.offAccessibility(this.slides[lastIndex]); utils.onAccessibility(this.slides[lastIndex - 1]); } } else if (carouselInfo.lastBeforeSize <= carouselInfo.isMoveSize) { if (currDevice.indexOf('mobile') > -1) { eventList.pauseVideo(this); if (!lowNetwork && ctaPlayStatus && lastBeforeSlideIsVideo) { lastBeforeSlide.querySelector('video').play(); } lastSlide.classList.add('swiper-slide-next'); lastBeforeSlide.classList.add('swiper-slide-active'); secondSlide.classList.add('swiper-slide-prev'); lastSlide.classList.remove('swiper-slide-active'); lastBeforeSlide.classList.remove('swiper-slide-prev'); if (els.nextArrow) { if (els.nextArrow.style.display == 'none') els.nextArrow.style.display = ''; } 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 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.kv = (function () { let els = {} const init = function () { els.section = document.querySelector('.js-kv'); els.hasOffer = document.querySelector('.feature-kv__anchor'); if (!!els.section && !!els.hasOffer) { setElements(); bindEvents(); } }; const setElements = function () { els.kvDropdown = els.section.querySelector('.js-kv-dropdown'); els.kvDropdownItem = els.section.querySelector('.features-kv__description'); els.kvDropdownSpan = els.section.querySelector('.js-button-text'); els.kvDropdownDataOmni = els.kvDropdown.getAttribute('data-omni'); els.kvDropdownGaLa = els.kvDropdown.getAttribute('ga-la'); }; const bindEvents = function () { eventHandler.click(); eventList.defaultText(); }; const eventHandler = { click: function () { els.kvDropdown.addEventListener('click', eventList.click); } } const eventList = { defaultText: function () { const openText = els.kvDropdownSpan.getAttribute('data-open-text'); els.kvDropdownSpan.textContent = openText; }, click: function () { const openText = els.kvDropdownSpan.getAttribute('data-open-text'); const closeText = els.kvDropdownSpan.getAttribute('data-close-text'); if (els.kvDropdownItem.classList.contains('is-open')) { els.kvDropdownItem.classList.remove('is-open'); els.kvDropdown.classList.remove('is-active'); els.kvDropdown.setAttribute('ga-la', els.kvDropdownDataOmni.replace('close', 'open')); els.kvDropdown.setAttribute('data-omni', els.kvDropdownGaLa.replace('close', 'open')); els.kvDropdownSpan.textContent = openText; } else { els.kvDropdownItem.classList.add('is-open'); els.kvDropdown.classList.add('is-active'); els.kvDropdown.setAttribute('ga-la', els.kvDropdownDataOmni.replace('open', 'close')); els.kvDropdown.setAttribute('data-omni', els.kvDropdownGaLa.replace('open', 'close')); els.kvDropdownSpan.textContent = closeText; } } }; return { init: init } })(); })(); (function () { window.flagship.features.proVisual = (function () { const utils = window.flagship.common.utils; resize = flagship.common.resize; let els = {}; let currDevice = resize.checkResolution(); const init = function () { setElements(); bindEvents(); }; const setElements = function () { els.cameraSpec = document.querySelectorAll('.features-provisual-engine__spec-item'); }; const bindEvents = function () { resize.add(eventList.resize); eventList.setTextScene(); eventList.textMotion(); eventHandler.scroll(); }; const eventHandler = { scroll: function () { window.addEventListener('scroll', eventList.textMotion); } }; const eventList = { resize: function (currRes) { currDevice = currRes; }, textMotion: function () { for (let i = 0; i < els.cameraSpec.length; i++) { els.cameraSpec[i].sceneObj.trackAnimation(function () { if (10 <= this.progress && this.progress <= 100) { els.cameraSpec[i].classList.add('is-active'); } if (this.progress < 0) { els.cameraSpec[i].classList.remove('is-active'); } }); } }, setTextScene: function () { for (let i = 0; i < els.cameraSpec.length; i++) { els.cameraSpec[i].sceneObj = SCROLLER({ trackElement: els.cameraSpec[i], useFixed: false, useStrictMode: false }); } } }; return { init: init } })(); })(); (function () { window.flagship.features.howtoPopup = (function () { const utils = window.flagship.common.utils; const Swiper = window.flagship.Swiper; resize = window.flagship.common.resize; let els = {}; let currDevice = resize.checkResolution(); prevDevice = null, currOpener = null; const init = function () { els.layerPopup = document.querySelector('.js-howto-popup'); if (!!els.layerPopup) { setElements(); setAttribute(); bindEvents(); eventList.setPopup(); } }; const setElements = function () { els.contents = document.querySelector('#contents'); els.openCtas = document.querySelectorAll('.js-howto-popup-opener'); els.openCta = document.querySelectorAll("[data-howto-slide]:not(.js-howto-popup [data-howto-slide])"); // popup content els.closeCta = document.querySelectorAll('.js-howto-popup-close-cta'); els.ytIframe = els.layerPopup.querySelector('iframe'); els.ytDesc = els.layerPopup.querySelector('.js-howto-popup-youtube-desc'); els.dimmed = els.layerPopup.querySelector('.js-howto-popup-dimmed'); // swiper els.swiperContainer = els.layerPopup.querySelector('.swiper-container'); els.featureTagging = els.swiperContainer.getAttribute('data-tagging-feature'); els.buttonWrap = els.swiperContainer.querySelectorAll('.swiper-slide'); els.thumbList = els.swiperContainer.querySelectorAll("[data-howto-slide]"); els.arrowWrap = els.swiperContainer.querySelector('.js-howto-popup-arrow-wrap'); els.indication = els.swiperContainer.querySelector('.common-carousel__pagination'); els.scrollbar = els.swiperContainer.querySelector('.js-howto-popup-scrollbar'); }; const setAttribute = function () { els.openCta.forEach((cta)=> { const howtoAtrr = cta.getAttribute("data-howto-slide"); els.thumbList.forEach((thumb)=>{ if(thumb.getAttribute("data-howto-slide") === howtoAtrr) { thumb.openerCta = cta; thumb.button = thumb.querySelector('button'); thumb.button.openerCta = thumb.openerCta; cta.thumb = thumb; } }); }); }; const bindEvents = function () { eventHandler.buttonsClick(); resize.add(eventList.resize); }; const eventHandler = { buttonsClick: function () { for (let i = 0; i < els.buttonWrap.length; i++) { els.buttonWrap[i].button.addEventListener('click', function () { eventList.setYoutube(els.buttonWrap[i]); }); } } }; const eventList = { setPopup: function () { for (let i = 0; i < els.thumbList.length; i++) { utils.layerPopup({ layerPopup: els.layerPopup, layerPopupClass: '.js-howto-popup', openerEvent: { element: els.openCtas[i], }, closeCtas: els.closeCta, dimmed: els.dimmed, moveTarget: document.documentElement, contents: els.contents, show: { start: function (target) { let allVideos = document.querySelectorAll('video'); for (let i = 0; i < allVideos.length; i++) { if (!allVideos[i].paused) allVideos[i].pause(); } els.layerPopup.removeAttribute('aria-hidden'); els.layerPopup.removeAttribute('tabindex'); els.layerPopup.classList.add('is-init'); currOpener = target.openerCta; eventList.itemImageLoader(); swiperEventList.activeCheck(); }, end: function (target) { els.layerPopup.classList.add('is-open'); eventList.setYoutube(target); } }, hide: { start: function () { els.layerPopup.classList.remove('is-open'); }, end: function (target) { if (utils.detector.isIosDevice) target.openerCta.style.display = ''; setTimeout(function () { els.layerPopup.classList.remove('is-init'); eventList.removeYoutube(); accessibility.removeTitle(); swiperEventList.destroy(); els.layerPopup.children[0].scrollTop = 0; }, 300); } } }); } }, 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; let oldActive = els.swiperContainer.querySelector('.swiper-slide.is-active'); if (!!oldActive) { oldActive.classList.remove('is-active'); oldActive.button.removeAttribute('title'); } opener.thumb.classList.add('is-active'); accessibility.setTitle(opener.thumb); }, removeYoutube: function () { els.ytIframe.removeAttribute('src'); els.ytDesc.innerHTML = ''; }, resize: function (currRes) { currDevice = currRes; if (prevDevice != currDevice) { if (els.layerPopup.classList.contains('is-open')) { swiperEventList.activeCheck(); } prevDevice = currDevice; } }, itemImageLoader: function () { for (let i = 0; i < els.buttonWrap.length; i++) { if (!els.buttonWrap[i].querySelector('img').classList.contains('is-img-load-complete')) { imageLoader.setResponsiveMedia([els.buttonWrap[i].querySelector('img')]); } } } }; const swiperEventList = { set: function () { if (els.swiperContainer.swiper == null) { els.swiperContainer.swiper = new Swiper(els.swiperContainer, { init: false, slidesPerView: 'auto', scrollbar: { el: els.scrollbar, draggable: true }, pagination: { el: els.indication, clickable: true, renderBullet: function (index, className) { const slide = this.slides[index]; const slideTitle = slide.getAttribute('data-slide-title') || ''; const tagging = { omniType: "microsite_gallery", actionType: "gallery", contentType: "feature gallery", taggingValue: els.featureTagging + ":sldr-dots:" + `${index + 1}` } this.slideTitle = slideTitle; return ` `; } }, a11y: false, }); els.swiperContainer.swiper.on('init', swiperEventList.init); els.swiperContainer.swiper.on('slideChange', swiperEventList.slideChange); els.swiperContainer.swiper.on('paginationUpdate', swiperEventList.paginationUpdate); els.swiperContainer.swiper.init(); } }, destroy: function () { if (els.swiperContainer.swiper != null) { els.swiperContainer.swiper.scrollbar.dragEl.style = ''; els.swiperContainer.swiper.scrollbar.destroy(true); els.swiperContainer.swiper.navigation.destroy(true); els.swiperContainer.swiper.destroy(true); els.swiperContainer.swiper = null; } }, init: function () { let self = this, notification = self.el.querySelector('.swiper-notification'); if (!!notification) self.el.removeChild(notification); setTimeout(function () { accessibility.slide(); }, 500); }, paginationUpdate: function () { const bullets = this.pagination.bullets; const slides = this.slides; let arrSlidesTitle = []; for (let i = 0; i < slides.length; i++) { arrSlidesTitle.push(slides[i].dataset.slideTitle) } for (let i = 0; i < bullets.length; i++) { const bullet = bullets[i]; const button = bullet.querySelector('button'); const isActive = bullet.classList.contains('swiper-pagination-bullet-active'); const selected = isActive ? ` ${LOCAL_VARI.selected}` : ''; if (currDevice.indexOf('mobile') > -1) { button.setAttribute('aria-label', `${LOCAL_VARI.slide}${i + 1}${selected}: ${arrSlidesTitle[i]}, ${arrSlidesTitle[i+1]}`); } else { button.setAttribute('aria-label', `${LOCAL_VARI.slide}${i + 1}${selected}: ${arrSlidesTitle[i]}, ${arrSlidesTitle[i+1]}, ${arrSlidesTitle[i+2]}, ${arrSlidesTitle[i+3]}`); } } }, slideChange: function () { accessibility.slide(); }, activeCheck: function () { let isSlide = ((currDevice.indexOf('mobile') > -1) && (els.buttonWrap.length >= 3)) || ((currDevice.indexOf('desktop') > -1 || currDevice == 'tablet') && (els.buttonWrap.length >= 5)); if (isSlide) { els.scrollbar.style.display = 'block'; swiperEventList.set(); let buttonIndex; for(let i=0; i < els.buttonWrap.length; i++) { if (els.buttonWrap[i] === currOpener.thumb) { buttonIndex = i; } } const changeSlide = buttonIndex - 1; if (currOpener != null) { els.swiperContainer.swiper.slideTo(changeSlide, 0); } } else { els.scrollbar.style.display = 'none'; swiperEventList.destroy(); } } }; const accessibility = { setTitle: function (target) { if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { target.button.setAttribute('title', LOCAL_VARI.selected); } else { target.button.setAttribute('title', 'Selected'); } }, removeTitle: function () { for(let i = 0; i < els.buttonWrap.length; i++) { if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) { els.buttonWrap[i].button.removeAttribute('title', LOCAL_VARI.selected); } else { els.buttonWrap[i].button.removeAttribute('title', 'Selected') } }; }, slide: function () { let slidePerviewValue = currDevice.indexOf('mobile') > -1 ? 2 : 4; let getPerviewIndex = function () { return slidePerviewValue - 1; } for (let i = 0; i < els.swiperContainer.swiper.slides.length; i++) { if (i >= els.swiperContainer.swiper.activeIndex && i <= (els.swiperContainer.swiper.activeIndex + getPerviewIndex())) { utils.offAccessibility(els.swiperContainer.swiper.slides[i]); } else { utils.onAccessibility(els.swiperContainer.swiper.slides[i]); } } } }; return { init: init, } })(); })(); flagship.features.initialize = (function () { window.flagship.common.resize.bindEvent(); const init = function () { flagship.features.highlightsZone.init(); flagship.features.carousel.init(); flagship.features.clickToVideo.init(); flagship.features.howtoPopup.init(); flagship.features.headline.init(); flagship.features.scrollVideo.init(); flagship.features.aiOverview.init(); flagship.features.faq.init(); flagship.features.colorsViewer.init(); flagship.features.colors.init(); flagship.features.arBanner.init(); flagship.features.accordion.init(); flagship.features.designSpec.init(); flagship.features.display.init(); flagship.features.proVisual.init(); flagship.features.kv.init(); flagship.features.compares.init(); }; return { init: init } })(); flagship.features.initialize.init(); });