frontend.min.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. var comFunct = {
  2. isDesktop: function() {
  3. return !/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)
  4. },
  5. isMobileDevice: function() {
  6. return navigator.userAgent.toLowerCase().indexOf("iphone") > -1 || navigator.userAgent.toLowerCase().indexOf("ipad") > -1 || navigator.userAgent.toLowerCase().indexOf("ipod") > -1 || navigator.userAgent.toLowerCase().indexOf("android") > -1 || navigator.userAgent.toLowerCase().indexOf("webos") > -1 || navigator.userAgent.toLowerCase().indexOf("blackberry") > -1
  7. },
  8. isMobileDeviceFake: function() {
  9. return comFunct.getViewport("width") < 979
  10. },
  11. getViewport: function(e) {
  12. var t, i;
  13. return "undefined" != typeof window.innerWidth ? (t = window.innerWidth, i = window.innerHeight) : "undefined" != typeof document.documentElement && "undefined" != typeof document.documentElement.clientWidth && 0 != document.documentElement.clientWidth ? (t = document.documentElement.clientWidth, i = document.documentElement.clientHeight) : (t = document.getElementsByTagName("body")[0].clientWidth, i = document.getElementsByTagName("body")[0].clientHeight), "width" == e ? t : i
  14. },
  15. log: function() {
  16. if (window.console) for (var e = 0; e < arguments.length; e++) console.log(arguments[e]);
  17. else window.console = {
  18. log: function() {}
  19. }
  20. },
  21. is_touch_device: function() {
  22. return "ontouchstart" in window || "onmsgesturechange" in window
  23. },
  24. getRelativepath: function() {
  25. var e = location.href,
  26. t = location.protocol + "//" + location.hostname,
  27. i = e.replace(t, "");
  28. return i
  29. }
  30. },
  31. testMobile, isMobile = {
  32. Android: function() {
  33. return navigator.userAgent.match(/Android/i)
  34. },
  35. BlackBerry: function() {
  36. return navigator.userAgent.match(/BlackBerry/i)
  37. },
  38. iOS: function() {
  39. return navigator.userAgent.match(/iPhone|iPad|iPod/i)
  40. },
  41. Opera: function() {
  42. return navigator.userAgent.match(/Opera Mini/i)
  43. },
  44. Windows: function() {
  45. return navigator.userAgent.match(/IEMobile/i)
  46. },
  47. any: function() {
  48. return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()
  49. }
  50. };
  51. (jQuery);
  52. var Dreamscapes = {
  53. isDev: !0,
  54. General: {
  55. log: function(e) {
  56. Dreamscapes.isDev && console.log(e)
  57. },
  58. runOnce: function(e) {
  59. var t;
  60. return function() {
  61. return e && (t = e(), e = null), t
  62. }
  63. },
  64. homeInitialLoading: !0,
  65. loadedSlides: []
  66. },
  67. Functions: {}
  68. };
  69. Dreamscapes.Timelines = function() {
  70. function e() {
  71. var e = new TimelineMax({
  72. paused: !0
  73. }),
  74. t = $(".home-loader"),
  75. i = $(".loader-subtitle"),
  76. n = $(".loader-cta-wrapper"),
  77. r = t.find(".loader-fact.fact-1"),
  78. o = t.find(".loader-fact.fact-2"),
  79. s = new SplitText(i, {
  80. type: "words,chars"
  81. }),
  82. a = $(".explore-path-wrapper"),
  83. l = $(".map-location-wrapper"),
  84. c = $(".map-container"),
  85. u = s.chars,
  86. d = $("#airplaneIcon"),
  87. h = $("#exploreDestinationPath"),
  88. f = ($(".main-menu-wrapper"), MorphSVGPlugin.pathDataToBezier(h, {
  89. offsetY: -94,
  90. offsetX: -4
  91. })),
  92. p = new SplitText(r, {
  93. type: "words,chars"
  94. }),
  95. m = new SplitText(o, {
  96. type: "words,chars"
  97. }),
  98. g = p.chars,
  99. v = m.chars;
  100. TweenMax.set(r, {
  101. perspective: 800
  102. }), TweenMax.set(o, {
  103. perspective: 800
  104. });
  105. var _ = 2.2;
  106. return e.add("firstFact").to(r, .6, {
  107. force3D: "auto",
  108. autoAlpha: 1
  109. }, "firstFact").staggerFrom(g, .5, {
  110. force3D: "auto",
  111. autoAlpha: 0,
  112. y: 60,
  113. rotationX: 160,
  114. ease: Back.easeOut,
  115. delay: 1.8
  116. }, .013, "firstFact").to(r, .3, {
  117. autoAlpha: 0,
  118. force3D: "auto",
  119. delay: _
  120. }).to(o, .3, {
  121. force3D: "auto",
  122. autoAlpha: 1
  123. }).staggerFrom(v, .5, {
  124. force3D: "auto",
  125. autoAlpha: 0,
  126. y: 60,
  127. rotationX: 160,
  128. ease: Back.easeOut
  129. }, .013).add("subtitleReveal", "+=1.2").staggerFrom(u, .5, {
  130. force3D: "auto",
  131. autoAlpha: 0,
  132. y: 60,
  133. rotationX: 160,
  134. ease: Back.easeOut
  135. }, .013, "subtitleReveal").to(n, 1, {
  136. autoAlpha: 1,
  137. force3D: "auto",
  138. y: "-=40",
  139. delay: 1.6,
  140. ease: Power3.easeOut
  141. }, "subtitleReveal").to(a, .4, {
  142. autoAlpha: 1,
  143. force3D: "auto",
  144. delay: 1.2,
  145. ease: Sine.easeInOut
  146. }, "subtitleReveal").to(c, 1.8, {
  147. scale: 1,
  148. delay: 1.2,
  149. force3D: "auto",
  150. ease: Power3.easeInOut
  151. }, "subtitleReveal").add("pinDrop", "-=1").staggerFromTo(l, 1, {
  152. opacity: 0,
  153. y: -60
  154. }, {
  155. opacity: 1,
  156. force3D: "auto",
  157. y: 0,
  158. ease: Elastic.easeOut.config(1.2, .5)
  159. }, .08, "pinDrop").to(d, 6.5, {
  160. bezier: {
  161. values: f,
  162. type: "cubic",
  163. force3D: "auto",
  164. autoRotate: !0
  165. },
  166. ease: Linear.easeNone,
  167. repeat: -1,
  168. repeatDelay: .8
  169. }, "subtitleReveal"), e
  170. }
  171. function t() {
  172. var e = new TimelineMax({
  173. paused: !0
  174. }),
  175. t = comFunct.getViewport("height"),
  176. i = comFunct.getViewport("width"),
  177. n = t / 2,
  178. r = i / 2,
  179. o = Math.sqrt(r * r + n * n),
  180. s = $(".menu-trigger"),
  181. a = $(".map-container"),
  182. l = s.find(".pin-wrapper"),
  183. c = s.find(".icon-close-menu"),
  184. u = $(".map-location-wrapper").not(".map-location-wrapper.active"),
  185. d = $(".main-menu-wrapper"),
  186. h = d.find("svg"),
  187. f = s.find(".icon-world"),
  188. p = $(".language-select-wrapper"),
  189. m = p.find("li");
  190. return e.add("open").to("#clipCircle", 1, {
  191. attr: {
  192. cx: r,
  193. cy: n,
  194. r: o
  195. },
  196. ease: Power2.easeInOut,
  197. force3D: "auto"
  198. }, "open").to(d, .55, {
  199. autoAlpha: 1,
  200. ease: Power2.easeIn,
  201. force3D: "auto"
  202. }, "open").to(a, 1.2, {
  203. scale: 1,
  204. ease: Sine.easeOut,
  205. force3D: "auto"
  206. }, "open", "+=0.4").add("iconChange").to(l, .4, {
  207. scale: .2,
  208. opacity: 0,
  209. ease: Back.easeInOut,
  210. force3D: "auto"
  211. }, "iconChange").to(f, .4, {
  212. scale: .2,
  213. opacity: 0,
  214. ease: Back.easeInOut,
  215. force3D: "auto"
  216. }, "iconChange").to(c, .4, {
  217. scale: 1,
  218. opacity: 1,
  219. ease: Back.easeInOut,
  220. force3D: "auto"
  221. }, "iconChange").add("pinDrop", "-=0.4").staggerFromTo(u, .4, {
  222. opacity: 0,
  223. y: -45
  224. }, {
  225. opacity: 1,
  226. y: 0,
  227. ease: Back.easeInOut,
  228. onComplete: function() {
  229. h.css("display", "none")
  230. },
  231. force3D: "auto"
  232. }, .05, "pinDrop").fromTo(p, .4, {
  233. autoAlpha: 0,
  234. y: 20
  235. }, {
  236. autoAlpha: 1,
  237. y: 0,
  238. ease: Power4.easeInOut,
  239. force3D: "auto"
  240. }, "pinDrop").staggerFromTo(m, .4, {
  241. opacity: 0,
  242. y: -15
  243. }, {
  244. opacity: 1,
  245. y: 0,
  246. force3D: "auto",
  247. ease: Back.easeInOut
  248. }, .05, "pinDrop"), e
  249. }
  250. function i(e, t) {
  251. var i = $(".slide"),
  252. n = i.eq(e),
  253. r = n.find(".flight-zone-wrapper"),
  254. o = n.find(".airplaneIcon"),
  255. s = n.find(".flightZonePath"),
  256. a = MorphSVGPlugin.pathDataToBezier(s, {
  257. offsetY: -9
  258. });
  259. return t.add("flight", "+=8.2").to(r, .6, {
  260. autoAlpha: 1,
  261. ease: Sine.easeInOut,
  262. force3D: "auto"
  263. }, "flight").to(o, 19, {
  264. bezier: {
  265. values: a,
  266. type: "cubic",
  267. autoRotate: !0
  268. },
  269. ease: Linear.easeNone,
  270. repeat: -1,
  271. force3D: "auto"
  272. }, "flight", "+=0.2").to(r, .4, {
  273. autoAlpha: 0,
  274. ease: Sine.easeInOut,
  275. force3D: "auto"
  276. }), t
  277. }
  278. function n() {
  279. }
  280. return {
  281. loaderTimeline: e,
  282. menuTimeline: t,
  283. airplaneTimeline: i,
  284. nextDestinationTimeline: n
  285. }
  286. }, $.js = function(e) {
  287. return $("[data-js=" + e + "]")
  288. }, Dreamscapes.Functions = function() {
  289. function e() {
  290. }
  291. function t() {
  292. }
  293. function i() {
  294. var e = comFunct.getViewport("width"),
  295. t = $("body"),
  296. i = Dreamscapes.Timelines(),
  297. n = $(".menu-trigger"),
  298. r = $(".main-menu-wrapper"),
  299. o = $(".main-menu-trigger-wrapper"),
  300. s = r.find("svg"),
  301. a = $(".map-location-wrapper").not(".map-location-wrapper.active"),
  302. l = ($(".language-select").find("a"), i.menuTimeline()),
  303. c = $(".video-wrapper");
  304. n.on("click", function() {
  305. s.css("display", "block"), "closed" == $(this).attr("data-toggle") ? ($(this).attr("data-toggle", "opened"), n.addClass("is-opened"), r.find(".main-menu").removeClass("intro-scene"), e > 767 && TweenMax.to(o, .8, {
  306. top: "15%",
  307. ease: Back.easeInOut.config(1),
  308. force3D: "auto"
  309. }), l.play(), t.addClass("overflow"), setTimeout(function() {
  310. c.addClass("menu-is-opened")
  311. }, 800)) : $(this).attr("data-toggle", "opened") && ($(this).attr("data-toggle", "closed"), n.removeClass("is-opened"), l.reverse(), t.removeClass("overflow"), c.removeClass("menu-is-opened"), $("body").hasClass("destination-page") && e > 767 ? TweenMax.to(o, .8, {
  312. top: "85%",
  313. delay: .4,
  314. ease: Back.easeInOut.config(1),
  315. force3D: "auto"
  316. }) : e > 767 && TweenMax.to(o, .8, {
  317. top: "85%",
  318. delay: .6,
  319. ease: Back.easeInOut.config(1),
  320. force3D: "auto"
  321. }))
  322. }), a.on("click", function() {
  323. n.attr("data-toggle", "closed"), l.reverse(), document.body.scrollTop = 0
  324. })
  325. }
  326. function n() {
  327. var e = $(".navigation-bar-wrapper");
  328. TweenMax.to(e, .1, {
  329. y: "-60px",
  330. force3D: "auto",
  331. ease: Sine.easeIn
  332. })
  333. }
  334. function r() {}
  335. function o() {}
  336. function s() {}
  337. function a() {}
  338. function l() {
  339. var e = comFunct.getViewport("width");
  340. if (e > 1024) {
  341. var t = $(".button");
  342. t.on("mouseenter", function() {
  343. TweenMax.to($(this).find(".button-wrapper"), 1, {
  344. scale: 1.2,
  345. force3D: "auto",
  346. ease: Elastic.easeOut
  347. })
  348. }), t.on("mouseleave", function() {
  349. TweenMax.to($(this).find(".button-wrapper"), 1, {
  350. scale: 1,
  351. force3D: "auto",
  352. ease: Elastic.easeOut
  353. })
  354. })
  355. }
  356. }
  357. //function c() {}
  358. function u(e, t) {
  359. var i = Dreamscapes.Timelines();
  360. t.clear();
  361. var n = i.airplaneTimeline(e, t);
  362. n.play()
  363. }
  364. //function d() {}
  365. function h(e) {
  366. }
  367. function f(e, t) {
  368. }
  369. function p(e) {
  370. }
  371. //function m() {}
  372. //function g() {}
  373. //function v() {}
  374. function _(e) {
  375. }
  376. //function y() {}
  377. //function b() {}
  378. //function T() {}
  379. //function x() {}
  380. function C(e, t) {}
  381. function P(e, t) {
  382. for (var i in t) e = e.replace("{" + i + "}", encodeURIComponent(t[i]));
  383. return e
  384. }
  385. var D = {},
  386. O = 0,
  387. M = !1,
  388. R = 0;
  389. Dreamscapes.General.log;
  390. return {
  391. cookiePlugin: t,
  392. mainMenu: i,
  393. //homeLoader: e,
  394. slideDown: n,
  395. //slideUp: r,
  396. //destinationParallaxScroll: o,
  397. scrollEvent: a,
  398. buttonHovers: l,
  399. //gsapScrollTo: d,
  400. callAirplane: u,
  401. setLayerDimensions: h,
  402. callTimeline: f,
  403. fullPagePlugin: p,
  404. //scrollMagicAnimation: y,
  405. //barbaInit: x,
  406. destinationIntroTimeline: _,
  407. //slickSliderPlugin: m,
  408. //inpageShare: g,
  409. //globalShare: v,
  410. lazyLoadVideos: C,
  411. //lazyLoadVideosHomepage: S,
  412. //countToPlugin: w,
  413. //destinationHeaderElements: b,
  414. //countToInitial: T,
  415. //destinationArc: c,
  416. //ajaxIframeLoad: k,
  417. //socialShare: A,
  418. //makeUrl: P
  419. }
  420. }, $(document).ready(function() {
  421. var e = $(".main-menu.intro-scene");
  422. setTimeout(function() {
  423. TweenMax.fromTo(e, 1.8, {
  424. opacity: 0,
  425. y: 40
  426. }, {
  427. opacity: 1,
  428. y: 0,
  429. ease: Power4.easeInOut
  430. })
  431. }, 200)
  432. }), $(function() {
  433. window.lazySizesConfig = window.lazySizesConfig || {}, lazySizesConfig.preloadAfterLoad = !0;
  434. var e = Dreamscapes.Functions(),
  435. t = !0;
  436. "homepage" == $(".barba-container").data("namespace") ? (e.homeLoader(), e.fullPagePlugin(t)) : e.lazyLoadVideos(), e.cookiePlugin(), e.mainMenu(), e.scrollEvent(), e.buttonHovers() || e.destinationIntroTimeline(t)
  437. });