1const defaults = { sortOrder: "desc" }; 2const hoverIn = function (e) { 3 $(e.currentTarget).find(".dropdown-menu").addClass("dropdown-show"); 4}; 5const hoverOut = function (e) { 6 $(e.currentTarget).find(".dropdown-menu").removeClass("dropdown-show"); 7}; 8const bootstrapDropdowns = function () { 9 let $toggles = $(".dropdown"); 10 $toggles.each((idx, el) => { 11 $(el).hover(hoverIn, hoverOut); 12 }); 13}; 14const bootstrapModals = function () { 15 $(document).on("click", ".modal-open", (e) => { 16 let wrapperId = $(e.currentTarget).data("launch-id"); 17 let wrapper = $(`#${wrapperId}`); 18 let content = wrapper.find("div.content"); 19 let iframes = $("IFRAME[data-src]", content); 20 if (iframes && iframes.length) { 21 for (let i = 0; i < iframes.length; i++) { 22 let $el = $(iframes[i]); 23 $el.prop("src", $el.data("src")); 24 $el.removeData("src"); 25 } 26 } 27 let classes = wrapper.find(".css-classes").data("css-classes"); 28 let classList = []; 29 if (classes && classes.length) { 30 classList = classes.split(","); 31 } 32 var modal = new tingle.modal({ 33 footer: !!wrapper.find(".include-footer").data("include-footer"), 34 stickyFooter: !!wrapper.find(".include-footer").data("sticky-footer"), 35 closeMethods: ["overlay", "button", "escape"], 36 closeLabel: 37 wrapper.find(".include-footer").data("close-label") || "Close", 38 cssClass: classList || "", 39 beforeClose: () => { 40 content.detach(); 41 wrapper.append(content); 42 return true; 43 }, 44 }); 45 content.detach(); 46 modal.setContent(content[0]); 47 let label = wrapper.find(".footer-button-label").data("footer-label"); 48 if (label) { 49 modal.addFooterBtn(label, "tingle-btn tingle-btn--primary", function () { 50 modal.close(); 51 }); 52 } 53 modal.open(); 54 }); 55}; 56const bootstrapSlider = function () { 57 $(".js_slider").each((idx, slider) => { 58 if (slider) { 59 $(slider).lory({}); 60 } 61 }); 62}; 63const bootstrapSorts = function () { 64 if (window.location.pathname.includes("events")) { 65 $(".sort-button").on("click", (el) => { 66 let sortBy = $(el.currentTarget).data("sort-by"); 67 let $wrapper = $(".current-events-list-container"); 68 let $nodes = $wrapper.children(".box"); 69 let htmlOut = ""; 70 let sortOrder = defaults.sortOrder; 71 let sorted = $nodes.sort((a, b) => { 72 if (sortBy === "eventDate") { 73 if (sortOrder === "asc") { 74 return moment($(a).data(sortBy)).isAfter($(b).data(sortBy)); 75 } else { 76 return moment($(a).data(sortBy)).isBefore($(b).data(sortBy)); 77 } 78 } 79 if (sortBy === "eventTitle") { 80 if (sortOrder === "asc") { 81 return $(a).data(sortBy) > $(b).data(sortBy); 82 } else { 83 return $(a).data(sortBy) < $(b).data(sortBy); 84 } 85 } 86 }); 87 if (sortOrder === "asc") { 88 defaults.sortOrder = "desc"; 89 } else { 90 defaults.sortOrder = "asc"; 91 } 92 sorted.each((idx, evt) => { 93 htmlOut += evt.outerHTML; 94 }); 95 $wrapper.html(htmlOut); 96 }); 97 } 98}; 99const toggleNav = function (input, mode = "toggle") { 100 let $target = $(input); 101 let children = $target.find(">UL"); 102 let $link = $target.find(">A"); 103 let show = 104 (mode === "toggle" && children.hasClass("hide")) || mode === "show"; 105 if (children.length > 0) { 106 if (show) { 107 children.removeClass("hide"); 108 $link.addClass("submenu-indicator-minus"); 109 } else { 110 children.addClass("hide"); 111 $link.removeClass("submenu-indicator-minus"); 112 } 113 } 114 if (show) { 115 let parent = $target.parent().parent(); 116 if (parent && parent.length) { 117 toggleNav(parent, "show"); 118 } 119 $target.addClass("open"); 120 } else { 121 $target.removeClass("open"); 122 } 123}; 124const bootstrapNav = function () { 125 $(".tree-nav").on("click", ".tree-nav-item", function (e) { 126 let target = e.target; 127 if (target.href && !target.href.match(/#$/)) { 128 return; 129 } 130 e.preventDefault(); 131 e.stopPropagation(); 132 toggleNav(e.currentTarget); 133 }); 134}; 135const bootstrapScrollSpy = function () { 136 $(window).resize(scrollHandler); 137 $(window).scroll(scrollHandler); 138 function scrollHandler() { 139 let $class = "sticky"; 140 let $el = $(".toc-container"); 141 let $watch = $(".offset-watch"); 142 if (!$watch.length) { 143 return; 144 } 145 let scrollTop = $(window).scrollTop(); 146 let elementOffset = $watch.offset().top; 147 let distance = elementOffset - scrollTop; 148 let $mainContentHeaders = $(".main-content").find(":header:visible"); 149 let opts = { 150 height: "100vh", 151 width: $el.outerWidth(), 152 left: $el.offset().left, 153 }; 154 for (var i = 0; i <= $mainContentHeaders.length - 1; i++) { 155 if ($($mainContentHeaders[i]).attr("id")) { 156 var $mainContentHeadersEl = $(`#${$mainContentHeaders[i].id}`); 157 var hTop = $mainContentHeadersEl.offset().top; 158 if (hTop - scrollTop >= 0) { 159 $mainContentHeaders.each((i, a) => { 160 if ($(a).attr("id")) { 161 $("#TableOfContents") 162 .find(`a[href$=${a.id}]`) 163 .removeClass("active"); 164 } 165 }); 166 $("#TableOfContents") 167 .find(`a[href$=${$mainContentHeaders[i].id}]`) 168 .addClass("active"); 169 break; 170 } 171 } else { 172 break; 173 } 174 } 175 if (distance <= 0) { 176 $el.css(opts); 177 $el.addClass($class); 178 } else if (distance >= 0) { 179 $el.removeClass($class); 180 } 181 } 182 scrollHandler(); 183}; 184const bootstrapImgZoom = function () { 185 let features = Features.of(document.body.style); 186 let image = document.querySelector(".zoom__image"); 187 if (image) { 188 image.addEventListener( 189 "click", 190 new ZoomListener((dom) => { 191 let zoom = new Zoom(dom, features); 192 zoom.expand(); 193 setTimeout(() => { 194 zoom.destroy(); 195 }, 5000); 196 }) 197 ); 198 } 199}; 200const bootstrapApp = function () { 201 bootstrapNav(); 202 bootstrapDropdowns(); 203 bootstrapModals(); 204 bootstrapSorts();
205 bootstrapSlider(); 206 bootstrapScrollSpy(); 207}; 208const formatTimePeriod = function () { 209 $(".format-datetime").each(function (index, item) { 210 const element = $(item); 211 const parts = element.data("start").split(" "); 212 const dateFormat = element.data("format") || "MMM D, YYYY"; 213 const startDate = `${parts[0]}T${parts[1]}${parts[2]}`; 214 const startTime = moment(startDate); 215 const offset = parts[2]; 216 const timezone = moment.tz 217 .names() 218 .find((x) => offset === startTime.tz(x).format("ZZ")); 219 const date1 = startTime.tz(timezone).format(dateFormat); 220 const time1 = startTime.tz(timezone).format("h:mm a"); 221 const endDate = element.data("end"); 222 if (!endDate) { 223 element.find("span").html(date1); 224 } else { 225 const endTime = moment(endDate); 226 const date2 = endTime.tz(timezone).format(dateFormat); 227 const time2 = endTime.tz(timezone).format("h:mm a"); 228 let result = `${date1} ${time1}`; 229 if (date1 === date2) { 230 result += ` - ${time2}`; 231 } else { 232 result += ` - ${date2} ${time2}`; 233 } 234 element.find("span").html(result); 235 } 236 }); 237}; 238const lazyload = function () { 239 const observer = lozad(); 240 observer.observe(); 241}; 242$(document).ready(() => { 243 bootstrapApp(); 244 formatTimePeriod(); 245 lazyload(); 246}); 247$(document).ready(() => { 248 $(".tab-content") 249 .find(".tab-pane") 250 .each(function (idx, item) { 251 var navTabs = $(this).closest(".content-tabs").find(".nav-tabs"), 252 title = $(this).attr("title"); 253 navTabs.append('<li><a href="#">' + title + "</a></li"); 254 }); 255 $(".content-tabs ul.nav-tabs").each(function () { 256 $(this).find("li:first").addClass("active"); 257 }); 258 $(".content-tabs .tab-content").each(function () { 259 $(this).find("div:first").addClass("active"); 260 }); 261 $(".nav-tabs a").click(function (e) { 262 e.preventDefault(); 263 var tab = $(this).parent(), 264 tabIndex = tab.index(), 265 tabPanel = $(this).closest(".content-tabs"), 266 tabPane = tabPanel.find(".tab-pane").eq(tabIndex); 267 tabPanel.find(".active").removeClass("active"); 268 tab.addClass("active"); 269 tabPane.addClass("active"); 270 }); 271}); 272const bootstrapMarketingSearch = function () { 273 var firstSearchRender = true; 274 const search = instantsearch({ 275 appId: "30NEY6C9UY", 276 apiKey: "b7f43c16886fec97b87981e9e62ef1a5", 277 indexName: 278 window.location.host === "rancher.com" 279 ? "prod_marketing" 280 : "dev_marketing", 281 routing: true, 282 searchFunction: (helper) => { 283 if (helper.state.query === "" && firstSearchRender) { 284 firstSearchRender = false;
285 return; 286 } 287 helper.search(); 288 }, 289 }); 290 search.on("render", function () {}); 291 search.addWidget( 292 instantsearch.widgets.searchBox({ 293 autofocus: true, 294 loadingIndicator: true, 295 container: "#search-box", 296 placeholder: "Search Blog, Events, etc...", 297 magnifier: false, 298 reset: true, 299 }) 300 ); 301 search.addWidget( 302 instantsearch.widgets.infiniteHits({ 303 container: "#hits", 304 templates: { 305 empty: "<h3>No results</h3>", 306 item: `<h3><a href="{{permalink}}">{{{_highlightResult.title.value}}}</a></h3><div class="body">{{{_snippetResult.content.value}}}</div>`, 307 }, 308 escapeHits: true, 309 }) 310 ); 311 search.start(); 312 $(document).on("click", ".search-open", (e) => { 313 let wrapperId = $(e.currentTarget).data("launch-id"); 314 let wrapper = $(`#${wrapperId}`); 315 let content = wrapper.find("div.content"); 316 const modal = new tingle.modal({ 317 closeMethods: ["overlay", "button", "escape"], 318 closeLabel: "Close", 319 beforeClose: () => { 320 content.detach(); 321 wrapper.append(content); 322 return true; 323 }, 324 }); 325 content.detach(); 326 modal.setContent(content[0]); 327 let label = wrapper.find(".footer-button-label").data("footer-label"); 328 if (label) { 329 modal.addFooterBtn(label, "tingle-btn tingle-btn--primary", function () { 330 modal.close(); 331 }); 332 } 333 modal.open(); 334 setTimeout(function () { 335 $("#search-box").focus(); 336 }, 50); 337 }); 338 $(document).ready(function () { 339 $("body").addClass("js"); 340 var $menu = $("#menu"), 341 $menulink = $(".menu-link"); 342 $menulink.click(function () { 343 $menulink.toggleClass("active"); 344 $menu.toggleClass("active"); 345 return false; 346 }); 347 }); 348}; 349$(document).ready(() => { 350 bootstrapMarketingSearch(); 351}); 352const generateTweets = function () { 353 console.log("ok"); 354 $.get("/favorite-tweets.json", (data) => { 355 data = data.slice(0, 3); 356 console.log(data); 357 const domId = "twitter-likes"; 358 data.forEach((item) => { 359 let image = item.user.profile_image_url_https; 360 image = image.replace("_normal", ""); 361 const content = ` 362 <div class="tweet-item"> 363 <div class="tweet-text"> 364 ${item.text} 365 </div> 366 <div class="row align-items-center tweet-user"> 367 <div class="col-xl-4 col-3 user-photo"> 368 <img class="photo" src="${image}"> 369 </div> 370 <div class="col-xl-8 col user-infor"> 371 <div class="user-name">${item.user.name}</div> 372 <div class="user-id">@${item.user.screen_name}</div> 373 </div> 374 </div> 375 </div> 376 `; 377 $(`#${domId}`).append(content); 378 }); 379 }); 380}; 381$(document).ready(() => { 382 (function () { 383 var $curve = document.getElementById("curve"); 384 var last_known_scroll_position = 0; 385 var defaultCurveValue = 350; 386 var curveRate = 3; 387 var ticking = false; 388 var curveValue; 389 function scrollEvent(scrollPos) { 390 if ( 391 $curve && 392 $curve.setAttribute && 393 scrollPos >= 0 && 394 scrollPos < defaultCurveValue 395 ) { 396 curveValue = defaultCurveValue - parseFloat(scrollPos / curveRate); 397 $curve.setAttribute( 398 "d", 399 "M 800 300 Q 400 " + curveValue + " 0 300 L 0 0 L 800 0 L 800 300 Z" 400 ); 401 } 402 } 403 window.addEventListener("scroll", function (e) { 404 last_known_scroll_position = window.scrollY; 405 if (!ticking) { 406 window.requestAnimationFrame(function () { 407 scrollEvent(last_known_scroll_position); 408 ticking = false; 409 }); 410 } 411 ticking = true; 412 }); 413 })(); 414}); 415 416// Custom JS File code migrated to here 417 418jQuery(document) 419 .ready(function () { 420 $(".mobile-menu-opener").click(function () { 421 $("html").toggleClass("body-fix"); 422 }); 423 424 (function ($, window, document, undefined) { 425 var pluginName = "jqueryAccordionMenu"; 426 var defaults = { 427 speed: 300, 428 showDelay: 0, 429 hideDelay: 0, 430 singleOpen: true, 431 clickEffect: true, 432 }; 433 434 function Plugin(element, options) { 435 this.element = element; 436 this.settings = $.extend({}, defaults, options); 437 this._defaults = defaults; 438 this._name = pluginName; 439 this.init(); 440 } 441 442 $.extend(Plugin.prototype, { 443 init: function () { 444 this.openSubmenu(); 445 this.submenuIndicators(); 446 if (this.settings.clickEffect) { 447 this.addClickEffect(); 448 } 449 }, 450 451 openSubmenu: function () { 452 var opts = this.settings; 453 $(this.element) 454 .children("ul") 455 .find("li") 456 .bind("click", function (e) { 457 e.stopPropagation(); 458 e.preventDefault(); 459 460 if ($(this).attr("class") === "back-to-the-top") { 461 $(".mobile-header-container").scrollTop(0); 462 } 463 464 if ($(this).children(".submenu").length > 0) { 465 if ($(this).children(".submenu").css("display") == "none") { 466 $(this) 467 .children(".submenu") 468 .delay(opts.showDelay) 469 .slideDown(opts.speed); 470 $(this) 471 .children(".submenu") 472 .siblings("a") 473 .addClass("submenu-indicator-minus"); 474 $(this).addClass("activate"); 475 if (opts.singleOpen) { 476 $(this).siblings().children(".submenu").slideUp(opts.speed); 477 $(this) 478 .siblings() 479 .children(".submenu") 480 .siblings("a") 481 .removeClass("submenu-indicator-minus"); 482 $(this).removeClass("activate"); 483 } 484 485 return false;
486 } else { 487 $(this) 488 .children(".submenu") 489 .delay(opts.hideDelay) 490 .slideUp(opts.speed); 491 } 492 493 if ( 494 $(this) 495 .children(".submenu") 496 .siblings("a") 497 .hasClass("submenu-indicator-minus") 498 ) { 499 $(this) 500 .children(".submenu") 501 .siblings("a") 502 .removeClass("submenu-indicator-minus"); 503 $(this).removeClass("activate"); 504 } 505 } 506 507 window.location.href = $(this).children("a").attr("href"); 508 }); 509 }, 510 511 submenuIndicators: function () { 512 if ($(this.element).find(".submenu").length > 0) { 513 $(this.element) 514 .find(".submenu") 515 .siblings("a") 516 .append( 517 "<span class='submenu-indicator'><span class='object1'></span><span class='object2'></span><span class='object3'></span></span>" 518 ); 519 } 520 }, 521 522 addClickEffect: function () { 523 var ink, d, x, y; 524 525 $(this.element) 526 .find("a") 527 .bind("click", function (e) { 528 $(".ink").remove(); 529 530 if ($(this).children(".ink").length === 0) { 531 $(this).prepend("<span class='ink'></span>"); 532 } 533 534 ink = $(this).find(".ink"); 535 ink.removeClass("animate-ink"); 536 537 if (!ink.height() && !ink.width()) { 538 d = Math.max($(this).outerWidth(), $(this).outerHeight()); 539 ink.css({ height: d, width: d }); 540 } 541 542 x = e.pageX - $(this).offset().left - ink.width() / 2; 543 y = e.pageY - $(this).offset().top - ink.height() / 2; 544 545 ink 546 .css({ top: y + "px", left: x + "px" }) 547 .addClass("animate-ink"); 548 }); 549 }, 550 }); 551 552 $.fn[pluginName] = function (options) { 553 this.each(function () { 554 if (!$.data(this, "plugin_" + pluginName)) { 555 $.data(this, "plugin_" + pluginName, new Plugin(this, options)); 556 } 557 }); 558 return this; 559 }; 560 })(jQuery, window, document); 561 562 var mobileNavActivator = $(".mobile-menu-opener"), 563 mobileNavContainer = $(".mobile-header-container"), 564 mobileNavMenus = $(".nav-mobile-menus"); 565 566 mobileNavMenus.jqueryAccordionMenu(); 567 568 mobileNavActivator.click(function () { 569 if (mobileNavContainer.hasClass("active")) { 570 mobileNavContainer.removeClass("active"); 571 } else { 572 mobileNavContainer.addClass("active"); 573 } 574 }); 575 576 ScrollReveal().reveal(".decoration.cloud.right", { 577 delay: 400, 578 origin: "right", 579 duration: 1500, 580 distance: "50%", 581 }); 582 583 ScrollReveal().reveal("footer .get-started-container .rancher-logo", { 584 delay: 200, 585 origin: "bottom", 586 distance: "20%", 587 opacity: 0, 588 viewFactor: 0.5, 589 mobile: false, 590 }); 591 592 if (window.location.hash) { 593 scrollPage(window.location.hash); 594 } 595 596 $(".docs-wrap .accordion > label").click(function () { 597 if ($(this).parent().hasClass("active")) { 598 $(this).parent().removeClass("active"); 599 } else { 600 $(this).parent().addClass("active"); 601 } 602 }); 603 604 var mobileNavContainer = $(".mobile-header-container"); 605 606 if ($(this).scrollTop() > 50) { 607 mobileNavContainer.addClass("add-blinder"); 608 } else { 609 mobileNavContainer.removeClass("add-blinder"); 610 } 611 612 var stkNav = $(".header-container"); 613 614 if ($(window).scrollTop() > 50) { 615 stkNav.addClass("sticky"); 616 } else { 617 stkNav.removeClass("sticky"); 618 } 619 620 $(".in-page-menus-container .menu-item").click(function () { 621 $(".in-page-menus-container .menu-item").removeClass("active"); 622 $(this).toggleClass("active"); 623 }); 624 625 ScrollReveal().reveal( 626 ".community-ebooks-screen1 .texts-container .title-label, .community-ebooks-screen1 .texts-container .description-label", 627 {
628 duration: 800, 629 origin: "right", 630 distance: "30px", 631 interval: 250, 632 } 633 ); 634 ScrollReveal().reveal( 635 ".community-ebooks-screen1 .lower-container .ground-upper", 636 { 637 delay: 200, 638 duration: 1200, 639 origin: "right", 640 distance: "20%", 641 interval: 250, 642 } 643 ); 644 ScrollReveal().reveal( 645 ".community-ebooks-screen1 .lower-container .ground-lower", 646 { 647 delay: 500, 648 duration: 1600, 649 origin: "right", 650 distance: "20%", 651 interval: 250, 652 } 653 ); 654 655 ScrollReveal().reveal(".ebook-list-container .ebook-item", { 656 duration: 1000, 657 origin: "bottom", 658 distance: "30px", 659 interval: 250, 660 }); 661 ScrollReveal().reveal( 662 ".ebook-list-container > .buttons-container .button", 663 { 664 duration: 1000, 665 origin: "bottom", 666 distance: "30px", 667 interval: 250, 668 } 669 ); 670 671 ScrollReveal().reveal(".community-ebooks-screen3", { 672 duration: 600, 673 origin: "bottom", 674 distance: "50px", 675 interval: 250, 676 }); 677 678 ScrollReveal().reveal( 679 ".community-ebooks-screen4 .texts-container .title-label, .community-ebooks-screen4 .texts-container .description-label", 680 { 681 duration: 600, 682 origin: "bottom", 683 distance: "50px", 684 interval: 250, 685 } 686 ); 687 688 // Get Started : Quick Start 689 // Screen1 690 ScrollReveal().reveal( 691 ".community-getstarted-screen1 .texts-container .title-label, .community-getstarted-screen1 .texts-container .description-label", 692 { 693 // delay: 300, 694 duration: 800, 695 origin: "bottom", 696 distance: "30px", 697 interval: 250, 698 } 699 ); 700 ScrollReveal().reveal( 701 ".community-getstarted-screen1 .upper-container .cloud-big .image", 702 { 703 // delay: 300, 704 duration: 2400, 705 opacity: 1, 706 origin: "left", 707 distance: "20%", 708 interval: 250, 709 } 710 ); 711 ScrollReveal().reveal(
712 ".community-getstarted-screen1 .lower-container .ground .community-ground", 713 { 714 delay: 300, 715 duration: 1200, 716 origin: "bottom", 717 distance: "30px", 718 interval: 250, 719 } 720 ); 721 722 // Screen2 723 ScrollReveal().reveal( 724 ".community-getstarted-screen2 .easy-steps .texts-container .title-label, .community-getstarted-screen2 .easy-steps .texts-container .description-label", 725 { 726 // delay: 300, 727 duration: 800, 728 origin: "bottom", 729 distance: "30px", 730 interval: 250, 731 } 732 ); 733 ScrollReveal().reveal( 734 ".community-getstarted-screen2 .easy-steps-detail .step-item", 735 { 736 delay: 300, 737 duration: 800, 738 origin: "bottom", 739 distance: "30px", 740 interval: 250, 741 } 742 ); 743 744 // Product-RKE 745 ScrollReveal().reveal(".tractor", { 746 delay: 1000, 747 duration: 2000, 748 origin: "right", 749 distance: "250px", 750 interval: 1000, 751 opacity: 1, 752 easing: "ease-in-out", 753 }); 754 755 ScrollReveal().reveal(".ground-upper", { 756 delay: 0, 757 duration: 3000, 758 origin: "left", 759 distance: "20px", 760 interval: 2000, 761 opacity: 1, 762 }); 763 764 ScrollReveal().reveal(".ground-lower", { 765 delay: 30, 766 duration: 3000, 767 origin: "left", 768 distance: "20px", 769 interval: 2000, 770 opacity: 1, 771 }); 772 773 ScrollReveal().reveal(".cloud-high", { 774 duration: 10000, 775 origin: "left", 776 distance: "200px", 777 interval: 2000, 778 easing: "ease-out", 779 }); 780 }) 781 .on("scroll", function (e) { 782 var mobileNavContainer = $(".mobile-header-container"); 783 784 if ($(this).scrollTop() > 50) { 785 mobileNavContainer.addClass("add-blinder"); 786 } else { 787 mobileNavContainer.removeClass("add-blinder"); 788 } 789 790 var stkNav = $(".header-container"); 791 792 if ($(window).scrollTop() > 50) { 793 stkNav.addClass("sticky"); 794 } else { 795 stkNav.removeClass("sticky"); 796 } 797 // Why Kubernetes? - screen3: Availability / slider. 798 var scr3SldPrv = $( 799 ".why-kubernetes-screen3 #availability .slider-pager .btn-prev" 800 ), 801 scr3SldNxt = $( 802 ".why-kubernetes-screen3 #availability .slider-pager .btn-next" 803 ); 804 (scr3Sld = $(".why-kubernetes-screen3 #availability .slider-wrap").slick({ 805 dots: false, 806 arrows: false, 807 autoplay: false, 808 autoplaySpeed: VAR_DATAS.SPEED_AUTOPLAY, 809 speed: VAR_DATAS.SPEED_SLIDE, 810 centerMode: false, 811 slidesToShow: 2, 812 slidesToScroll: 1, 813 draggable: true, 814 asNavFor: ".why-kubernetes-screen3 #availability .sub-slider-wrap", 815 responsive: [ 816 { 817 breakpoint: 768, 818 settings: { 819 slidesToShow: 1, 820 }, 821 }, 822 ], 823 })), 824 (scr3SldMsg = $( 825 ".why-kubernetes-screen3 #availability .sub-slider-wrap" 826 ).slick({ 827 dots: false, 828 arrows: false, 829 autoplay: false, 830 autoplaySpeed: VAR_DATAS.SPEED_AUTOPLAY, 831 speed: VAR_DATAS.SPEED_SLIDE, 832 centerMode: false, 833 slidesToShow: 2, 834 slidesToScroll: 1, 835 draggable: true, 836 asNavFor: ".why-kubernetes-screen3 #availability .slider-wrap", 837 responsive: [ 838 { 839 breakpoint: 768, 840 settings: { 841 slidesToShow: 1, 842 }, 843 }, 844 ], 845 })); 846 847 function screen3SliderStart() { 848 // scr3Sld.slick('slickPlay'); 849 } 850 screen3SliderStart(); 851 852 scr3Sld.on( 853 "beforeChange", 854 function (event, slick, currentSlide, nextSlide) { 855 $("#availability .slider-menus .active").removeClass("active"); 856 $("#availability .slider-menus") 857 .find(".menu" + (nextSlide + 1)) 858 .addClass("active"); 859 860 if ($(window).width() < 768) { 861 switch (nextSlide + 1) { 862 case 1: 863 $("#availability .slider-menus ul").animate( 864 { scrollLeft: 0 }, 865 200 866 ); 867 break; 868 case 2: 869 $("#availability .slider-menus ul").animate( 870 { scrollLeft: $("#availability .slider-menus .menu1").width() }, 871 200 872 ); 873 break; 874 case 3: 875 $("#availability .slider-menus ul").animate( 876 { 877 scrollLeft: 878 $("#availability .slider-menus .menu1").width() + 879 $("#availability .slider-menus .menu2").width(), 880 }, 881 200 882 ); 883 break; 884 case 4: 885 $("#availability .slider-menus ul").animate( 886 { 887 scrollLeft: 888 $("#availability .slider-menus .menu1").width() + 889 $("#availability .slider-menus .menu2").width() + 890 $("#availability .slider-menus .menu3").width(), 891 }, 892 200 893 ); 894 break; 895 default: 896 $("#availability .slider-menus ul").animate( 897 { scrollLeft: 0 }, 898 200 899 ); 900 break; 901 } 902 } 903 } 904 ); 905 scr3Sld.on("afterChange", function (slick, currentSlide) {}); 906 907 scr3SldPrv.on("click", function () { 908 scr3Sld.slick("slickPrev"); 909 }); 910 911 scr3SldNxt.on("click", function () { 912 scr3Sld.slick("slickNext"); 913 }); 914
915 $("a[data-slide-to-go]").click(function (e) { 916 var toGo = $(this).attr("data-slide-to-go"); 917 918 e.preventDefault(); 919 920 scr3Sld.slick("slickGoTo", toGo - 1); 921 }); 922 923 var topRange = 200, 924 edgeMargin = 20, 925 contentTop = []; 926 927 $("html, body").bind( 928 "scroll mousedown DOMMouseScroll mousewheel keyup", 929 function (e) { 930 if (e.which > 0 || e.type == "mousedown" || e.type == "mousewheel") { 931 $("html, body").stop(); 932 } 933 } 934 ); 935 936 // Set up content an array of locations 937 $(".side-anchor") 938 .find("a") 939 .each(function () { 940 contentTop.push($($(this).attr("href")).offset().top); 941 }); 942 943 // $("a[href*='#']").click(function (e) { 944 // // e.preventDefault(); 945 946 // if ( 947 // $(this).attr("data-target") === undefined && 948 // $(this).attr("href").length > 1 949 // ) { 950 // var hash = window.location.hash.substring(1), 951 // objt = $("#" + hash), 952 // objt_mt = Number(objt.css("margin-top").replace(/[^0-9]/g, "")), 953 // depth = 80, 954 // scrn = $(window).width(); 955 // scrn_check = 1025; 956 957 // if (scrn < scrn_check) { 958 // depth = 120; 959 // } 960 961 // if (objt_mt > 0) { 962 // depth = depth + objt_mt; 963 // } 964 965 // if ($(this).attr("href").charAt(0) === "#") { 966 // var objectTop = $($(this).attr("href")).offset().top; 967 968 // setTimeout(function () { 969 // $("html").scrollTop(objectTop - depth); 970 // }, 100); 971 // } 972 // } 973 // }); 974 975 // adjust side menu 976 $(window).scroll(function () { 977 var winTop = $(window).scrollTop(), 978 bodyHt = $(document).height(), 979 vpHt = $(window).height() + edgeMargin; // viewport height + margin 980 981 $.each(contentTop, function (i, loc) { 982 if ( 983 loc > winTop - edgeMargin && 984 (loc < winTop + topRange || winTop + vpHt >= bodyHt) 985 ) { 986 $(".side-anchor a").removeClass("active").eq(i).addClass("active"); 987 } 988 }); 989 }); 990 991 // organizational benefit items. 992 $(".ognz-container a[data-target]").click(function (e) { 993 var targetName = $(this).attr("data-target"); 994 e.preventDefault(); 995 996 $(".ognz-container .side-container .buttons-container a").removeClass( 997 "active" 998 ); 999 1000 $(this).addClass("active"); 1001 $(".ognz-container .detail-wrap.show").fadeOut(200, function () { 1002 $(".ognz-container .detail-wrap.show") 1003 .removeClass("show") 1004 .addClass("hide"); 1005 $("#" + targetName) 1006 .addClass("show") 1007 .fadeIn(400); 1008 $("#" + targetName + "m") 1009 .addClass("show") 1010 .fadeIn(400); 1011 }); 1012 }); 1013 1014 // user benefit items. 1015 $(".usrbnf-container a[data-target]").click(function (e) { 1016 var targetName = $(this).attr("data-target"); 1017 e.preventDefault(); 1018 1019 $(".usrbnf-container .side-container .buttons-container a").removeClass( 1020 "active" 1021 ); 1022 1023 $(this).addClass("active"); 1024 $(".usrbnf-container .detail-wrap.show").fadeOut(200, function () { 1025 $(".usrbnf-container .detail-wrap.show") 1026 .removeClass("show") 1027 .addClass("hide"); 1028 $("#" + targetName) 1029 .addClass("show") 1030 .fadeIn(400); 1031 $("#" + targetName + "m") 1032 .addClass("show") 1033 .fadeIn(400); 1034 }); 1035 }); 1036 1037 // initialize flip content. 1038 if ($(window).width() < 768) { 1039 $(".ognz-container a[data-target]").removeClass("active"); 1040 $(".usrbnf-container a[data-target]").removeClass("active"); 1041 } 1042 }); 1043 1044$(window).scroll(function () { 1045 // sticky sidemenu handler. 1046 if ($("#organizational_benefits").length > 0) { 1047 var window_top = $(window).scrollTop() + 12, 1048 div_top = $("#organizational_benefits").offset().top; 1049 1050 if (window_top >= div_top) { 1051 $(".side-anchor").addClass("sticky"); 1052 } else { 1053 $(".side-anchor").removeClass("sticky"); 1054 } 1055 } 1056}); 1057 1058var VAR_DATAS = { 1059 SPEED_SLIDE: 1000, 1060 SPEED_SLIDE_DELAYED: 1200, 1061 SPEED_AUTOPLAY: 4000, 1062}; 1063 1064function sliderProgressPlay( 1065 slider, 1066 progressBar, 1067 duration, 1068 repeatable, 1069 syncedsliders 1070) { 1071 progressBar.stop().css("width", 0); 1072 1073 progressBar.animate( 1074 { 1075 width: "100%", 1076 }, 1077 duration || 5000, 1078 function () { 1079 progressBar.animate({ width: "0%" }, 100); 1080 1081 slider.slick("slickNext"); 1082 1083 if (syncedsliders) {
1084 syncedsliders.forEach(function (item, index) { 1085 item.slick("slickNext"); 1086 }); 1087 } 1088 1089 if (repeatable) 1090 sliderProgressPlay(slider, progressBar, duration, repeatable); 1091 } 1092 ); 1093} 1094 1095function scrollPage(hash) { 1096 var hash = hash.substring(1), 1097 objt = $("#" + hash), 1098 objt_mt = Number(objt.css("margin-top").replace(/[^0-9]/g, "")), 1099 depth = 80, 1100 scrn = $(window).width(); 1101 scrn_check = 1025; 1102 1103 if (scrn < scrn_check) { 1104 depth = 160; 1105 } 1106 1107 if (objt_mt > 0) { 1108 depth = depth + objt_mt; 1109 } 1110 1111 setTimeout(function () { 1112 $("html").animate( 1113 { 1114 scrollTop: objt.offset().top - depth, 1115 }, 1116 400 1117 ); 1118 }, 100); 1119} 1120 1121if ($(".kubecake-wrapper").length > 0) { 1122 var vOffset = document.querySelector(".kubecake-wrapper").offsetTop; 1123 1124 var first = document.querySelector(".statement.first").offsetTop + vOffset; 1125 var second = document.querySelector(".statement.second").offsetTop + vOffset; 1126 var third = document.querySelector(".statement.third").offsetTop + vOffset; 1127 var fourth = document.querySelector(".statement.fourth").offsetTop + vOffset; 1128 1129 window.onload = function () { 1130 lax.setup({ 1131 breakpoints: { small: 0, large: 1024 }, 1132 }); 1133 1134 const updateLax = () => { 1135 lax.update(window.scrollY); 1136 window.requestAnimationFrame(updateLax); 1137 }; 1138 1139 window.requestAnimationFrame(updateLax); 1140 }; 1141} 1142 1143 1144// Smooth scrolling using jQuery easing 1145$(".in-page-menus-container .menu-item a[href*='#']:not([href='#'])").click(function () { 1146 var navHeight; 1147 if (window.screen.width > 1024) { 1148 navHeight = 1149 document.getElementsByClassName("header-container")[0].offsetHeight; 1150 } else { 1151 navHeight = document.getElementsByClassName("mobile-header-container")[0] 1152 .offsetHeight; 1153 } 1154 if ( 1155 location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && 1156 location.hostname == this.hostname 1157 ) { 1158 var target = $(this.hash); 1159 target = target.length ? target : $("[name=" + this.hash.slice(1) + "]"); 1160 if (target.length) { 1161 $("html, body").animate( 1162 { 1163 scrollTop: target.offset().top - (navHeight + 12), 1164 }, 1165 500 1166 ); 1167 return 1; 1168 } 1169 } 1170});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.