Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.08 KB | None | 0 0
  1. // Page preload ------------------
  2. $(window).load(function() {
  3. "use strict";
  4. $(".loader").fadeOut(500, function() {
  5. $("#main").animate({
  6. opacity: "1"
  7. }, 500);
  8. });
  9. });
  10. // all functions ------------------
  11. function initLambert() {
  12. "use strict";
  13. if ($("header").hasClass("flat-header")) $('<div clas="height-emulator"></div>').prependTo("#wrapper").css({
  14. height: $("header").outerHeight(true)
  15. });
  16. function a() {
  17. $(".hero-title").css({
  18. "margin-top": -1 * $(".hero-title").height() / 2 + "px"
  19. });
  20. $(".carousel-link-holder").css({
  21. "margin-top": -1 * $(".carousel-link-holder").height() / 2 + "px"
  22. });
  23. $(".full-height").css({
  24. height: $(window).outerHeight(true)
  25. });
  26. }
  27. a();
  28. // magnificPopup------------------
  29. $(".image-popup").magnificPopup({
  30. type: "image",
  31. closeOnContentClick: false,
  32. removalDelay: 600,
  33. mainClass: "my-mfp-slide-bottom",
  34. image: {
  35. verticalFit: false
  36. }
  37. });
  38. $(".popup-youtube, .popup-vimeo , .show-map").magnificPopup({
  39. disableOn: 700,
  40. type: "iframe",
  41. removalDelay: 600,
  42. mainClass: "my-mfp-slide-bottom"
  43. });
  44. $(".popup-gallery").magnificPopup({
  45. delegate: "a",
  46. type: "image",
  47. fixedContentPos: true,
  48. fixedBgPos: true,
  49. tLoading: "Loading image #%curr%...",
  50. removalDelay: 600,
  51. closeBtnInside: true,
  52. mainClass: "my-mfp-slide-bottom",
  53. gallery: {
  54. enabled: true,
  55. navigateByImgClick: true,
  56. preload: [ 0, 1 ]
  57. },
  58. image: {
  59. tError: '<a href="%url%">The image #%curr%</a> could not be loaded.'
  60. }
  61. });
  62. $(".popup-with-move-anim").magnificPopup({
  63. type: "ajax",
  64. alignTop: false,
  65. overflowY: "scroll",
  66. fixedContentPos: true,
  67. fixedBgPos: true,
  68. closeBtnInside: false,
  69. midClick: true,
  70. modal: true,
  71. removalDelay: 600,
  72. mainClass: "my-mfp-slide-bottom"
  73. });
  74. $(document).on("click", ".popup-modal-dismiss", function(a) {
  75. a.preventDefault();
  76. $.magnificPopup.close();
  77. });
  78. // owl carousel ------------------
  79. var b = $(".fullscreen-slider");
  80. b.owlCarousel({
  81. navigation: false,
  82. slideSpeed: 500,
  83. singleItem: true,
  84. pagination: true
  85. });
  86. $(".fullscreen-slider-holder a.next-slide").on("click", function() {
  87. $(this).closest(".fullscreen-slider-holder").find(b).trigger("owl.next");
  88. });
  89. $(".fullscreen-slider-holder a.prev-slide").on("click", function() {
  90. $(this).closest(".fullscreen-slider-holder").find(b).trigger("owl.prev");
  91. });
  92. var c = $(".testimonials-slider");
  93. c.owlCarousel({
  94. navigation: false,
  95. slideSpeed: 500,
  96. singleItem: true,
  97. pagination: false
  98. });
  99. $(".testimonials-holder a.next-slide").on("click", function() {
  100. $(this).closest(".testimonials-holder").find(c).trigger("owl.next");
  101. });
  102. $(".testimonials-holder a.prev-slide").on("click", function() {
  103. $(this).closest(".testimonials-holder").find(c).trigger("owl.prev");
  104. });
  105. $(".slideshow-container").superslides({
  106. animation: "fade",
  107. play: 6000
  108. });
  109. var d = $(".fullheight-carousel");
  110. d.owlCarousel({
  111. navigation: false,
  112. slideSpeed: 500,
  113. items: 4,
  114. pagination: false,
  115. autoHeight: true
  116. });
  117. $(".fullheight-carousel-holder a.next-slide").on("click", function() {
  118. $(this).closest(".fullheight-carousel-holder").find(d).trigger("owl.next");
  119. });
  120. $(".fullheight-carousel-holder a.prev-slide").on("click", function() {
  121. $(this).closest(".fullheight-carousel-holder").find(d).trigger("owl.prev");
  122. });
  123. $(".carousel-link-holder").hover(function() {
  124. $(this).parent(".carousel-item").addClass("vis-decor");
  125. }, function() {
  126. $(this).parent(".carousel-item").removeClass("vis-decor");
  127. });
  128. var e = $(".single-slider");
  129. e.owlCarousel({
  130. singleItem: true,
  131. slideSpeed: 1000,
  132. navigation: false,
  133. pagination: true,
  134. responsiveRefreshRate: 200,
  135. autoHeight: true
  136. });
  137. $(".single-slider-holder a.next-slide").on("click", function() {
  138. $(this).closest(".single-slider-holder").find(e).trigger("owl.next");
  139. });
  140. $(".single-slider-holder a.prev-slide").on("click", function() {
  141. $(this).closest(".single-slider-holder").find(e).trigger("owl.prev");
  142. });
  143. var f = $(".product-slider");
  144. f.owlCarousel({
  145. navigation: false,
  146. slideSpeed: 300,
  147. paginationSpeed: 400,
  148. singleItem: true,
  149. afterInit: g
  150. });
  151. $(".product-image a.next-slide").on("click", function() {
  152. $(this).closest(".product-image").find(f).trigger("owl.next");
  153. });
  154. $(".product-image a.prev-slide").on("click", function() {
  155. $(this).closest(".product-image").find(f).trigger("owl.prev");
  156. });
  157. function g() {
  158. $(".owl-controls .owl-page").append('<a class="item-link" href="#"/>');
  159. var a = $(".owl-controls .item-link");
  160. $.each(this.owl.userItems, function(b) {
  161. $(a[b]).css({
  162. background: "url(" + $(this).find("img").attr("src") + ") center center no-repeat",
  163. "-webkit-background-size": "cover",
  164. "-moz-background-size": "cover",
  165. "-o-background-size": "cover",
  166. "background-size": "cover"
  167. }).click(function(a) {
  168. a.preventDefault();
  169. owl.trigger("owl.goTo", b);
  170. });
  171. });
  172. }
  173. $("#twitter-feed").tweet({
  174. username: "katokli3mmm",
  175. join_text: "auto",
  176. avatar_size: 0,
  177. count: 4
  178. });
  179. $("#twitter-feed").find("ul").addClass("twitter-slider");
  180. $("#twitter-feed").find("ul li").addClass("item");
  181. var h = $(".twitter-slider");
  182. h.owlCarousel({
  183. navigation: false,
  184. slideSpeed: 500,
  185. pagination: false,
  186. autoHeight: false,
  187. singleItem: true
  188. });
  189. $(".twitter-holder .next-slide").on("click", function() {
  190. h.trigger("owl.next");
  191. });
  192. $(".twitter-holder .prev-slide").on("click", function() {
  193. h.trigger("owl.prev");
  194. });
  195. // tabs------------------
  196. $(".tabs-menu a").on("click", function(a) {
  197. a.preventDefault();
  198. $(this).parent().addClass("current");
  199. $(this).parent().siblings().removeClass("current");
  200. var b = $(this).attr("href");
  201. $(".tab-content").not(b).css("display", "none");
  202. $(b).fadeIn();
  203. });
  204. // one page nav ------------------
  205. $(".scroll-nav ul").singlePageNav({
  206. filter: ":not(.external)",
  207. updateHash: false,
  208. offset: 90,
  209. threshold: 120,
  210. speed: 1200,
  211. currentClass: "act-link"
  212. });
  213. // youtube video------------------
  214. var i = $(".background-video").data("vid");
  215. var j = $(".background-video").data("mv");
  216. $(".background-video").YTPlayer({
  217. fitToBackground: true,
  218. videoId: i,
  219. pauseOnScroll: true,
  220. mute: j,
  221. callback: function() {
  222. var a = $(".background-video").data("ytPlayer").player;
  223. }
  224. });
  225. // isotope ------------------
  226. function k() {
  227. if ($(".gallery-items").length) {
  228. var a = $(".gallery-items").isotope({
  229. singleMode: true,
  230. columnWidth: ".grid-sizer, .grid-sizer-second, .grid-sizer-three",
  231. itemSelector: ".gallery-item, .gallery-item-second, .gallery-item-three"
  232. });
  233. a.imagesLoaded(function() {
  234. a.isotope("layout");
  235. });
  236. $(".gallery-filters").on("click", "a.gallery-filter", function(b) {
  237. b.preventDefault();
  238. var c = $(this).attr("data-filter");
  239. a.isotope({
  240. filter: c
  241. });
  242. $(".gallery-filters a.gallery-filter").removeClass("gallery-filter-active");
  243. $(this).addClass("gallery-filter-active");
  244. return false;
  245. });
  246. }
  247. }
  248. k();
  249. $(window).load(function() {
  250. k();
  251. });
  252. // scroll------------------
  253. $(".to-top").on("click", function() {
  254. $("html, body").animate({
  255. scrollTop: 0
  256. }, 1200, "easeInOutExpo");
  257. });
  258. $(".custom-scroll-link").on("click", function() {
  259. var a = 74;
  260. if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") || location.hostname == this.hostname) {
  261. var b = $(this.hash);
  262. b = b.length ? b : $("[name=" + this.hash.slice(1) + "]");
  263. if (b.length) {
  264. $("html,body").animate({
  265. scrollTop: b.offset().top - a
  266. }, {
  267. queue: false,
  268. duration: 1200,
  269. easing: "easeInOutExpo"
  270. });
  271. return false;
  272. }
  273. }
  274. });
  275. // map ------------------
  276. $("#map-canvas").gmap3({
  277. action: "init",
  278. marker: {
  279. // markers and locations------------------
  280. values: [ {
  281. latLng: [ 40.7143528, -74.0059731 ],
  282. data: "Lambert - New York City",
  283. options: {
  284. icon: "images/marker.png"
  285. }
  286. }, {
  287. latLng: [ 40.7168183, -73.9973402 ],
  288. data: "Lambert - Washington",
  289. options: {
  290. icon: "images/marker.png"
  291. }
  292. }, {
  293. latLng: [ 40.73334016, -73.99330616 ],
  294. data: "Lambert - Florida",
  295. options: {
  296. icon: "images/marker.png"
  297. }
  298. } ],
  299. options: {
  300. draggable: false
  301. },
  302. events: {
  303. mouseover: function(a, b, c) {
  304. var d = $(this).gmap3("get"), e = $(this).gmap3({
  305. get: {
  306. name: "infowindow"
  307. }
  308. });
  309. if (e) {
  310. e.open(d, a);
  311. e.setContent(c.data);
  312. } else $(this).gmap3({
  313. infowindow: {
  314. anchor: a,
  315. options: {
  316. content: c.data
  317. }
  318. }
  319. });
  320. },
  321. mouseout: function() {
  322. var a = $(this).gmap3({
  323. get: {
  324. name: "infowindow"
  325. }
  326. });
  327. if (a) a.close();
  328. }
  329. }
  330. },
  331. map: {
  332. options: {
  333. zoom: 14,
  334. zoomControl: true,
  335. mapTypeControl: true,
  336. scaleControl: true,
  337. scrollwheel: false,
  338. streetViewControl: true,
  339. draggable: true,
  340. styles: [ {
  341. featureType: "all",
  342. elementType: "labels.text",
  343. stylers: [ {
  344. weight: "0.04"
  345. }, {
  346. visibility: "simplified"
  347. } ]
  348. }, {
  349. featureType: "administrative.locality",
  350. elementType: "all",
  351. stylers: [ {
  352. hue: "#C59D5F"
  353. }, {
  354. saturation: 7
  355. }, {
  356. lightness: 19
  357. }, {
  358. visibility: "on"
  359. } ]
  360. }, {
  361. featureType: "administrative.locality",
  362. elementType: "labels.text",
  363. stylers: [ {
  364. hue: "#ffde00"
  365. } ]
  366. }, {
  367. featureType: "landscape",
  368. elementType: "all",
  369. stylers: [ {
  370. hue: "#ffffff"
  371. }, {
  372. saturation: -100
  373. }, {
  374. lightness: 100
  375. }, {
  376. visibility: "simplified"
  377. } ]
  378. }, {
  379. featureType: "poi",
  380. elementType: "all",
  381. stylers: [ {
  382. hue: "#C59D5F"
  383. }, {
  384. saturation: -100
  385. }, {
  386. lightness: 100
  387. }, {
  388. visibility: "off"
  389. } ]
  390. }, {
  391. featureType: "road",
  392. elementType: "geometry",
  393. stylers: [ {
  394. hue: "#C59D5F"
  395. }, {
  396. saturation: -93
  397. }, {
  398. lightness: 31
  399. }, {
  400. visibility: "simplified"
  401. } ]
  402. }, {
  403. featureType: "road",
  404. elementType: "labels",
  405. stylers: [ {
  406. hue: "#C59D5F"
  407. }, {
  408. saturation: -93
  409. }, {
  410. lightness: 31
  411. }, {
  412. visibility: "on"
  413. } ]
  414. }, {
  415. featureType: "road.arterial",
  416. elementType: "labels",
  417. stylers: [ {
  418. hue: "#C59D5F"
  419. }, {
  420. saturation: -93
  421. }, {
  422. lightness: -2
  423. }, {
  424. visibility: "simplified"
  425. } ]
  426. }, {
  427. featureType: "road.local",
  428. elementType: "geometry",
  429. stylers: [ {
  430. hue: "#C59D5F"
  431. }, {
  432. saturation: -90
  433. }, {
  434. lightness: -8
  435. }, {
  436. visibility: "simplified"
  437. } ]
  438. }, {
  439. featureType: "transit",
  440. elementType: "all",
  441. stylers: [ {
  442. hue: "#C59D5F"
  443. }, {
  444. saturation: 10
  445. }, {
  446. lightness: 69
  447. }, {
  448. visibility: "on"
  449. } ]
  450. }, {
  451. featureType: "water",
  452. elementType: "all",
  453. stylers: [ {
  454. hue: "#C59D5F"
  455. }, {
  456. saturation: -78
  457. }, {
  458. lightness: 67
  459. }, {
  460. visibility: "simplified"
  461. } ]
  462. } ]
  463. }
  464. }
  465. });
  466. // contact form------------------
  467. $("#contactform").submit(function() {
  468. var a = $(this).attr("action");
  469. $("#message2").slideUp(750, function() {
  470. $("#message2").hide();
  471. $("#submit").attr("disabled", "disabled");
  472. $.post(a, {
  473. name: $("#contactform .name").val(),
  474. email: $("#contactform .email").val(),
  475. phone: $("#contactform .phone").val(),
  476. comments: $("#contactform .comments").val()
  477. }, function(a) {
  478. document.getElementById("message2").innerHTML = a;
  479. $("#message2").slideDown("slow");
  480. $("#submit").removeAttr("disabled");
  481. if (null != a.match("success")) $("#contactform").slideDown("slow");
  482. });
  483. });
  484. return false;
  485. });
  486. $("#contactform input, #contactform textarea").keyup(function() {
  487. $("#message2").slideUp(1500);
  488. });
  489. // reservation form------------------
  490. $("#reservation-form").submit(function() {
  491. var a = $(this).attr("action");
  492.  
  493. $("#message").slideUp(750, function() {
  494. $("#message").hide();
  495. $("#submit-res").attr("disabled", "disabled");
  496. $.post(a, {
  497. name: $("#name").val(),
  498. email: $("#email").val(),
  499. phone: $("#phone").val(),
  500. resdate: $("#resdate").val(),
  501. restime: $("#restime").val(),
  502. resrest: $("#resrest").val(),
  503. numperson: $("#numperson").val(),
  504. comments: $("#comments").val()
  505. }, function(a) {
  506. document.getElementById("message").innerHTML = a;
  507. $("#message").slideDown("slow");
  508. $("#submit-res").removeAttr("disabled");
  509. if (null != a.match("success")) $("#contactform").slideDown("slow");
  510. });
  511. });
  512. return false;
  513. });
  514. $("#reservation-form input, #reservation-form textarea ").keyup(function() {
  515. $("#message").slideUp(1500);
  516. });
  517. $("#resdate").ionDatePicker();
  518. // subscribe form------------------
  519. $("#subscribe").ajaxChimp({
  520. language: "eng",
  521. url: "http://kwst.us9.list-manage1.com/subscribe/post?u=992ebe1f14864e841317ca145&id=163340d9c8"
  522. });
  523. $.ajaxChimp.translations.eng = {
  524. submit: "Submitting...",
  525. 0: '<i class="fa fa-check"></i> We will be in touch soon!',
  526. 1: '<i class="fa fa-warning"></i> You must enter a valid e-mail address.',
  527. 2: '<i class="fa fa-warning"></i> E-mail address is not valid.',
  528. 3: '<i class="fa fa-warning"></i> E-mail address is not valid.',
  529. 4: '<i class="fa fa-warning"></i> E-mail address is not valid.',
  530. 5: '<i class="fa fa-warning"></i> E-mail address is not valid.'
  531. };
  532. $(window).scroll(function() {
  533. if ($(this).scrollTop() > 150) {
  534. $("header").addClass("sticky");
  535. setTimeout(function() {
  536. $(".logo-holder").addClass("logo-sticky");
  537. }, 350);
  538. } else {
  539. $("header").removeClass("sticky");
  540. setTimeout(function() {
  541. $(".logo-holder").removeClass("logo-sticky");
  542. }, 350);
  543. }
  544. });
  545. // video ------------------
  546. $(".video-container").css("width", $(window).width() + "px");
  547. $(".video-container ").css("height", parseInt(720 / 1280 * $(window).width()) + "px");
  548. if ($(".video-container").height() < $(window).height()) {
  549. $(".video-container ").css("height", $(window).height() + "px");
  550. $(".video-container").css("width", parseInt(1280 / 720 * $(window).height()) + "px");
  551. }
  552. $(".video-holder").height($(".media-container").height());
  553. if ($(window).width() > 1024) {
  554. if ($(".video-holder").size() > 0) if (($(".media-container").height() + 150) / 9 * 16 > $(".media-container").width()) {
  555. $("iframe ").height($(".media-container").height() + 150).width(($(".media-container").height() + 150) / 9 * 16);
  556. $("iframe").css({
  557. "margin-left": -1 * $("iframe").width() / 2 + "px",
  558. top: "-75px",
  559. "margin-top": "0px"
  560. });
  561. } else {
  562. $("iframe").width($(window).width()).height($(window).width() / 16 * 9);
  563. $("iframe ").css({
  564. "margin-left": -1 * $("iframe").width() / 2 + "px",
  565. "margin-top": -1 * $("iframe").height() / 2 + "px",
  566. top: "50%"
  567. });
  568. }
  569. } else if ($(window).width() < 760) {
  570. $(".video-holder").height($(".media-container").height());
  571. $("iframe").height($(".media-container").height());
  572. } else {
  573. $(".video-holder").height($(".media-container").height());
  574. $("iframe").height($(".media-container").height());
  575. }
  576. var l = $(".vimeo-player")[0], m = $f(l), n = $(".status");
  577. m.addEvent("ready", function() {
  578. m.api("setVolume", 0);
  579. });
  580. $(".triangle-decor").append('<svg x="0px" y="0px" width="100%" height="15px"><defs><pattern id="bottom-divider" x="0" y="0" width="15" height="15" patternUnits="userSpaceOnUse"><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M7.504-0.008l7.504,7.504L7.504,15L0,7.496L7.504-0.008z"></path></pattern></defs><rect x="0" y="0" width="100%" height="15" fill="url(#bottom-divider)"></rect></svg>');
  581. $(".header-inner .container").append('<div class="nav-button-holder"><div class="nav-button vis-m"><span></span><span></span><span></span></div></div>');
  582. $(".hero-content").append('<div class="hero-line"></div>');
  583. // navigation------------------
  584. var o = $(".nav-button"), p = $(".nav-holder"), q = $(".nav-holder ,.nav-button ");
  585. function r() {
  586. o.removeClass("vis-m");
  587. p.slideDown(500);
  588. }
  589. function s() {
  590. o.addClass("vis-m");
  591. p.slideUp(500);
  592. }
  593. o.on("click", function() {
  594. if ($(this).hasClass("vis-m")) r(); else s();
  595. });
  596. $(window).resize(function() {
  597. a();
  598. });
  599. $(".scroll-nav a").on("click",function(){
  600. var ww = $(window).width();
  601. if (ww < 1036) {
  602. s();
  603. }
  604. });
  605. }
  606.  
  607. function initparallax() {
  608. var a = {
  609. Android: function() {
  610. return navigator.userAgent.match(/Android/i);
  611. },
  612. BlackBerry: function() {
  613. return navigator.userAgent.match(/BlackBerry/i);
  614. },
  615. iOS: function() {
  616. return navigator.userAgent.match(/iPhone|iPad|iPod/i);
  617. },
  618. Opera: function() {
  619. return navigator.userAgent.match(/Opera Mini/i);
  620. },
  621. Windows: function() {
  622. return navigator.userAgent.match(/IEMobile/i);
  623. },
  624. any: function() {
  625. return a.Android() || a.BlackBerry() || a.iOS() || a.Opera() || a.Windows();
  626. }
  627. };
  628. trueMobile = a.any();
  629. if (null == trueMobile) {
  630. var b = $("#main");
  631. b.find("[data-top-bottom]").length > 0 && b.waitForImages(function() {
  632. s = skrollr.init();
  633. s.destroy();
  634. skrollr.init({
  635. forceHeight: !1,
  636. easing: "outCubic",
  637. mobileCheck: function() {
  638. return !1;
  639. }
  640. });
  641. });
  642. }
  643. if (trueMobile) { $(".video-container video , .video-holder iframe , .background-video").remove();}
  644. }
  645. $(document).ready(function() {
  646. initLambert();
  647. initparallax();
  648. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement