1"use strict"; 2 3var baseFolder = ''; 4var base_url = window.location.protocol+"//"+window.location.hostname+baseFolder; 5var assets_url = window.location.protocol+"//"+window.location.hostname+baseFolder+"/assets/site/default/"; 6var storage_url = 'https://cms.icenterra.com.tr/storage'; 7var apiCall = window.location.protocol+"//"+window.location.hostname+baseFolder+"/api/"; 8 9var scrollTracker = 0; 10var scrollVal = 0; 11var scrollDelta = -1; 12var trackVal; 13 14AOS.init({ 15 // Global settings: 16 disable: 'mobile', // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function 17 startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on 18 initClassName: 'aos-init', // class applied after initialization 19 animatedClassName: 'aos-animate', // class applied on animation 20 useClassNames: false, // if true, will add content of `data-aos` as classes on scroll 21 disableMutationObserver: false, // disables automatic mutations' detections (advanced) 22 debounceDelay: 50, // the delay on debounce used while resizing window (advanced) 23 throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced) 24 25 26 // Settings that can be overridden on per-element basis, by `data-aos-*` attributes: 27 offset: 120, // offset (in px) from the original trigger point 28 delay: 0, // values from 0 to 3000, with step 50ms 29 duration: 400, // values from 0 to 3000, with step 50ms 30 easing: 'ease', // default easing for AOS animations 31 once: false, // whether animation should happen only once - while scrolling down 32 mirror: false, // whether elements should animate out while scrolling past them 33 anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation 34}); 35 36(function ($) { 37 "use strict"; 38 39 /*---------- 01. On Load Function ----------*/ 40 $(window).on('load', function () { 41 $('.preloader').fadeOut(); 42 }); 43 44 45 46 /*---------- 02. Preloader ----------*/ 47 if ($('.preloader').length > 0) { 48 $('.preloaderCls').each(function () { 49 $(this).on('click', function (e) { 50 e.preventDefault(); 51 $('.preloader').css('display', 'none'); 52 }) 53 }); 54 }; 55})(jQuery); 56 57var venteduApp = function (){ 58 59 //Private Functions 60 61 //Public Functions 62 return { 63 64 initAos: function(){ 65 AOS.init({ 66 // Global settings: 67 disable: 'mobile', // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function 68 startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on 69 initClassName: 'aos-init', // class applied after initialization 70 animatedClassName: 'aos-animate', // class applied on animation 71 useClassNames: false, // if true, will add content of `data-aos` as classes on scroll 72 disableMutationObserver: false, // disables automatic mutations' detections (advanced) 73 debounceDelay: 50, // the delay on debounce used while resizing window (advanced) 74 throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced) 75 76 77 // Settings that can be overridden on per-element basis, by `data-aos-*` attributes: 78 offset: 120, // offset (in px) from the original trigger point 79 delay: 0, // values from 0 to 3000, with step 50ms 80 duration: 400, // values from 0 to 3000, with step 50ms 81 easing: 'ease', // default easing for AOS animations 82 once: false, // whether animation should happen only once - while scrolling down 83 mirror: false, // whether elements should animate out while scrolling past them 84 anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation 85 }); 86 }, 87 88 initScrollBar: function (){ 89 90 if($("main.home").length > 0){ 91 var scrollWidth = document.querySelector('main.home').scrollWidth; 92 var outerWidth = $("main.home").outerWidth(); 93 var endLimit = scrollWidth-outerWidth; 94 var sectionSize = $('.page').outerWidth(); 95 var tolerance = 250; 96 97 //console.log(sectionSize); 98 99 const ps = new PerfectScrollbar('#main', { 100 //wheelSpeed: 2, 101 wheelPropagation: true, 102 //minScrollbarLength: 20, 103 useBothWheelAxes: true, 104 suppressScrollY: true 105 }); 106 107 $("main.home").scroll(function() { 108 109 scrollTracker = $("main.home").scrollLeft(); 110 111 112 if(scrollTracker >= 120){ 113 $('body').attr("data-active-page",2); 114 }else{ 115 $('body').attr("data-active-page",1); 116 } 117 118 /* 119 if(scrollTracker >= sectionSize-tolerance && scrollTracker <= (sectionSize*1.2)){ 120 $('.page.page-2 .page-header').fadeIn(1000).css("display","flex"); 121 }else{ 122 $('.page.page-2 .page-header').fadeOut(); 123 } 124 */ 125 //console.log(scrollTracker); 126 //console.log('Handler for .scroll() called'); 127 }); 128 } 129 /*
130 $("main.home").mousewheel(function(event, delta) { 131 132 if (($("main.home").innerWidth + $("main.home").scrollX) >= document.body.offsetWidth) 133 { 134 console.log("scroll sonu"); 135 } 136 137 var $elem=$("main.home"); 138 var newScrollLeft = $elem.scrollLeft(), 139 width=$elem.outerWidth(), 140 scrollWidth=$elem.get(0).scrollWidth; 141 if (scrollWidth-newScrollLeft==width) { 142 alert('right end'); 143 } 144 145 scrollTracker = $("main.home").scrollLeft(); 146 if(scrollTracker != 0){ 147 scrollVal += (delta * 80); 148 }else{ 149 scrollVal = 0; 150 } 151 152 console.log(scrollVal); 153 154 if(scrollVal <= -80){ 155 $('body').attr("data-active-page",2); 156 }else{ 157 $('body').attr("data-active-page",1); 158 } 159 160 if(scrollVal <= -880 && scrollVal >= -1120){ 161 $('.page.page-2 .page-header').fadeIn(); 162 }else{ 163 $('.page.page-2 .page-header').fadeOut(); 164 } 165 166 }); 167 168 $("main.home").scroll(function() { 169 $( "#log" ).append( "<div>Handler for .scroll() called.</div>" ); 170 }); 171 */ 172 }, 173 174 initFontSizer: function (el = null){ 175 if($(el).length > 0){ 176 $(el).FontSize({ 177 increaseBtn:'.increase-font', 178 reduceBtn:'.decrease-font' 179 }); 180 } 181 }, 182 183 cyclerInit: function(){ 184 if($('.cycler').length > 0){ 185 $('.cycler').each(function(i, obj) { 186 let item = $(obj).data('item'); 187 let delay = $(obj).data('delay'); 188 189 function cycleImages(){ 190 var $active = $(obj+' .active'); 191 var $next = ($active.next().length > 0) ? $active.next() : $(obj+' '+item+':first'); 192 $next.css('z-index',2);//move the next image up the pile 193 $active.fadeOut(1500,function(){//fade out the top image 194 $active.css('z-index',1).show().removeClass('active');//reset the z-index and unhide the image 195 $next.css('z-index',3).addClass('active');//make the next image the top one 196 }); 197 } 198 199 setInterval('cycleImages()', delay); 200 201 }); 202 } 203 }, 204 205 newsSliderInit: function(){ 206 207 if($('#news_slider_id').length > 0) { 208 209 var next_btn = '.news_slider_id.swiper-button-next'; 210 var prev_btn = '.news_slider_id.swiper-button-prev'; 211 212 let breakpoints = { 213 320 : null, 214 480 : null, 215 640 : null, 216 } 217 218 breakpoints["320"] = { 219 slidesPerView: 1, 220 //navigation: false 221 } 222 breakpoints["480"] = { 223 slidesPerView: 1, 224 //navigation: false 225 } 226 breakpoints["640"] = { 227 slidesPerView: 3, 228 //navigation: false 229 } 230 231 232 let newsSliderInstance = new Swiper('#news_slider_id', { 233 /* 234 scrollbar: { 235 el: ".swiper-scrollbar", 236 hide: false, 237 }, 238 239 */ 240 calculateHeight: true, 241 thumbs: false, 242 autoplay: false, 243 initialSlide: 0, 244 slidesPerView: 3, 245 centeredSlides: false, 246 loop: false, 247 spaceBetween: 15, 248 lazy: true, 249 effect: 0, 250 autoHeight: true, 251 nested: true, 252 //effect: 'fade', 253 //autoHeight: true, 254 navigation: { 255 nextEl: next_btn, 256 prevEl: prev_btn, 257 }, 258 pagination: { 259 el: ".swiper-pagination", 260 //type: 'bullets', 261 dynamicBullets: false, 262 clickable: true 263 }, 264 breakpoints: breakpoints, 265 }); 266 } 267 }, 268 269 sliderInit: function(){ 270 //console.log("Slider Starts"); 271 if($('.ventedu-slider').length > 0){ 272 $('.ventedu-slider').each(function(i, obj) { 273 274 let swiperAnimation = new SwiperAnimation(); 275 276 let id = $(obj).attr('id'); 277 let instance = 'swiper_'+id; 278 let lazyload = $(obj).data('lazyload'); 279 let autoplay = $(obj).data('autoplay'); 280 let pagination = $(obj).data('pagination') ? $(obj).data('pagination') : true; 281 let paginationType = $(obj).data('pagination-type') ? $(obj).data('pagination-type') : 'bullets'; 282 let paginationThumbQty = $(obj).data('pagination-thumb-qty') ? $(obj).data('pagination-thumb-qty') : 0; 283 let navigation = $(obj).data('navigation'); 284 let loop = $(obj).data('loop'); 285 let effect = $(obj).data('effect'); 286 let width = $(obj).data('width'); 287 let height = $(obj).data('height'); 288 let items = $(obj).data('items'); 289 let mobile_items = $(obj).data('mobile-items') ? $(obj).data('mobile-items') : 1; 290 let slide_margin = $(obj).data('slide-margin') ? $(obj).data('slide-margin') : 15; 291 let dynamic_bg = $(obj).data('dynamic-bg') ? $(obj).data('dynamic-bg') : false;
292 let dynamic_bullets = $(obj).data('dynamic-bullets') ? $(obj).data('dynamic-bullets') : false; 293 let animated_slider = $(obj).data('animated') ? $(obj).data('animated') : false; 294 295 let breakpoints = { 296 320 : null, 297 480 : null, 298 640 : null, 299 } 300 301 if(mobile_items){ 302 breakpoints["320"] = { 303 slidesPerView: mobile_items, 304 //navigation: false 305 } 306 breakpoints["480"] = { 307 slidesPerView: mobile_items, 308 //navigation: false 309 } 310 breakpoints["640"] = { 311 slidesPerView: items, 312 //navigation: false 313 } 314 } 315 316 let thumbs = false; 317 if(paginationType === 'thumbs'){ 318 319 let thumbsSwiper = id+'_thumbs'; 320 thumbsSwiper = new Swiper('#'+id+'_thumbs', { 321 loop: loop ? loop : 0, 322 spaceBetween: 10, 323 slidesPerView: paginationThumbQty, 324 freeMode: true, 325 watchSlidesProgress: true, 326 }); 327 328 thumbs = { 329 swiper: thumbsSwiper 330 } 331 } 332 333 var next_btn = '.'+id+'.swiper-button-next'; 334 var prev_btn = '.'+id+'.swiper-button-prev'; 335 var pagination_bar = '.'+id+'.swiper-pagination'; 336 337 $(obj).css('min-height',height); 338 $(obj).css('width',width); 339 340 instance = new Swiper('#'+id, { 341 pagination: { 342 el: pagination_bar, 343 //type: 'bullets', 344 dynamicBullets: dynamic_bullets, 345 clickable: true 346 }, 347 calculateHeight:true, 348 thumbs: thumbs, 349 autoplay: false, 350 slidesPerView: items, 351 loop: loop ? loop : 0, 352 spaceBetween: slide_margin, 353 lazy: lazyload, 354 effect: effect ? effect : 0, 355 autoHeight: height == 'auto' ? true : false, 356 nested: true, 357 //effect: 'fade', 358 //autoHeight: true, 359 navigation: { 360 nextEl: next_btn, 361 prevEl: prev_btn, 362 }, 363 breakpoints: breakpoints, 364 on: { 365 init: function (s) { 366 var index = this.activeIndex; 367 var slide = this.slides[index]; 368 369 if(dynamic_bg){ 370 var bg = $(slide).data('bg'); 371 372 if(bg){ 373 //$('#'+id).parents('section.slider').css('background',bg); 374 $(slide).css('background',bg); 375 }else{ 376 //$('#'+id).parents('section.slider').css('background','transparent'); 377 $(slide).css('background','transparent'); 378 } 379 } 380 381 if(animated_slider){ 382 swiperAnimation.init(this).animate(); 383 } 384 //swiperAnimation.init(this).animate(); 385 386 if(!navigation){ 387 $(next_btn).hide(); 388 $(prev_btn).hide(); 389 } 390 if(!pagination){ 391 $(pagination_bar).hide(); 392 } 393 if(autoplay > 0){ 394 this.params.autoplay.delay = autoplay; 395 this.autoplay.start(); 396 } 397 }, 398 slideChange: function () { 399 400 var index = this.activeIndex; 401 var slide = this.slides[index]; 402 403 if(dynamic_bg){ 404 var bg = $(slide).data('bg'); 405 406 if(bg){ 407 //$('#'+id).parents('section.slider').css('background',bg); 408 $(slide).css('background',bg); 409 }else{ 410 //$('#'+id).parents('section.slider').css('background','transparent'); 411 $(slide).css('background','transparent'); 412 } 413 } 414 415 if(animated_slider){ 416 swiperAnimation.init(this).animate(); 417 } 418 419 //swiperAnimation.init(this).animate(); 420 // hypeDocument.startTimelineNamed('default_hype_container'); 421 } 422 } 423 }); 424 425 }); 426 } 427 }, 428 429 sliderInit_: function(){ 430 //console.log("Slider Starts"); 431 if($('.ventedu-slider').length > 0){ 432 $('.ventedu-slider').each(function(i, obj) { 433 434 var id = $(obj).attr('id'); 435 var instance = 'swiper_'+id; 436 var lazyload = $(obj).data('lazyload'); 437 var autoplay = $(obj).data('autoplay'); 438 var pagination = $(obj).data('pagination'); 439 var navigation = $(obj).data('navigation'); 440 var loop = $(obj).data('loop'); 441 var effect = $(obj).data('effect'); 442 var width = $(obj).data('width'); 443 var height = $(obj).data('height'); 444 var items = $(obj).data('items'); 445 var mobile_items = $(obj).data('mobile-items'); 446 var dynamic_bg = $(obj).data('dynamic-bg'); 447 var dynamic_bullets = $(obj).data('dynamic-bullets'); 448 449 let breakpoints = { 450 320 : null, 451 480 : null, 452 640 : null, 453 } 454 if(mobile_items){ 455 breakpoints["320"] = { 456 slidesPerView: mobile_items, 457 navigation: false 458 } 459 breakpoints["480"] = { 460 slidesPerView: mobile_items, 461 navigation: false 462 } 463 breakpoints["640"] = { 464 slidesPerView: items, 465 navigation: false 466 } 467 } 468 console.log($(obj).attr('id')) 469 /*breakpoints: { 470 640: { 471 slidesPerView: 2, 472 spaceBetween: 20, 473 }, 474 768: { 475 slidesPerView: 4, 476 spaceBetween: 40, 477 }, 478 1024: { 479 slidesPerView: 5, 480 spaceBetween: 50, 481 }, 482 },*/ 483 484 var next_btn = '.'+id+'.swiper-button-next';
485 var prev_btn = '.'+id+'.swiper-button-prev'; 486 var pagination_bar = '.'+id+'.swiper-pagination'; 487 488 $(next_btn).on('click',function (){ 489 console.log($(this)); 490 }); 491 //$(obj).css('height',height); 492 $(obj).css('width',width); 493 494 instance = new Swiper('#'+id, { 495 pagination: { 496 el: pagination_bar, 497 //type: 'bullets', 498 dynamicBullets: dynamic_bullets, 499 clickable: true 500 }, 501 calculateHeight:true, 502 autoplay: false, 503 slidesPerView: items, 504 loop: loop ? loop : 0, 505 spaceBetween: 15, 506 lazy: lazyload, 507 effect: effect ? effect : 0, 508 autoHeight: height == 'auto' ? true : false, 509 nested: true, 510 //effect: 'fade', 511 //autoHeight: true, 512 navigation: { 513 nextEl: next_btn, 514 prevEl: prev_btn, 515 }, 516 breakpoints: breakpoints, 517 on: { 518 init: function (s) { 519 var index = this.activeIndex; 520 var slide = this.slides[index]; 521 522 if(dynamic_bg){ 523 var bg = $(slide).data('bg'); 524 525 if(bg){ 526 //$('#'+id).parents('section.slider').css('background',bg); 527 $(slide).css('background',bg); 528 }else{ 529 //$('#'+id).parents('section.slider').css('background','transparent'); 530 $(slide).css('background','transparent'); 531 } 532 } 533 534 //swiperAnimation.init(this).animate(); 535 536 if(!navigation){ 537 $(next_btn).hide(); 538 $(prev_btn).hide(); 539 } 540 if(!pagination){ 541 $(pagination_bar).hide(); 542 } 543 if(autoplay > 0){ 544 this.params.autoplay.delay = autoplay; 545 this.autoplay.start(); 546 } 547 }, 548 slideChange: function () { 549 550 var index = this.activeIndex; 551 var slide = this.slides[index]; 552 553 if(dynamic_bg){ 554 var bg = $(slide).data('bg'); 555 556 if(bg){ 557 //$('#'+id).parents('section.slider').css('background',bg); 558 $(slide).css('background',bg); 559 }else{ 560 //$('#'+id).parents('section.slider').css('background','transparent'); 561 $(slide).css('background','transparent'); 562 } 563 } 564 565 566 //swiperAnimation.init(this).animate(); 567 // hypeDocument.startTimelineNamed('default_hype_container'); 568 } 569 } 570 }); 571 572 }); 573 } 574 }, 575 576 initNewsPhotoGallery: function (){ 577 578 $('[data-fancybox="gallery"]').fancybox({ 579 thumbs: { 580 autoStart: false, // Display thumbnails on opening 581 hideOnClose: true, // Hide thumbnail grid when closing animation starts 582 parentEl: ".fancybox-container", // Container is injected into this element 583 axis: "x" // Vertical (y) or horizontal (x) scrolling 584 }, 585 loop: true, 586 keyboard: true, 587 arrows: true, 588 buttons: [ 589 "zoom", 590 //"share", 591 "slideShow", 592 "fullScreen", 593 //"download", 594 "thumbs", 595 "close" 596 ] 597 }); 598 599 $('[data-fancybox="video"]').fancybox(); 600 601 /* 602 $(document).on('click', '.news-photos-btn' , function(e) { 603 604 jQuery('[data-fancybox="gallery"]').first().trigger('click'); 605 return false;
606 }); 607 608 609 $(document).on('click', '.news-photos-btn' , function(e) { 610 611 var id = $(this).data('id'); 612 613 console.log(id); 614 //get the group of your fancy elements 615 var fancygroup = $("a[rel=news_gallery]"); 616 617 // get the element you want to focus (e.g the first element) 618 var fancyelem = $(fancygroup.get(id)); 619 620 // simulate a click 621 fancyelem.click(); 622 623 //jQuery('[data-fancybox="gallery"]').first().trigger('click'); 624 return false; 625 }); 626 */ 627 628 $('.news-photos-btn').on('click', function () { 629 630 var id = $(this).data('id'); 631 632 //get the group of your fancy elements 633 var fancygroup = $("a[rel=news_gallery]"); 634 635 // get the element you want to focus (e.g the first element) 636 var fancyelem = $(fancygroup.get(id)); 637 638 //simulate a click 639 fancyelem.click(); 640 641 //jQuery('[data-fancybox="gallery"]').first().trigger('click'); 642 return false; 643 }); 644 }, 645 646 initShareButtons: function (){ 647 648 window.fbAsyncInit = function () { 649 FB.init({ 650 appId: '334280473971122', 651 xfbml: true, 652 version: 'v3.2' 653 }); 654 FB.AppEvents.logPageView(); 655 }; 656 657 (function (d, s, id) { 658 var js, fjs = d.getElementsByTagName(s)[0]; 659 if (d.getElementById(id)) { 660 return; 661 } 662 js = d.createElement(s); 663 js.id = id; 664 js.src = "https://connect.facebook.net/en_US/sdk.js"; 665 fjs.parentNode.insertBefore(js, fjs); 666 }(document, 'script', 'facebook-jssdk')); 667 668 $('.share-on-facebook').on('click', function () { 669 670 FB.ui({ 671 method: 'share', 672 display: 'popup', 673 href: $(this).data("page-url"), 674 }, function (response) {}); 675 676 }); 677 678 $('.popupShare').on('click',function(e){ 679 var width = 575, 680 height = 400, 681 left = ($(window).width() - width) / 2, 682 top = ($(window).height() - height) / 2, 683 url = $(this).data('url'), 684 opts = 'status=1' + 685 ',width=' + width + 686 ',height=' + height + 687 ',top=' + top + 688 ',left=' + left; 689 690 window.open(url, 'twitter', opts); 691 692 return false; 693 }); 694 695 }, 696 697 initCampusSingleVideo: function (){ 698 699 if($('#campusVideoPlayer').length > 0){ 700 const campusPlayer = new Plyr('#campusVideoPlayer',{ 701 autoplay : true, 702 muted: true, 703 controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen'] 704 }); 705 } 706 707 }, 708 sliderGalleryInit: function (){ 709 710 if($('.ventedu-gallery-slider').length > 0){ 711 var landingThreeD = new Swiper('.ventedu-gallery-slider', { 712 //effect: 'coverflow', 713 grabCursor: true, 714 centeredSlides: true, 715 spaceBetween: 15, 716 loop: true, 717 lazy: false, 718 slidesPerView: 'auto', 719 keyboard: { 720 enabled: true, 721 }, 722 navigation: { 723 prevEl: '.gallery_slider_id.swiper-button-prev', 724 nextEl: '.gallery_slider_id.swiper-button-next' 725 }, 726 pagination: { 727 el: '.gallery_slider_id.swiper-pagination', 728 //type: 'bullets', 729 dynamicBullets: true, 730 clickable: true 731 }, 732 breakpoints: { 733 320: { 734 slidesPerView: 3, 735 effect: 0, 736 coverflowEffect: false, 737 centeredSlides: true, 738 spaceBetween: 15 739 }, 740 480: { 741 slidesPerView: 3, 742 effect: 0, 743 coverflowEffect: false, 744 centeredSlides: true, 745 spaceBetween: 15 746 } 747 } 748 }); 749 } //landing quotes 750 751 }, 752 753 sliderCampusGalleryInit: function (){ 754 755 if($('.ventedu-campus-gallery-slider').length > 0){ 756 var landingThreeD = new Swiper('.ventedu-campus-gallery-slider', { 757 //effect: 'coverflow', 758 grabCursor: true, 759 centeredSlides: false, 760 spaceBetween: 15, 761 loop: false, 762 lazy: false, 763 slidesPerView: 1, 764 keyboard: { 765 enabled: true, 766 }, 767 navigation: { 768 prevEl: '.gallery_slider_id.swiper-button-prev', 769 nextEl: '.gallery_slider_id.swiper-button-next' 770 }, 771 pagination: { 772 el: '.gallery_slider_id.swiper-pagination', 773 //type: 'bullets', 774 dynamicBullets: true, 775 clickable: true 776 }, 777 breakpoints: { 778 320: { 779 slidesPerView: 1, 780 effect: 0, 781 coverflowEffect: false, 782 centeredSlides: false, 783 spaceBetween: 15 784 }, 785 480: { 786 slidesPerView: 1, 787 effect: 0, 788 coverflowEffect: false, 789 centeredSlides: false, 790 spaceBetween: 15 791 } 792 } 793 }); 794 } //landing quotes 795 796 }, 797 798 homePageTopMenu: function (){ 799 if($('.home-top-menu').length > 0){ 800 801 $('.home-top-menu').each(function(i, obj) { 802 803 var id = $(obj).attr('id'); 804 805 var first_active = $('ul#'+id).find('li.active'); 806 var menu_opener = $('ul#'+id).parent('nav').find('span.item-placeholder'); 807 var placeholder = $('ul#'+id).parent('nav').find('span.item-placeholder > .text'); 808 809 if(first_active.length > 0){ 810 placeholder.html( first_active.find('a').html()); 811 }else{ 812 placeholder.html('MENÃ'); 813 } 814 menu_opener.on('click',function (e){ 815 816 $('ul#'+id).parent('nav').find('.home-top-menu').show(); 817 818 }); 819 820 $('#'+id).find('li a[data-ajax]').on('click',function (e){ 821 e.preventDefault(); 822 823 var el = $(this); 824 var href = el.attr("href"); 825 826 $.get(href,function (data){ 827 //$(this).closest('.page-content').html(data); 828 //console.log(el.parents('section').closest('.page-content')); 829 el.parents('section').find('.page-content').html(data); 830 el.parents('.home-top-menu').find('li').removeClass('active'); 831 el.parent('li').addClass('active'); 832 placeholder.html(el.html()); 833 834 if($(window).width() < 1441) { 835 $('ul#' + id).parent('nav').find('.home-top-menu').hide(); 836 } 837 }); 838 //console.log('menuye tıklandı'); 839 }); 840 841 if($(window).width() < 1441){ 842 $(document).click(function(e){ 843 var clicked = e.target.className; 844 845 if(clicked !== 'text'){ 846 $('ul#'+id).parent('nav').find('.home-top-menu').hide(); 847 } 848 }); 849 } 850 }); 851 } 852 }, 853 854 initViewer:function (){ 855 856 /* 857 inView('.show-on-scroll').on('enter', el => { 858 el.classList.remove('d-none'); 859 }); 860 */ 861 //inView.threshold(0.5); 862 inView('.show-on-scroll').on('enter', function (el) { 863 //console.log(el); 864 var animationClass = $(el).data("animation"); 865 if(animationClass){ 866 return $(el).removeClass("no-visible").addClass(animationClass); 867 }else{ 868 return $(el).removeClass("no-visible").addClass('animate__animated animate__fadeIn'); 869 } 870 //return el.classList.add(animationClass); 871 //return el.classList.remove("no-visible"); 872 }); 873 874 inView('.show-on-scroll').on('exit', function (el) { 875 //console.log(el); 876 var animationClass = $(el).data("animation"); 877 if(animationClass){ 878 return $(el).addClass("no-visible").removeClass(animationClass); 879 }else{ 880 return $(el).addClass("no-visible").removeClass('animate__animated animate__fadeIn'); 881 } 882 883 //return el.classList.add(animationClass); 884 //return el.classList.remove("no-visible"); 885 }); 886 887 /* 888 inView('section.page').on('enter', function (el) { 889 //console.log(el); 890 var page = $(el).data("page"); 891 return $('body').attr("data-active-page",page); 892 }); 893 */ 894 }, 895 896 onePageNav: function (){ 897 898 var current_url = window.location.href.replace(/\/$/, ""); 899 900 $('.one-page-nav').on('click',function (e){ 901 902 e.preventDefault(); 903 var target = $(this).data('target'); 904 console.log(current_url); 905 console.log(base_url); 906 console.log(target); 907 908 if(current_url != base_url){ 909 910 window.location.href = base_url+'#'+target; 911 912 }else{ 913 914 document.getElementById(target).scrollIntoView(); 915 //$('a.ogrenci-anketleri-tab').tab('show') 916 } 917 918 $(".menu").addClass("slide-out"); 919 $(".menu").removeClass("slide-in"); 920 $(".menu-close").removeClass("close_cover"); 921 $("body").removeClass("overflow-hidden"); 922 $("html").removeClass("overflow-hidden"); 923 924 setTimeout(function () { 925 $(".menu").removeClass("slide-out").addClass("d-none"); 926 }, 600); 927 928 }); 929 }, 930 931 initHomePage : function (){ 932 933 if($('.home-full-page').length > 0){ 934 var swiperAnimation = new SwiperAnimation(); 935 var homePageSwiper = new Swiper(".home-full-page", { 936 //direction: "vertical", 937 slidesPerView: 1, 938 spaceBetween: 30, 939 mousewheel: true, 940 observer: true, 941 pagination: { 942 el: ".swiper-pagination", 943 clickable: true, 944 }, 945 scrollbar: { 946 el: ".swiper-scrollbar", 947 hide: true, 948 }, 949 on: { 950 init: function () { 951 swiperAnimation.init(this).animate(); 952 }, 953 slideChange: function () { 954 955 var index = this.activeIndex; 956 var slide = this.slides[index]; 957 958 $('body').attr("data-active-page",index+1); 959 //console.log(index); 960 //console.log(slide); 961 962 if($(window).width < 1441) { 963 $('.home-top-menu').hide(); 964 } 965 966 swiperAnimation.init(this).animate(); 967 } 968 } 969 }); 970 } 971 }, 972 973 initScroller: function () { 974 975 var scrollWidth = document.querySelector('main.home').scrollWidth; 976 var outerWidth = $("main.home").outerWidth(); 977 var endLimit = scrollWidth-outerWidth; 978 var sectionSize = $('.page').outerWidth(); 979 var tolerance = 250; 980
981 $("main.home").mousewheel(function(event, delta) { 982 983 scrollDelta = delta; 984 this.scrollLeft -= (delta * 120); 985 986 }); 987 988 $("main.home").scroll(function() { 989 990 scrollTracker = $("main.home").scrollLeft(); 991 992 993 if(scrollTracker >= 120){ 994 $('body').attr("data-active-page",2); 995 }else{ 996 $('body').attr("data-active-page",1); 997 } 998 999 /* 1000 if(scrollTracker >= sectionSize-tolerance && scrollTracker <= (sectionSize*1.2)){ 1001 $('.page.page-2 .page-header').fadeIn(1000); 1002 }else{ 1003 $('.page.page-2 .page-header').fadeOut(); 1004 } 1005 */ 1006 1007 //console.log(scrollTracker); 1008 //console.log('Handler for .scroll() called'); 1009 }); 1010 1011 }, 1012 1013 wowInit: function (){ 1014 1015 var wow = new WOW({ 1016 boxClass: 'wow', 1017 animateClass: 'animate__animated', 1018 offset: 0, 1019 mobile: false, 1020 live: true 1021 }); 1022 wow.init(); 1023 //console.log("Wow Init"); 1024 }, 1025 1026 playButtonTilt: function (){ 1027 if($('.tilt-button').lenght){ 1028 $('.tilt-button').tilt({ 1029 scale: 1.2 1030 }) 1031 } 1032 }, 1033 1034 siteMenu: function (){ 1035 1036 /* 1037 $(window).scroll(function(){ 1038 var scrollTop = 100; 1039 if($(window).scrollTop() >= scrollTop){ 1040 $('#menuToggle').css({ 1041 //background : '#132d52' 1042 }); 1043 $('#scrollDown').fadeOut(200); 1044 } 1045 if($(window).scrollTop() < scrollTop){ 1046 $('#menuToggle').removeAttr('style'); 1047 $('#scrollDown').fadeIn(200); 1048 } 1049 }) 1050*/ 1051 $('.menu-opener').on('click', function(e) { 1052 e.preventDefault(); 1053 $('body').toggleClass('menu-active'); 1054 }); 1055 $('.menu-bg-overlay').on('click', function(e) { 1056 e.preventDefault(); 1057 $('body').toggleClass('menu-active'); 1058 }); 1059 /* 1060 $('.menu-opener').on('click', function() { 1061 $('.menu.navigation > li').removeClass('opened'); 1062 $('.dropdown-main-menu').toggleClass('opened'); 1063 $('body').toggleClass('has-menu'); 1064 }); 1065 1066 $('.menu-backdrop').on('click', function() { 1067 $('.dropdown-main-menu').toggleClass('opened'); 1068 $('body').toggleClass('has-menu'); 1069 }); 1070 */ 1071 //Save cookie for selected menu item 1072 $('.main-menu > li.menu-item > a').on('click', function() { 1073 1074 let clickedMainMenuItemID = $(this).parents('li').data('section-id') 1075 Cookies.set('clickedMainMenuItemID', clickedMainMenuItemID, { expires: 1, secure: true }); 1076 console.log(clickedMainMenuItemID) 1077 Cookies.remove('selectedMenuItem'); 1078 }) 1079 1080 1081 $('.main-menu > li.dropdown > a').on('click', function() { 1082 1083 //$('.sidebar-menu-items > li.acc').removeClass('opened'); 1084 if($(this).parents('li').hasClass('dropdown') && $(this).parents('li').hasClass('opened')){ 1085 console.log("state 1") 1086 $(this).parents('li').removeClass('opened'); 1087 $('body').toggleClass('has-menu'); 1088 }else if($(this).parents('li').hasClass('dropdown') && !$(this).parents('li').hasClass('opened')){ 1089 console.log("state 2") 1090 $(this).parents('li').toggleClass('opened'); 1091 $('body').toggleClass('has-menu'); 1092 }else{ 1093 console.log("state 3") 1094 $(this).parents('li').removeClass('opened'); 1095 $('body').toggleClass('has-menu'); 1096 } 1097 1098 }); 1099 $('.sidebar-menu-items > li.dropdown > a').on('click', function() { 1100 1101 1102 if($(this).parents('li').hasClass('dropdown') && $(this).parents('li').hasClass('opened')){ 1103 console.log("state 1") 1104 $(this).parents('li').removeClass('opened'); 1105 }else if($(this).parents('li').hasClass('dropdown') && !$(this).parents('li').hasClass('opened')){ 1106 console.log("state 2") 1107 $('.sidebar-menu-items > li.dropdown').removeClass('opened'); 1108 $(this).parents('li').toggleClass('opened'); 1109 }else{ 1110 console.log("state 3") 1111 $(this).parents('li').removeClass('opened'); 1112 } 1113 1114 }); 1115 1116 $('.sidebar-menu-items li.menu-item > a').on('click', function() { 1117 1118 let selectedMenuItemID = $(this).parents('li').data('section-id') 1119 Cookies.set('selectedMenuItem', selectedMenuItemID, { expires: 1, secure: true }); 1120 //console.log(selectedMenuItemID) 1121 }) 1122 1123 $('.page-inside-content-box > a').on('click', function() { 1124 1125 let selectedMenuItemID = $(this).data('section-id') 1126 Cookies.set('selectedMenuItem', selectedMenuItemID, { expires: 1, secure: true }); 1127 //console.log(selectedMenuItemID) 1128 }) 1129 1130 //console.log(Cookies.get('selectedMenuItem')); 1131 //console.log(Cookies.get('clickedMainMenuItemID')); 1132 if(Cookies.get('selectedMenuItem')){ 1133 1134 /* 1135 if(Cookies.get('clickedMainMenuItemID') === Cookies.get('selectedMenuItem')){ 1136 let clickedMenuChecker = $('.sidebar-menu-items').find('li[data-section-id="'+Cookie
1136s.get('clickedMainMenuItemID')+'"]'); 1137 if(clickedMenuChecker.length > 0){ 1138 clickedMenuChecker.addClass('opened'); 1139 } 1140 } 1141 1142 */ 1143 if($('li[data-section-id="'+Cookies.get('selectedMenuItem')+'"]').length > 0){ 1144 let getSelectedEl = $('li[data-section-id="'+Cookies.get('selectedMenuItem')+'"]'); 1145 getSelectedEl.addClass('active'); 1146 if(getSelectedEl.hasClass('dropdown')){ 1147 getSelectedEl.addClass('opened') 1148 }else if(getSelectedEl.parents('li').hasClass('dropdown')){ 1149 getSelectedEl.parents('li.dropdown').addClass('opened').addClass('active') 1150 } 1151 }else{ 1152 Cookies.remove('selectedMenuItem'); 1153 } 1154 1155 } 1156 $(document).on("click", function(event){ 1157 var $trigger = $(".main-menu > li.opened"); 1158 if($trigger !== event.target && !$trigger.has(event.target).length){ 1159 $(this).find(".main-menu > li.dropdown.opened").toggleClass('opened'); 1160 $(".main-menu > li.dropdown.opened > ul").slideUp("fast"); 1161 } 1162 }); 1163 1164 /* 1165 if($('body').hasClass('has-menu')){ 1166 1167 $('.menu-backdrop').on('click', function() { 1168 $('.dropdown-main-menu').toggleClass('opened'); 1169 $('body').toggleClass('has-menu'); 1170 }); 1171 1172 $('.pbmit-header-overlay').on('click', function() { 1173 $('.dropdown-main-menu').toggleClass('opened'); 1174 $('body').toggleClass('has-menu'); 1175 }); 1176 } 1177 */ 1178 //Run only mobile 1179 if($(window).width() < 750){ 1180 window.addEventListener("scroll", function() { 1181 if (document.body.scrollTop > 10 || document.documentElement.scrollTop > 10) { 1182 document.getElementById("header").style.boxShadow = "rgb(0 0 0 / 19%) 0px 2px 6px 0px"; 1183 } else { 1184 document.getElementById("header").style.boxShadow = "none"; 1185 } 1186 }); 1187 } 1188 1189 }, 1190 1191 toogleSearch: function (){ 1192 const $searchButton = $('.search-button'); 1193 const $searchButtonIcon = $('.search-button').find('i'); 1194 const $searchArea = $('.search-wrapper'); 1195 1196 //console.log($searchButtonIcon); 1197 if($searchArea.hasClass('open')){ 1198 $searchArea.removeClass('open'); 1199 $searchButton.removeClass('active'); 1200 $searchButtonIcon.removeClass('fa-times').addClass('fa-search'); 1201 }else{ 1202 $searchArea.addClass('open'); 1203 $searchButton.addClass('active'); 1204 $searchButtonIcon.removeClass('fa-search').addClass('fa-times'); 1205 } 1206 }, 1207 1208 toogleMenu: function (){ 1209 1210 const $menu = $('#menu'); 1211 const $menuOpener = $('#menuOpener'); 1212 const $menuToggle = $('#menuToggle'); 1213 1214 if($menuToggle.hasClass('active')){ 1215 1216 $menu.removeClass('active'); 1217 $menuToggle.removeClass('active'); 1218 $menuOpener.attr("checked",false) 1219 $menuOpener.removeClass("checked") 1220 1221 }else{ 1222 1223 $menu.addClass('active'); 1224 $menuToggle.addClass('active'); 1225 $menuOpener.attr("checked",true) 1226 $menuOpener.addClass("checked") 1227 } 1228 1229 1230 /* 1231 $(document).mouseup(e => { 1232 if (!$menu.is(e.target) // if the target of the click isn't the container... 1233 && $menu.has(e.target).length === 0) // ... nor a descendant of the container 1234 { 1235 $menuOpener.attr("checked",false) 1236 } 1237 }); 1238 */ 1239 }, 1240 1241 closeMenu: function (){ 1242 1243 window.addEventListener('click', function(e){ 1244 if (!document.getElementById('menuToggle').contains(e.target)){ 1245 const $menu = $('#menu'); 1246 const $menuOpener = $('#menuOpener'); 1247 const $menuToggle = $('#menuToggle'); 1248 1249 $menu.removeClass('active'); 1250 $menuToggle.removeClass('active'); 1251 $menuOpener.attr("checked",false) 1252 $menuOpener.removeClass("checked") 1253 } 1254 }) 1255 }, 1256 1257 contactMap: function (el = 'contact-map'){ 1258 1259 if($("."+el).length > 0){ 1260 1261 var lat = $("."+el).data("lat"); 1262 var lng = $("."+el).data("lng"); 1263 var zoom = $("."+el).data("zoom"); 1264 var icon = storage_url+'/images/icons/map-pin.png'; 1265 1266 if($("."+el).data("marker")){ 1267 icon = $("."+el).data("marker"); 1268 } 1269 ymaps.ready(init); 1270
1271 function init() { 1272 var myMap = new ymaps.Map(el, { 1273 center: [lat,lng], 1274 zoom: zoom, 1275 controls: ["zoomControl"] 1276 }, { 1277 searchControlProvider: 'yandex#search' 1278 }), 1279 1280 // Creating a geo object with the "Point" geometry type. 1281 myGeoObject = new ymaps.GeoObject({ 1282 // The geometry description. 1283 geometry: { 1284 type: "Point", 1285 coordinates: [lat,lng] 1286 }, 1287 // Properties. 1288 /* 1289 properties: { 1290 balloonContentHeader: "", 1291 balloonContentBody: "", 1292 // The placemark content. 1293 //iconContent: 'I\'m draggable', 1294 hintContent: "" 1295 } 1296 */ 1297 }, { 1298 iconLayout: 'default#image', 1299 iconImageHref: icon, 1300 iconImageSize: [100, 100], 1301 iconImageOffset: [-30, -80], 1302 draggable: false 1303 }); 1304 1305 myMap.geoObjects.add(myGeoObject); 1306 myMap.behaviors.disable('scrollZoom'); 1307 //myMap.geoObjects.add(myGeoObject); 1308 } 1309 } 1310 1311 }, 1312 1313 initPopupForm: function (){ 1314 $('.popup-form-closer').on('click',function (){ 1315 $(this).parents('.popup-form-module').fadeOut(500); 1316 $('body').removeClass('popup-form-active'); 1317 $('.popup-form-opener').show(); 1318 }); 1319 $('.popup-form-opener').on('click',function (){ 1320 var target = $(this).data('target'); 1321 $('body').addClass('popup-form-active'); 1322 $('#'+target).show(); 1323 $(this).fadeOut(500); 1324 }); 1325 }, 1326 1327 initCampusMap: function () { 1328 //Google Map Init 1329 let map; 1330 if($('.campus-map').length > 0) { 1331 1332 var lat = $('.campus-map').data("lat"); 1333 var lng = $('.campus-map').data("lng"); 1334 var zoom = $('.campus-map').data("zoom"); 1335 var name = $('.campus-map').data("name"); 1336 1337 async function initMap() { 1338 const {Map} = await google.maps.importLibrary("maps"); 1339 1340 map = new Map(document.getElementById("campus-map"), { 1341 center: {lat: lat, lng: lng}, 1342 zoom: zoom, 1343 mapTypeId: google.maps.MapTypeId.ROADMAP, 1344 styles: [ 1345 { 1346 "featureType": "administrative", 1347 "elementType": "all", 1348 "stylers": [ 1349 { 1350 "saturation": "-100" 1351 } 1352 ] 1353 }, 1354 { 1355 "featureType": "administrative.province", 1356 "elementType": "all", 1357 "stylers": [ 1358 { 1359 "visibility": "off" 1360 } 1361 ] 1362 }, 1363 { 1364 "featureType": "landscape", 1365 "elementType": "all", 1366 "stylers": [ 1367 { 1368 "saturation": -100 1369 }, 1370 { 1371 "lightness": 65 1372 }, 1373 { 1374 "visibility": "on" 1375 } 1376 ] 1377 }, 1378 { 1379 "featureType": "poi", 1380 "elementType": "all", 1381 "stylers": [ 1382 { 1383 "saturation": -100 1384 }, 1385 { 1386 "lightness": "50" 1387 }, 1388 { 1389 "visibility": "simplified" 1390 } 1391 ] 1392 }, 1393 { 1394 "featureType": "road", 1395 "elementType": "all", 1396 "stylers": [ 1397 { 1398 "saturation": "-100" 1399 } 1400 ] 1401 }, 1402 { 1403 "featureType": "road.highway", 1404 "elementType": "all", 1405 "stylers": [ 1406 { 1407 "visibility": "simplified" 1408 } 1409 ] 1410 }, 1411 { 1412 "featureType": "road.arterial", 1413 "elementType": "all", 1414 "stylers": [ 1415 { 1416 "lightness": "30" 1417 } 1418 ] 1419 }, 1420 { 1421 "featureType": "road.local", 1422 "elementType": "all", 1423 "stylers": [ 1424 { 1425 "lightness": "40" 1426 } 1427 ] 1428 }, 1429 { 1430 "featureType": "transit", 1431 "elementType": "all", 1432 "stylers": [ 1433 { 1434 "saturation": -100 1435 }, 1436 { 1437 "visibility": "simplified" 1438 } 1439 ] 1440 }, 1441 { 1442 "featureType": "water", 1443 "elementType": "geometry", 1444 "stylers": [ 1445 { 1446 "hue": "#ffff00" 1447 }, 1448 { 1449 "lightness": -25 1450 }, 1451 { 1452 "saturation": -97 1453 } 1454 ] 1455 }, 1456 { 1457 "featureType": "water", 1458 "elementType": "labels", 1459 "stylers": [ 1460 { 1461 "lightness": -25 1462 }, 1463 { 1464 "saturation": -100 1465 } 1466 ] 1467 } 1468 ], 1469 }); 1470 1471 var infoWindow = new google.maps.InfoWindow(); 1472 1473 var latlngbounds = new google.maps.LatLngBounds(); 1474 1475 var myLatlng = new google.maps.LatLng(lat, lng); 1476 1477 var strMarker = storage_url + '/images/icons/map-pin.png'; 1478 //if (data.musteritipi == 1) strMarker = 'img/ico-marker1.png'; 1479 1480 var markerIcon = { 1481 url: strMarker 1482 }; 1483 // console.log(data); 1484 var marker = new google.maps.Marker({ 1485 position: myLatlng, 1486 map: map, 1487 title: name, 1488 icon: markerIcon 1489 1490 }); 1491 latlngbounds.extend(marker.position); 1492 1493 //Get the boundaries of the Map. 1494 var bounds = new google.maps.LatLngBounds(); 1495 1496 //Center map and adjust Zoom based on the position of all markers. 1497 map.setCenter(latlngbounds.getCenter()); 1498 //map.fitBounds(latlngbounds); 1499 } 1500 1501 1502 initMap(); 1503 } 1504 }, 1505 1506 campusLevelsSideMenu: function (){ 1507 1508 if($('.sch-levels-menu').length > 0 && typeof campusLevels !== 'undefined'){ 1509 $('.sch-levels-menu li').each(function (){ 1510 var level = $(this).find('a').data('name'); 1511 //console.log(campusLevels); 1512 //console.log(level); 1513 1514 //Check string is in array 1515 if($.inArray(level, campusLevels) !== -1){ 1516 $('.sch-levels-menu li').fadeIn(); 1517 }else{ 1518 $(this).remove(); 1519 } 1520 }) 1521 }else{ 1522 $('.sch-levels-menu li').fadeIn(); 1523 } 1524 }, 1525 1526 openCloseToogler: function (){ 1527 1528 //Select element by data attribute 1529 $('[data-toggler]').on('click', function () { 1530 1531 let openClass = $(this).data('open-class'); 1532 let closeClass = $(this).data('close-class'); 1533 let target = $(this).data('target'); 1534 let targetEl = $(target); 1535 1536 if (!targetEl.hasClass(openClass) && !targetEl.hasClass(closeClass)) { 1537 targetEl.addClass(closeClass); 1538 } 1539 if (targetEl.hasClass(openClass)) { 1540 targetEl.removeClass(openClass).addClass(closeClass); 1541 }else if (targetEl.hasClass(closeClass)) { 1542 targetEl.removeClass(closeClass).addClass(openClass); 1543 } 1544 }); 1545 1546 }, 1547 initCampusMapYandex: function (){ 1548 1549 if($('.campus-map').length > 0){ 1550 1551 var lat = $('.campus-map').data("lat"); 1552 var lng = $('.campus-map').data("lng"); 1553 var zoom = $('.campus-map').data("zoom"); 1554 1555 ymaps.ready(init); 1556
1557 function init() { 1558 var myMap = new ymaps.Map("campus-map", { 1559 center: [lat,lng], 1560 zoom: zoom, 1561 controls: ["zoomControl"] 1562 }, { 1563 searchControlProvider: 'yandex#search' 1564 }), 1565 1566 // Creating a geo object with the "Point" geometry type. 1567 myGeoObject = new ymaps.GeoObject({ 1568 // The geometry description. 1569 geometry: { 1570 type: "Point", 1571 coordinates: [lat,lng] 1572 }, 1573 // Properties. 1574 /* 1575 properties: { 1576 balloonContentHeader: "", 1577 balloonContentBody: "", 1578 // The placemark content. 1579 //iconContent: 'I\'m draggable', 1580 hintContent: "" 1581 } 1582 */ 1583 }, { 1584 iconLayout: 'default#image', 1585 iconImageHref: storage_url+'/images/icons/map-pin.png', 1586 iconImageSize: [100, 100], 1587 iconImageOffset: [-30, -80], 1588 draggable: false 1589 }); 1590 1591 myMap.geoObjects.add(myGeoObject); 1592 } 1593 } 1594 1595 }, 1596 1597 initPopup: function (popup){ 1598 1599 /* Add div inside popup for layout if one doesn't exist */ 1600 if ($(".wrapper").length == 0){ 1601 $(popup).wrapInner("<div class='wrapper'></div>"); 1602 } 1603 1604 if(Cookies.get('_popup_'+$(popup).data('popup-id')) != 1){ 1605 /* Open popup */ 1606 $(popup).show(); 1607 } 1608 1609 /* Close popup if user clicks on background */ 1610 $(popup).click(function(e) { 1611 if ( e.target == this ) { 1612 if ($(popup).is(':visible')) { 1613 1614 $(popup).hide(); 1615 1616 var youtubeIframeId = $('iframe#player'); 1617 youtubeIframeId.attr('src', ''); 1618 1619 } 1620 } 1621 }); 1622 1623 /* Close popup and remove errors if user clicks on cancel or close buttons */ 1624 $(popup).find("button[name=close]").on("click", function() { 1625 if ($(".formElementError").is(':visible')) { 1626 $(".formElementError").remove(); 1627 } 1628 1629 var youtubeIframeId = $('iframe#player'); 1630 youtubeIframeId.attr('src', ''); 1631 1632 $(popup).hide(); 1633 1634 }); 1635 1636 $('.close-popup').on('click',function () { 1637 1638 Cookies.set('_popup_'+$(this).data('popup-id'), '1', { expires: 1, secure: true }); 1639 $('.popup-window').hide(); 1640 1641 }); 1642 }, 1643 1644 initVideoBg: function(){ 1645 1646 if($('#homeVideoBg').length){ 1647 1648 const homeVideoBg = new Plyr('#homeVideoBg',{ 1649 autoplay : true, 1650 muted: true, 1651 controls: true 1652 }); 1653 1654 $('.video-bg').mouseenter(function (){ 1655 homeVideoBg.play(); 1656 }); 1657 } 1658 1659 }, 1660 1661 initHomeVerticalVideo: function(){ 1662 1663 if($('#homeVerVideoPlayer').length){ 1664 1665 const homeVerVideoPlayer = new Plyr('#homeVerVideoPlayer',{ 1666 autoplay : true, 1667 muted: true, 1668 controls: false 1669 }); 1670 1671 $('.homepage-vertical-video-wrapper').mouseenter(function (){ 1672 homeVerVideoPlayer.play(); 1673 }); 1674 } 1675 1676 }, 1677 1678 initAjaxModal: function (){ 1679 $("#ajaxModal").on("show.bs.modal", function(e) { 1680 var link = $(e.relatedTarget); 1681 if(link[0].hasAttribute("title")){
1682 $(this).find(".modal-title").html(link.attr("title")); 1683 } 1684 $(this).find(".modal-body").load(link.attr("href")); 1685 }); 1686 }, 1687 1688 showTooltip: function(evt, text) { 1689 let tooltip = document.getElementById("city-name"); 1690 tooltip.innerHTML = text; 1691 tooltip.style.display = "block"; 1692 tooltip.style.left = evt.pageX + 10 + 'px'; 1693 tooltip.style.top = evt.pageY + 10 + 'px'; 1694 }, 1695 1696 hideTooltip: function() { 1697 var tooltip = document.getElementById("city-name"); 1698 tooltip.style.display = "none"; 1699 }, 1700 1701 1702 svgTurkeyMap: function(){ 1703 1704 if($('#svg-turkiye-haritasi').length > 0){ 1705 const element = document.querySelector('#svg-turkiye-haritasi'); 1706 const info = document.querySelector('.il-isimleri'); 1707 const detail = document.querySelector('.city-santrals-details'); 1708 const closeDetail = detail.querySelector('.detail-close-btn'); 1709 const santralImage = detail.querySelector('.santral-image-area'); 1710 1711 element.addEventListener( 1712 'mouseover', 1713 function (event) { 1714 if (event.target.tagName === 'path' && event.target.parentNode.id !== 'guney-kibris') { 1715 info.innerHTML = [ 1716 '<div>', 1717 event.target.parentNode.getAttribute('data-iladi'), 1718 '</div>' 1719 ].join(''); 1720 1721 const santralTypes = event.target.parentNode.getAttribute('data-santral-types'); 1722 1723 if(santralTypes){ 1724 info.classList.add(santralTypes); 1725 } 1726 } 1727 } 1728 ); 1729 1730 const handleEvent = (event) => 1731 { 1732 const bounds = event.currentTarget.getBoundingClientRect(); 1733 const x = event.clientX - (bounds.left); 1734 const y = event.clientY - (bounds.top + 50); 1735 // Now x and y are the relative coordinates. 1736 info.style.top = y + 'px'; 1737 info.style.left = x + 'px'; 1738 } 1739 1740 var elem = document.getElementById('#santral-map-wrapper'); 1741 element.addEventListener('mousemove', handleEvent, false); 1742 /* 1743 element.addEventListener( 1744 'mousemove', 1745 function (event) { 1746 //console.log(event.clientX); 1747 // console.log(event.clientY); 1748 info.style.top = event.clientY - 50 + 'px'; 1749 info.style.left = event.clientX + 'px'; 1750 } 1751 ); 1752 */ 1753 1754 element.addEventListener( 1755 'mouseout', 1756 function (event) { 1757 info.innerHTML = ''; 1758 1759 const santralTypes = event.target.parentNode.getAttribute('data-santral-types'); 1760 1761 if(santralTypes){ 1762 info.classList.remove(santralTypes); 1763 } 1764 } 1765 ); 1766 1767 element.addEventListener( 1768 'click', 1769 function (event) { 1770 if (event.target.tagName === 'path') { 1771 const parent = event.target.parentNode; 1772 const id = parent.getAttribute('id'); 1773 const citySantral = parent.getAttribute('data-santral-types'); 1774 const cityName = parent.getAttribute('data-iladi'); 1775 const cityId = parent.getAttribute('data-ilid'); 1776 const cityPlaka = parent.getAttribute('data-plakakodu'); 1777 if(citySantral){ 1778 1779 let counter = 0; 1780 const santralList = parent.getAttribute('data-santrals'); 1781 1782 //Parse JSON 1783 const santralListJson = JSON.parse(santralList); 1784 1785 //Make Html List from JSON 1786 let santralListHtml = '<div class="santral-list">'; 1787 santralListHtml += '<ul>'; 1788 santralListJson.forEach(function (item){ 1789 santralListHtml += '<li class="'+item.seo_slug+'">'; 1790 santralListHtml += '<h5>
1790'+item.location_name+'</h5>'; 1791 santralListHtml += '<p>Kurulu Güç: '+parseFloat(item.total_power.toString())+' MW</p>'; 1792 santralListHtml += '</li>'; 1793 1794 if (counter === 0) { 1795 1796 //Place Image as div background 1797 if(item.santral_image){ 1798 santralImage.style.backgroundImage = 'url('+storage_url+'/santrals/'+item.santral_cid+'/'+item.santral_image+')'; 1799 1800 }else { 1801 //hide image area 1802 santralImage.style.backgroundImage = 'url(' + assets_url + '/images/placeholders/img-placeholder.jpg)'; 1803 } 1804 1805 //santralImage.innerHTML = '<img src="'+storage_url+'/santrals/'+item.santral_cid+'/'+item.santral_image+'" alt="" class="img-fluid">'; 1806 } 1807 counter++; 1808 }); 1809 santralListHtml += '</ul>'; 1810 santralListHtml += '</div>'; 1811 1812 detail.classList.add('active'); 1813 detail.querySelector('.city-name-text').innerHTML = cityName; 1814 detail.querySelector('.body-wrapper').innerHTML = santralListHtml; 1815 } 1816 1817 1818 //Find city name 1819 1820 1821 1822 //Write city name 1823 1824 1825 /* 1826 if ( 1827 id === 'guney-kibris' 1828 ) { 1829 return; 1830 } 1831 1832 window.location.href = ( 1833 '#' 1834 + id 1835 + '-' 1836 + parent.getAttribute('data-plakakodu') 1837 ); 1838 */ 1839 1840 } 1841 } 1842 ); 1843 1844 closeDetail.addEventListener( 1845 'click', 1846 function (event) { 1847 detail.classList.remove('active'); 1848 } 1849 ); 1850 } 1851 1852 }, 1853 updateQueryStringParameter: function(uri, key, value) { 1854 // Use window URL if no query string is provided 1855 if ( ! uri ) { uri = window.location.href; } 1856 1857 // Create a dummy element to parse the URI with 1858 var a = document.createElement( 'a' ), 1859 1860 // match the key, optional square brackets, an equals sign or end of string, the optional value 1861 reg_ex = new RegExp( key + '((?:\\[[^\\]]*\\])?)(=|$)(.*)' ), 1862 1863 // Setup some additional variables 1864 qs, 1865 qs_len, 1866 key_found = false; 1867 1868 // Use the JS API to parse the URI 1869 a.href = uri; 1870 1871 // If the URI doesn't have a query string, add it and return 1872 if ( ! a.search ) { 1873 1874 a.search = '?' + key + '=' + value; 1875 1876 return a.href; 1877 } 1878 1879 // Split the query string by ampersands 1880 qs = a.search.replace( /^\?/, '' ).split( /&(?:amp;)?/ ); 1881 qs_len = qs.length; 1882 1883 // Loop through each query string part 1884 while ( qs_len > 0 ) { 1885 1886 qs_len--; 1887 1888 // Remove empty elements to prevent double ampersands 1889 if ( ! qs[qs_len] ) { qs.splice(qs_len, 1); continue; } 1890 1891 // Check if the current part matches our key 1892 if ( reg_ex.test( qs[qs_len] ) ) { 1893 1894 //console.log(value); 1895 1896 if(value){ 1897 // Replace the current value 1898 qs[qs_len] = qs[qs_len].replace( reg_ex, key + '$1' ) + '=' + value; 1899 }else{ 1900 qs.splice(qs_len, 1); 1901 } 1902 1903 key_found = true; 1904 } 1905 } 1906 1907 // If we haven't replaced any occurrences above, add the new parameter and value 1908 if ( ! key_found ) { qs.push( key + '=' + value ); } 1909 1910 // Set the new query string 1911 a.search = '?' + qs.join( '&' ); 1912 1913 return a.href; 1914 }, 1915 1916 staffLevelFilter: function (){ 1917 1918 $('#staff_related_level').on('change',function(){ 1919 var level = $(this).val(); 1920 var newUrl = venteduApp.updateQueryStringParameter(window.location.href,'level', level); 1921 window.location.href = newUrl 1922 //console.log(newUrl); 1923 }); 1924 }, 1925 staffCatsFilter: function (){ 1926 1927 $('#staff_related_cats').on('change',function(){ 1928 var level = $(this).val(); 1929 var newUrl = venteduApp.updateQueryStringParameter(window.location.href,'cats', level); 1930 window.location.href = newUrl 1931 //console.log(newUrl); 1932 }); 1933 }, 1934 1935 initSearchBox: function (){ 1936 function searchToggle(obj, evt){ 1937 var container = $(obj).closest('.search-wrapper'); 1938 if(!container.hasClass('active')){ 1939 container.addClass('active'); 1940 evt.preventDefault(); 1941 } 1942 else if(container.hasClass('active') && $(obj).closest('.input-holder').length == 0){ 1943 container.removeClass('active'); 1944 // clear input 1945 container.find('.search-input').val(''); 1946 } 1947 } 1948 }, 1949 1950 galleryCardEffect: function (){ 1951 1952 var $card = $(".photo-gallery-card"), 1953 $cardTitle = $(".card-title"), 1954 $cardSubtitle = $(".card-subtitle"), 1955 $cardShine = $(".card-shine"), 1956 $cardShadow = $(".photo-gallery-card-shadow"), 1957 currentMousePos = { x: 0, y: 0 }, 1958 mouseFromCenter = { x: 0, y: 0 }; 1959 1960 $(".photo-gallery-card").mousemove(function (event) { 1961 var wHeight = $(window).height(), 1962 wWidth = $(window).width(); 1963 1964 currentMousePos.x = event.pageX; 1965 currentMousePos.y = event.pageY; 1966 mouseFromCenter.x = currentMousePos.x - wWidth / 2; 1967 mouseFromCenter.y = currentMousePos.y - wHeight / 2; 1968
1969 var around1 = -1 * (((currentMousePos.y * 100) / wHeight) * 0.2 - 10) + "deg", 1970 around2 = 1 * (((currentMousePos.x * 100) / wWidth) * 0.2 - 10) + "deg", 1971 trans1 = (currentMousePos.x / wHeight) * 0.3 + "px", 1972 trans2 = (currentMousePos.y / wHeight) * 0.3 + "px", 1973 dy = event.pageY - wHeight / 2, //@h/2 = center of poster 1974 dx = event.pageX - wWidth / 2, //@w/2 = center of poster 1975 theta = Math.atan2(dy, dx), // angle between cursor and center of poster in RAD 1976 angle = (theta * 180) / Math.PI - 90, 1977 mousePositionX = (currentMousePos.x / wWidth) * 100, 1978 mousePositionY = 50 + (currentMousePos.y / wHeight) * 10; 1979 1980 // gradient angle and opacity for card shine effect 1981 /* 1982 $(this).find(".card-shine").css( 1983 "background", 1984 "linear-gradient(" + 1985 angle + 1986 "deg, rgba(255,255,255," + 1987 (currentMousePos.y / wHeight) * 0.7 + 1988 ") 0%,rgba(255,255,255, 0) 80%)" 1989 ); 1990 1991 */ 1992 // card pos and angle 1993 $(this).css({ 1994 "-webkit-transform": 1995 "translate3d(" + 1996 trans1 + 1997 ", " + 1998 trans2 + 1999 ", 0) scale(1) rotatex(" + 2000 around1 + 2001 ") rotatey(" + 2002 around2 + 2003 ")", 2004 "background-position": 2005 mousePositionX + "%" + " " + (currentMousePos.y / wHeight) * 50 + "%" 2006 }); 2007 // card shadow pos and angle 2008 /* 2009 $(this).find(".card-title").css({ 2010 transform: 2011 "scale(.9,.9) translateX(" + 2012 (mouseFromCenter.x * -0.02 + 12) + 2013 "px) translateY(" + 2014 (mouseFromCenter.y * -0.02 + 12) + 2015 "px) scale(1.0) rotateY(" + 2016 (mouseFromCenter.x / 25) * 0.5 + 2017 "deg) rotateX(" + 2018 mouseFromCenter.y / -25 + 2019 "deg)" 2020 }); 2021 2022 $(this).find(".card-subtitle").css({ 2023 transform: 2024 "translateX(" + 2025 (mouseFromCenter.x / 25) * 0.7 + 2026 "px) translateY(" + 2027 (mouseFromCenter.y / 25) * 1.65 + 2028 "px)" 2029 }); 2030 2031 */ 2032 2033 $(this).find(".photo-gallery-card-shadow").css({ 2034 transform: 2035 "translateX(" + 2036 (mouseFromCenter.x / 25) * 0.5 + 2037 "px) translateY(" + 2038 (mouseFromCenter.y / 25) * 1.15 + 2039 "px) translateZ(60px)" 2040 }); 2041 }); 2042 2043 $(".photo-gallery-card").mouseleave(function (event) { 2044 $(this).css({ 2045 "-webkit-transform": 2046 "translate3d(" + 2047 0 + 2048 ", " + 2049 0 + 2050 ", 0) scale(1) rotatex(" + 2051 0 + 2052 ") rotatey(" + 2053 0 + 2054 ")", 2055 "background-position": 0 + "%" + " " + (0 / 0) * 0 + "%" 2056 }); 2057 }); 2058 }, 2059 2060 initPageSubMenu: function (){ 2061 2062 if($('.sub-menu-opener').length > 0) { 2063 2064 $(".sub-menu-opener").click(function () { 2065 $(this).next('div.sub-nav').toggle(); 2066 }); 2067 } 2068 2069 }, 2070 2071 initSidebarOpener: function (){ 2072 if($('.sidebar-title').length > 0) { 2073 2074 $(".sidebar-title").click(function () { 2075 $(this).toggleClass('opened'); 2076 if( $(".sidebar-title").next('div').hasClass('opened')){ 2077 $(".sidebar-title").next('div').removeClass('opened').addClass('closed'); 2078 }else{ 2079 $(".sidebar-title").next('div').addClass('opened').removeClass('closed'); 2080 } 2081 //$(".sidebar-title").next('div').toggleClass('opened'); 2082 }); 2083 } 2084 }, 2085 init: function() { 2086 2087 } 2088 }; 2089 2090}(); 2091 2092$(document).ready(function() { 2093 2094 if($('video#bgvid').length > 0){ 2095 var video = document.getElementById("bgvid"); 2096 video.removeAttribute("controls") 2097 } 2098 //Prevent mobile access to page 2099 if (window.matchMedia("(min-width: 1279px)").matches) { 2100 2101 } 2102 //console.log($(window).width()); 2103 if($(window).width() < 1200){ 2104 // window.location.href = "/hata/uyari"; 2105 } 2106 if($(window).width() < 700){ 2107 // window.location.href = "/hata/uyari"; 2108 venteduApp.initSidebarOpener(); 2109 } 2110 //venteduApp.initAos(); 2111 venteduApp.campusLevelsSideMenu(); 2112 venteduApp.playButtonTilt(); 2113 venteduApp.sliderInit(); 2114 venteduApp.newsSliderInit(); 2115 venteduApp.sliderGalleryInit(); 2116 venteduApp.siteMenu(); 2117 venteduApp.initSearchBox(); 2118 //venteduApp.closeMenu(); 2119 venteduApp.onePageNav(); 2120 venteduApp.initPopup($('.popup-window')); 2121 venteduApp.initVideoBg(); 2122 venteduApp.homePageTopMenu(); 2123 venteduApp.initCampusMap(); 2124 venteduApp.initPageSubMenu(); 2125 venteduApp.initHomePage(); 2126 venteduApp.initAjaxModal(); 2127 venteduApp.initHomeVerticalVideo(); 2128 venteduApp.cyclerInit(); 2129 venteduApp.contactMap(); 2130 venteduApp.initPopupForm(); 2131 venteduApp.initCampusSingleVideo(); 2132 venteduApp.openCloseToogler(); 2133 venteduApp.svgTurkeyMap(); 2134}); 2135 2136/* 2137// Detect request animation frame 2138var scroll = window.requestAnimationFrame || 2139 // IE Fallback 2140 function(callback){ window.setTimeout(callback, 1000/60)}; 2141var elementsToShow = document.querySelectorAll('.show-on-scroll'); 2142 2143 2144function loop() { 2145 2146 Array.prototype.forEach.call(elementsToShow, function(element){ 2147 2148 if (isElementInViewport(element)) { 2149 element.classList.add('is-visible'); 2150 } else { 2151 element.classList.remove('is-visible'); 2152 } 2153 }); 2154 2155 scroll(loop); 2156} 2157 2158// Call the loop for the first time 2159loop(); 2160 2161// Helper function from: http://stackoverflow.com/a/7557433/274826 2162function isElementInViewport(el) { 2163 // special bonus for those using jQuery 2164 if (typeof jQuery === "function" && el instanceof jQuery) { 2165 el = el[0]; 2166 } 2167 var rect = el.getBoundingClientRect(); 2168 return ( 2169 (rect.top <= 0 2170 && rect.bottom >= 0) 2171 || 2172 (rect.bottom >= (window.innerHeight || document.documentElement.clientHeight) && 2173 rect.top <= (window.innerHeight || document.documentElement.clientHeight)) 2174 || 2175 (rect.top >= 0 && 2176 rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)) 2177 ); 2178} 2179 */
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.