1;(function($, undefined) { 2 "use strict"; 3 // Constants 4 var doc = $(document), 5 body = $('body'), 6 win = $(window), 7 breaks = { 8 xs: 480, 9 sm: 740, 10 md: 992, 11 lg: 1200 12 }; 13 14 /* 1 :: Navbar */ 15 $.fn.ui_navbar = function() { 16 var navbar = this; 17 var toggle = $('.ui-mobile-nav-toggle'); 18 var navbar_nav = $('.ui-navigation'); 19 var wrap = $("#cara-klaim"); 20 // Scroll Function 21 win.scroll(function() { 22 var scroll_top = $(this).scrollTop(); 23 if (body.hasClass('ui-transparent-nav') && !body.hasClass('mobile-nav-active')) { 24 if (scroll_top >= 24) { 25 navbar.removeClass('transparent'); 26 } else { 27 navbar.addClass('transparent'); 28 } 29 } 30 }); 31 32 // Nav Toggle HTML 33 toggle.php('<div><span></span><span></span><span></span><span></span></div>'); 34 // Nav Toggle Action 35 var toggle_nav = function() { 36 var win_top = win.scrollTop(); 37 // Nav Is NOT Active 38 if (!body.hasClass('mobile-nav-active')) { 39 body.addClass('mobile-nav-active'); 40 toggle.addClass('active'); 41 navbar_nav.slideDown(250); 42 if (body.hasClass('ui-transparent-nav')) { 43 navbar.removeClass('transparent'); 44 } 45 } 46 // Nav IS Active 47 else { 48 body.removeClass('mobile-nav-active'); 49 toggle.removeClass('active'); 50 navbar_nav.slideUp(200); 51 if (body.hasClass('ui-transparent-nav')) { 52 if (win_top < 24) { 53 navbar.addClass('transparent'); 54 } 55 } 56 } 57 }; 58 toggle.on('click', function(e) { 59 e.preventDefault(); 60 toggle_nav(); 61 }); 62 win.resize(function() { 63 var w = $(this).width(); 64 var win_top = win.scrollTop(); 65 if (w >= 740) { 66 if (body.hasClass('mobile-nav-active')) { 67 body.removeClass('mobile-nav-active'); 68 toggle.removeClass('active'); 69 if (body.hasClass('ui-transparent-nav')) { 70 if (win_top < 24) { 71 navbar.addClass('transparent'); 72 } 73 } 74 } 75 navbar_nav.show(); 76 } else { 77 if (!body.hasClass('mobile-nav-active')) { 78 navbar_nav.hide(); 79 } 80 } 81 }); 82 }; 83 84 /* 9 :: Accordion */ 85 $.fn.ui_accordion = function() { 86 var el = this; 87 var accordion = el.find('.ui-accordion'); 88 var accordion_toggle = el.find('.toggle'); 89 var accordion_body = el.find('.body'); 90 // Show First Accordion Child 91 accordion.first().addClass('active'); 92 accordion_body.first().css('display', 'block'); 93 // Accordion Toggle 94 accordion_toggle.on('click', function(e) { 95 e.preventDefault(); 96 // Get The Target 97 var toggle = $(this).data('toggle'); 98 var target = $('.body[data-accord="' + toggle + '"]'); 99 // Show Selected Accordion 100 $(this).closest('.ui-accordion').addClass('active'); 101 target.slideDown(250); 102 target.children().animate({ 103 'opacity': 1 104 }, 750); 105 // Hide The Not Selected 106 accordion_body.not(target).closest('.ui-accordion').removeClass('active'); 107 accordion_body.not(target).slideUp(250); 108 accordion_body.not(target).children().animate({ 109 'opacity': 0 110 }, 150); 111 }); 112 }; 113 114 // /* 10 :: Modal */ 115 // $.fn.modal = function() { 116 // doc.on('click', '[data-close="modal"]', function() { 117 // var m = $(this).closest('.modal'); 118 // closeModal(m); 119 // }); 120 // doc.on('click', '.modal', function(e) { 121 // if (e.target === this) { 122 // closeModal($(this)); 123 // } 124 // }); 125 126 // function closeModal(m) { 127 // body.removeClass('modal-open'); 128 // m.fadeOut(250, function() { 129 // doc.trigger('modal-hidden'); 130 // }); 131 // } 132 // return { 133 // show: function(modal) { 134 // modal.fadeIn(250); 135 // body.addClass('modal-open'); 136 // }, 137 // hide: function(modal) { 138 // closeModal(modal); 139 // } 140 // }; 141 // }; 142 // var ui_modal = doc.modal(); 143 144 /* 11 :: Video Player */ 145 $.fn.ui_video_player = function() { 146 var video_modal = $('<div class="video-modal modal" role="dialog"><div class="dialog container"><a class="close" data-close="modal" aria-hidden="true">Ã</a><div class="video-player"></div></div></div>'); 147 var toggle = this; 148 toggle.on('click', function() { 149 var youtube_id = $(this).data('video'); 150 body.append(video_modal); 151 $('.video-modal').find('.video-player').php('<div class="video-player"><iframe src="https://www.youtube-nocookie.com/embed/' + youtube_id + '?rel=0&showinfo=0&autoplay=1" frameborder="0" allowfullscreen></iframe></div>'); 152 ui_modal.show($('.video-modal')); 153 }); 154 doc.on('modal-hidden', function() { 155 $('.video-modal').remove(); 156 }); 157 }; 158 /* 12 :: Collapsible Nav */ 159 $.fn.ui_collapsible_nav = function() { 160 var cnav_toggle = this.find('a.toggle'); 161 var collapsible = { 162 show: function(e) { 163 e.slideDown(250); 164 }, 165 hide: function(e) { 166 e.slideUp(250); 167 } 168 }; 169 cnav_toggle.on('click', function(e) { 170 e.preventDefault(); 171 var a = $(this); 172 var ul = a.next(); 173 var sibs = a.parent().siblings(); 174 var sibs_togg = sibs.children('.toggle'); 175 if (!a.hasClass('active')) { 176 if (sibs_togg.length) { 177 sibs_togg.removeClass('active'); 178 collapsible.hide(sibs_togg.next('ul')); 179 } 180 collapsible.show(ul); 181 a.addClass('active'); 182 } else { 183 collapsible.hide(ul); 184 a.removeClass('active'); 185 } 186 }); 187 cnav_toggle.each(function() { 188 var togg = $(this); 189 if (togg.hasClass('active')) { 190 collapsible.show(togg.next('ul')); 191 } else { 192 collapsible.hide(togg.next('ul')); 193 } 194 }); 195 }; 196 197 198 199 /* 14 :: Scroll To Section */ 200 $.fn.ui_scroll_to = function() { 201 var link = $('[data-scrollto]'); 202 link.on('click', function(e) { 203 e.preventDefault(); 204 var scroll_to = $(this).attr('data-scrollto'); 205 if ($('#' + scroll_to + '.section').length > 0 && scroll_to !== undefined) { 206 var pos = $('#' + scroll_to).offset().top; 207 $('html, body').animate({ 208 scrollTop: pos 209 }, 500, function() { 210 window.location.hash = scroll_to; 211 }); 212 } 213 if ($('#' + scroll_to + '.main').length > 0 && scroll_to !== undefined) { 214 $('html, body').animate({ 215 scrollTop: 0 216 }, 500, function() { 217 window.location.hash = scroll_to; 218 }); 219 } 220 }); 221 }; 222 223 /*Function Div bisa dikasi link*/ 224 $.fn.action_card = function() { 225 var card = this; 226 card.on('click', function() { 227 window.location.href = $(this).data('target'); 228 }); 229 }; 230 /*FUnction Shortcut box */ 231 $.fn.shortcut = function() { 232 var cut = this; 233 cut.on('click', function() { 234 $("#shortcutList").toggle(); 235 $(".shortcutbox").toggleClass("shortcutbox-hit"); 236 $(".icon-box").toggleClass("fa-chevron-down fa-chevron-up"); 237 }); 238 }; 239 /* 16 :: Load Images By Screen Density */ 240 $.fn.ui_uhd_images = function() { 241 var img = this; 242 var total = img.length; 243 var loaded = 0; 244 if (window.devicePixelRatio >= 1.25) { 245 setUHDImage(img); 246 } 247 248 function setUHDImage(images) { 249 images.each(function() { 250 loaded++; 251 var this_img = $(this); 252 var img_src = this_img.attr('src'); 253 if(typeof img_src !== 'undefined'){ 254 var img_type = img_src.split('.').pop(); 255 var retina_img = img_src.replace('.' + img_type, '@2x.' + img_type); 256 this_img.attr('src', retina_img); 257 if (loaded >= total) { 258 setTimeout(function() { 259 doc.trigger('images_did_load'); 260 }, 500); 261 } 262 } 263 }); 264 } 265 }; 266 load_bg_images(); 267 function load_bg_images() { 268 var images = doc.find('[data-bg]'); 269 var uhd = doc.find('[data-uhd][data-bg]'); 270 if (window.devicePixelRatio >= 1.25) { 271 uhd.each(function() { 272 var this_img = $(this); 273 var img_src = this_img.attr('data-bg'); 274 var img_type = img_src.split('.').pop(); 275 var retina_img = img_src.replace('.' + img_type, '@2x.' + img_type); 276 this_img.css({ 277 "background-image": "url('" + retina_img + "')" 278 }); 279 }); 280 } else { 281 images.each(function() { 282 var this_img = $(this); 283 var img_src = this_img.attr('data-bg'); 284 this_img.css({ 285 "background-image": "url('" + img_src + "')" 286 }); 287 }); 288 } 289 } 290 images_loaded(); 291 function images_loaded() { 292 var images = doc.find('img'); 293 var total = images.length; 294 var loaded = 0; 295 var dummy = $('<img/>'); 296 images.each(function() { 297 var img_src = $(this).attr('src'); 298 dummy.attr('src', img_src).on('load', function() { 299 loaded++; 300 if (loaded >= total) { 301 setTimeout(function() { 302 doc.trigger('images_did_load'); 303 }, 300); 304 } 305 }); 306 }); 307 } 308 309 /* 17 :: Images Max Widths */ 310 $('[data-max_width]').each(function(){ 311 $(this).css({'max-width': $(this).attr('data-max_width') + 'px'}); 312 }); 313 314 /* 18 :: Animate When In Viewport */ 315 $.fn.isOnScreen = function() { 316 var viewport = { 317 top: win.scrollTop() 318 }; 319 viewport.bottom = viewport.top + win.height(); 320 var bounds = this.offset(); 321 bounds.bottom = bounds.top + this.outerHeight(); 322 var winWidth = win.width(); 323 if(winWidth > breaks.lg){ 324 return (!(viewport.bottom < (bounds.top + 200) || viewport.top >
324 (bounds.bottom + 60))); 325 } 326 else{ 327 return (!(viewport.bottom < (bounds.top + 20) || viewport.top > (bounds.bottom + 20))); 328 } 329 }; 330 win.scroll(function() { 331 $('[data-show]').not('.animated').each(function() { 332 var el = $(this); 333 var show_animation = $(this).attr('data-show'); 334 var animation_delay = $(this).attr('data-delay'); 335 if (el.isOnScreen()) { 336 if (!animation_delay) { 337 el.addClass(show_animation); 338 } else { 339 setTimeout(function() { 340 el.addClass(show_animation); 341 }, animation_delay); 342 } 343 el.addClass('animated'); 344 } 345 }); 346 }); 347 348 function submit_form(form, script) { 349 var the_form = form; 350 the_form.find('button').text('Sending'); 351 var form_data = {}; 352 $.each(the_form.serializeArray(), function() { 353 form_data[this.name] = this.value; 354 }); 355 var form_json = JSON.stringify(form_data); 356 // AJAX $_POST 357 $.ajax({ 358 url: script, 359 async: true, 360 cache: false, 361 type: "POST", 362 dataType: "json", 363 data: { 364 data: form_json 365 }, 366 // AJAX Success 367 success: function(data) { 368 // PHP Success 369 if (data.status === 'success') { 370 the_form.trigger('reset'); 371 the_form.find('button').text('Sent'); 372 var msg = $('<span class="help-block form-success"/>').text(data.message); 373 if (the_form.find('.input-group-btn').length > 0) { 374 msg.appendTo(the_form); 375 } else { 376 msg.insertBefore(the_form.find('button')); 377 } 378 } 379 // PHP Error 380 else if (data.status === 'error') { 381 console.error('Error: ' + data.message); 382 } 383 }, 384 // AJAX Error 385 error: function() { 386 console.error('Error: Ajax Fatal Error'); 387 } 388 }); 389 } 390 391 /* 20 :: Vertical Align Elements */ 392 if ($('[data-vertical_center="true"]').length) { 393 var elements = $('[data-vertical_center="true"]'); 394 var resizeThreshold; 395 win.on('resize', function(){ 396 clearTimeout(resizeThreshold); 397 resizeThreshold = setTimeout(function(){ 398 elements.each(function(){ 399 var e = $(this); 400 var p = e.parent(); 401 var o = e.data('vertical_offset'); 402 var y = 0; 403 if (o) { 404 y = ((p.height() - e.height()) / 2) - o; 405 } else { 406 y = (p.height() - e.height()) / 2; 407 } 408 var px = p.width(); 409 var ex = e.outerWidth(); 410 if (ex < px) { 411 e.css({ 412 'margin-top': y + 'px' 413 }); 414 } else { 415 e.css({ 416 'margin-top': '0' 417 }); 418 } 419 }); 420 }, 250); 421 }); 422 } 423 424 425 426 /* 22 Iinitialize Plugin & Functions */ 427 // Navbar 428 $('.navbar').ui_navbar(); 429 // UltraHD Images @2x 430 if($('[data-uhd]').length){$('[data-uhd]').ui_uhd_images();} 431 // UI Scroll to Sections 432 if($('[data-scrollto]').length){$('[data-scrollto]').ui_scroll_to();} 433 // Video Player 434 if($('.ui-video-toggle').length){$('.ui-video-toggle').ui_video_player();} 435 436 //Function Div bisa dikasi link 437 if ($(".action-card").length) { 438 $(".action-card").action_card(); 439 } 440 if ($(".eventbtn").length) { 441 $(".eventbtn").shortcut(); 442 } 443 444 // Trigger Events 445 win.trigger('scroll'); 446 win.trigger('resize'); 447 448 // On Images Did Load 449 doc.on('images_did_load', function() { 450 win.trigger('resize'); 451 // Fade In Body 452 $('[data-fade_in="on-load"]').animate({'opacity': 1},450); 453 }); 454 455 456}(jQuery)); 457 // Close the dropdown if the user clicks outside of it 458window.onclick = function(event) { 459if (!event.target.matches('.eventbtn')) { 460 var dropdowns = $(".dropdown-content"); 461 if(dropdowns.css('display') != 'none'){ 462 //console.log(dropdowns.css('display')); 463 dropdowns.hide(); 464 $(".shortcutbox").toggleClass("shortcutbox-hit"); 465 $(".icon-box").toggleClass("fa-chevron-down fa-chevron-up"); 466 } 467 //console.log('diluar'); 468 } else { 469 //console.log('didalam'); 470 } 471 // console.log($(event.target)); 472 473 $(".action-card").mouseover(function(){ 474 $(".card-title",this).css("color", "#0087d9"); 475 }); 476 $(".action-card").mouseout(function(){ 477 $(".card-title",this).css("color", "#163141"); 478 }); 479 $(".program-cara-klaim").mouseover(function(){ 480 $(".product-name",this).css("color", "#0087d9"); 481 }); 482 $(".program-cara-klaim").mouseout(function(){ 483 $(".product-name",this).css("color", "#163141"); 484 }); 485 $(".swiper-slides").mouseover(function(){ 486 var anchor = $(this).attr('data-attr-detail'); 487 $(".detail-pimpinan",this).css("opacity", "0.5"); 488 // console.log('test'); 489 }); 490 /* 491 $(".pimpinan-overlay").click(function(){ 492 var detail = $(this).attr('data-attr-detail'); 493 console.log(detail); 494 });*/ 495 $(".showtimeline").click(function(){ 496 var showdata = $(this).attr('data-target'); 497 $(".timeline-show",showdata).toggle(); 498 $(".timeline-detail",showdata).toggle(); 499 $(".timeline-show",showdata+'-btn').toggle(); 500 $(".timeline-detail",showdata+'-btn').toggle(); 501 $(this).php(); 502 }); 503 504} 505 506$('.carousel[data-type="multi"] .item').each(function(){ 507 var next = $(this).next(); 508 if (!next.length) { 509 next = $(this).siblings(':first'); 510 } 511 next.children(':first-child').clone().appendTo($(this)); 512/* 513 for (var i=0;i<1;
513i++) { 514 next=next.next(); 515 if (!next.length) { 516 next = $(this).siblings(':first'); 517 } 518 519 next.children(':first-child').clone().appendTo($(this)); 520 } 521 */ 522}); 523 524$(document).ready(function($) { 525 $(".scrollto").click(function(event) { 526 event.preventDefault(); 527 528 var defaultAnchorOffset = 100; 529 530 var anchor = $(this).attr('data-attr-scroll'); 531 532 var anchorOffset = $('#'+anchor).attr('data-scroll-offset'); 533 if (!anchorOffset) 534 anchorOffset = defaultAnchorOffset; 535 536 $('html,body').animate({ 537 scrollTop: $('#'+anchor).offset().top - anchorOffset 538 }, 700); 539 }); 540 var swiper = new Swiper(".pimpinan", { 541 slidesPerView: 5, 542 spaceBetween: 20, 543 pagination: { 544 el: ".swiper-pagination", 545 clickable: true, 546 }, 547 navigation: { 548 nextEl: ".swiper-button-next", 549 prevEl: ".swiper-button-prev", 550 }, 551 breakpoints: { 552 "@0.00": { 553 slidesPerView: 2, 554 spaceBetween: 10, 555 }, 556 "@0.75": { 557 slidesPerView: 2, 558 spaceBetween: 20, 559 }, 560 "@1.00": { 561 slidesPerView: 3, 562 spaceBetween: 20, 563 }, 564 "@1.50": { 565 slidesPerView: 5, 566 spaceBetween: 20, 567 }, 568 }, 569 }); 570 var swiper = new Swiper(".pimpinan2", { 571 slidesPerView: 5, 572 spaceBetween: 20, 573 pagination: { 574 el: ".swiper-pagination", 575 clickable: true, 576 }, 577 navigation: { 578 nextEl: ".swiper-button-next2", 579 prevEl: ".swiper-button-prev2", 580 }, 581 breakpoints: { 582 "@0.00": { 583 slidesPerView: 2, 584 spaceBetween: 10, 585 }, 586 "@0.75": { 587 slidesPerView: 2, 588 spaceBetween: 20, 589 }, 590 "@1.00": { 591 slidesPerView: 3, 592 spaceBetween: 20, 593 }, 594 "@1.50": { 595 slidesPerView: 5, 596 spaceBetween: 20, 597 }, 598 }, 599 }); 600 var swiper = new Swiper(".timeline", { 601 slidesPerView: 4, 602 spaceBetween: 0, 603 pagination: { 604 el: ".swiper-pagination", 605 clickable: true, 606 }, 607 navigation: { 608 nextEl: ".swiper-button-next3", 609 prevEl: ".swiper-button-prev3", 610 }, 611 breakpoints: { 612 "@0.00": { 613 slidesPerView: 1, 614 spaceBetween: 0, 615 }, 616 "@0.75": { 617 slidesPerView: 1, 618 spaceBetween: 0, 619 }, 620 "@1.00": { 621 slidesPerView: 2, 622 spaceBetween: 0, 623 }, 624 "@1.50": { 625 slidesPerView: 3, 626 spaceBetween: 0, 627 }, 628 }, 629 }); 630 var swiper = new Swiper(".penghargaan", { 631 slidesPerView: 5, 632 spaceBetween: 0, 633 pagination: { 634 el: ".swiper-pagination", 635 clickable: true, 636 }, 637 navigation: { 638 nextEl: ".swiper-button-next4", 639 prevEl: ".swiper-button-prev4", 640 }, 641 breakpoints: { 642 "@0.00": { 643 slidesPerView: 1, 644 spaceBetween: 0, 645 }, 646 "@0.75": { 647 slidesPerView: 2, 648 spaceBetween: 0, 649 }, 650 "@1.00": { 651 slidesPerView: 3, 652 spaceBetween: 0, 653 }, 654 "@1.50": { 655 slidesPerView: 3, 656 spaceBetween: 0, 657 }, 658 }, 659 }); 660 var swiper = new Swiper(".tutorialpenggunaanjmo", { 661 slidesPerView: 1, 662 spaceBetween: 2, 663 pagination: { 664 el: ".swiper-pagination", 665 clickable: true, 666 }, 667 navigation: { 668 nextEl: ".swiper-button-next5", 669 prevEl: ".swiper-button-prev5", 670 }, 671 loop: true, 672 centeredSlides: true, 673 autoplay: { 674 delay: 3000, 675 disableOnInteraction: true, 676 }, 677 breakpoints: { 678 640: { 679 slidesPerView: 1, 680 spaceBetween: 5, 681 }, 682 768: { 683 slidesPerView: 3, 684 spaceBetween: 5, 685 }, 686 1024: { 687 slidesPerView: 3, 688 spaceBetween: 5, 689 }, 690 }, 691 }); 692}); 693//var rupiah = $('.money'); 694$('.money').on('keyup',function(e){ 695 this.value = formatRupiah(this.value, ''); 696}); 697function formatRupiah(angka, prefix){ 698 var number_string = angka.replace(/[^,\d]/g, '').toString(), 699 split = number_string.split(','), 700 sisa = split[0].length % 3, 701 rupiah = split[0].substr(0, sisa), 702 ribuan = split[0].substr(sisa).match(/\d{3}/gi); 703 704 // tambahkan titik jika yang di input sudah menjadi angka ribuan 705 if(ribuan){ 706 separator = sisa ? '.' : ''; 707 rupiah += separator + ribuan.join('.'); 708 } 709 710 rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah; 711 return prefix == undefined ? rupiah : (rupiah ? '' + rupiah : ''); 712} 713 714 715// ===== Scroll to Top ==== 716$(window).scroll(function() { 717 if ($(this).scrollTop() >= 50) { 718 $('#return-to-top').fadeIn(200); 719 } else { 720 $('#return-to-top').fadeOut(200); 721 } 722 if ($(this).scrollTop() >= 600) { 723 $("#cara-klaim").addClass("fix-cara-klaim-tab"); 724 $("#cara-klaim .nav .list-product-box .program-cara-klaim").addClass("fix-cara-klaim-box"); 725 $("#cara-klaim .nav .list-product-box .program-cara-klaim .product-image-fix").addClass("fix-cara-klaim-icon"); 726 } else { 727 $("#cara-klaim").removeClass("fix-cara-klaim-tab"); 728 $("#cara-klaim .nav .list-product-box .program-cara-klaim").removeClass("fix-cara-klaim-box"); 729 $("#cara-klaim .nav .list-product-box .program-cara-klaim .product-image-fix").removeClass("fix-cara-klaim-icon"); 730 } 731 // console.log($(this).scrollTop()); 732}); 733$('#return-to-top').click(function() { 734 $('body,html').animate({ 735 scrollTop : 0 736 }, 500); 737});
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.