1// HOME - HERO SLIDES 2 3function initHeroSlider() { 4 const slider = document.querySelector('.hero__slides'); 5 6 if (slider) { 7 const arrorLeft = document.querySelector('.hero__arrow--left'); 8 const arrorRight = document.querySelector('.hero__arrow--right'); 9 10 const flk = new Flickity(slider, { 11 slideDots: false, 12 prevNextButtons: false, 13 autoPlay: 30000, 14 }); 15 16 arrorLeft.addEventListener('click', function () { 17 flk.previous(); 18 }); 19 20 arrorRight.addEventListener('click', function () { 21 flk.next(); 22 }); 23 } 24} 25 26//SECTION DEPOIMENTOS 27 28function initDepoimentosSlider() { 29 const slider = document.querySelector('.slider__depoimentos'); 30 31 if (slider) { 32 new Flickity(slider, { 33 slideDots: false, 34 groupCells: 1, 35 //adaptiveHeight: true, 36 prevNextButtons: true, 37 }); 38 } 39} 40 41//SECTION NOTICIAS 42 43function initSliderCard() { 44 const slider = document.querySelector('.section__cards'); 45 46 let groupCells = 1; 47 let cellAlign = 'center'; 48 49 if (window.innerWidth > 996) { 50 groupCells = 4; 51 cellAlign = 'left'; 52 } 53 54 if (slider) { 55 new Flickity(slider, { 56 slideDots: false, 57 groupCells: groupCells, 58 freeScroll: true, 59 cellAlign: cellAlign, 60 pageDots: false, 61 }); 62 } 63} 64 65//NAVBAR 66function initNavbarMenu() { 67 const navbarListItems = document.querySelectorAll( 68 '.navbar__menu--institutional li', 69 ); 70 71 for (let i = 0; i < navbarListItems.length; i++) { 72 let listItem = navbarListItems[i]; 73 74 listItem.addEventListener('mouseenter', navbarListItemMouseEnter); 75 listItem.addEventListener('mouseleave', navbarListItemMouseLeave); 76 } 77} 78 79function navbarListItemMouseEnter(event) { 80 const target = event.currentTarget; 81 const submenu = target.querySelector('.navbar__submenu'); 82 const caret = target.querySelector('.caret'); 83 84 if (submenu) { 85 gsap.to(submenu, { 86 display: 'flex', 87 opacity: 1, 88 duration: 0.4, 89 }); 90 } 91 92 if (caret) { 93 gsap.to(caret, { 94 rotation: 180, 95 transformOrigin: '50% 50%', 96 duration: 0.4, 97 }); 98 } 99} 100 101function navbarListItemMouseLeave(event) { 102 const target = event.currentTarget; 103 const submenu = target.querySelector('.navbar__submenu'); 104 const caret = target.querySelector('a img'); 105 106 if (submenu) { 107 gsap.to(submenu, { 108 display: 'none', 109 opacity: 0, 110 duration: 0.4, 111 }); 112 } 113 114 if (caret) { 115 gsap.to(caret, { 116 rotation: 0, 117 transformOrigin: '50% 50%', 118 duration: 0.4, 119 }); 120 } 121} 122 123//COMPETENCIA ICONS 124 125function competenciaIconMouseEnter(event) { 126 const target = event.currentTarget; 127 const competencia = target.parentNode; 128 const circle = competencia.querySelector('.competencia__circle'); 129 const iconBase = competencia.querySelector('.icon__base'); 130 131 gsap.to(circle, { 132 scale: 1, 133 duration: 1, 134 }); 135 136 gsap.to(iconBase, { 137 rotation: 90, 138 duration: 1, 139 }); 140} 141 142function competenciaIconMouseLeave(event) { 143 const target = event.currentTarget; 144 const competencia = target.parentNode; 145 const circle = competencia.querySelector('.competencia__circle'); 146 const iconBase = competencia.querySelector('.icon__base'); 147 148 gsap.to(circle, { 149 scale: 0, 150 duration: 1, 151 }); 152 153 gsap.to(iconBase, { 154 rotation: 0, 155 duration: 1, 156 }); 157} 158 159function initCompetencias() { 160 const iconCompetenciaList = document.querySelectorAll('.competencia__icon'); 161 162 for (let i = 0; i < iconCompetenciaList.length; i++) { 163 let listItem = iconCompetenciaList[i]; 164 165 listItem.addEventListener('mouseenter', competenciaIconMouseEnter); 166 listItem.addEventListener('mouseleave', competenciaIconMouseLeave); 167 } 168} 169 170// NAVBAR SEARCH 171 172function initNavbarSearch() { 173 const iconSearch = document.querySelector( 174 '.navbar__menu--institutional .search', 175 ); 176 const navbarSearch = document.querySelector('.navbar__search'); 177 178 navbarSearch.addEventListener('click', function (event) { 179 event.stopPropagation(); 180 });
181 182 iconSearch.addEventListener('click', function (event) { 183 event.preventDefault(); 184 event.stopPropagation(); 185 186 if (navbarSearch.classList.contains('navbar__search--open')) { 187 gsap.to(navbarSearch, { 188 display: 'none', 189 width: 0, 190 duration: 0.6, 191 }); 192 193 navbarSearch.classList.remove('navbar__search--open'); 194 } else { 195 gsap.to(navbarSearch, { 196 display: 'flex', 197 width: 260, 198 duration: 0.6, 199 }); 200 201 navbarSearch.classList.add('navbar__search--open'); 202 } 203 }); 204 205 document.addEventListener('click', function (event) { 206 gsap.to(navbarSearch, { 207 display: 'none', 208 width: 0, 209 duration: 0.6, 210 }); 211 212 navbarSearch.classList.remove('navbar__search--open'); 213 }); 214} 215 216//SIDEBAR MOBILE 217 218function initMobileSidebar() { 219 if (window.innerWidth < 996) { 220 const btnMenu = document.querySelector('.navbar .btn--menu'); 221 const mobileSidebarOverlay = document.querySelector( 222 '.mobile-sidebar-overlay', 223 ); 224 const mobileSidebar = document.querySelector('.mobile-sidebar'); 225 const closeSidebar = document.querySelector('.mobile-sidebar__close'); 226 const menu = mobileSidebar.querySelector('.mobile-sidebar__menu'); 227 const menuItems = menu.querySelectorAll('li'); 228 229 btnMenu.addEventListener('click', showMobileSidebar); 230 mobileSidebarOverlay.addEventListener('click', hideMobileSidebar); 231 closeSidebar.addEventListener('click', hideMobileSidebar); 232 233 for (let i = 0; i < menuItems.length; i++) { 234 const menuItem = menuItems[i]; 235 const submenu = menuItem.querySelector('.navbar__submenu'); 236 237 if (submenu) { 238 menuItem.addEventListener('click', mobileSidebarSubmenuClick); 239 } 240 } 241 } 242} 243 244function showMobileSidebar() { 245 const mobileSidebar = document.querySelector('.mobile-sidebar'); 246 const mobileSidebarOverlay = document.querySelector( 247 '.mobile-sidebar-overlay', 248 ); 249 250 gsap.to(mobileSidebar, { 251 x: '0%', 252 duration: 0.6, 253 }); 254 255 gsap.set(mobileSidebarOverlay, { 256 width: '100%', 257 }); 258 259 gsap.to(mobileSidebarOverlay, { 260 opacity: 1, 261 duration: 0.6, 262 }); 263} 264 265function hideMobileSidebar() { 266 const mobileSidebar = document.querySelector('.mobile-sidebar'); 267 const mobileSidebarOverlay = document.querySelector( 268 '.mobile-sidebar-overlay', 269 ); 270 271 gsap.to(mobileSidebar, { 272 x: '100%', 273 duration: 0.6, 274 }); 275 276 gsap.set(mobileSidebarOverlay, { 277 width: '0%', 278 }); 279 280 gsap.to(mobileSidebarOverlay, { 281 opacity: 0, 282 duration: 0.6, 283 }); 284} 285 286//SIDEBAR SUBMENU 287 288function mobileSidebarSubmenuClick(event) { 289 const target = event.currentTarget; 290 291 if (target.classList.contains('open')) { 292 hideMobileSidebarSubmenu(target); 293 } else { 294 showMobileSidebarSubmenu(target); 295 } 296} 297 298function showMobileSidebarSubmenu(menuItem) { 299 const caret = menuItem.querySelector('a img'); 300 301 gsap.set(menuItem, { 302 height: 'auto', 303 }); 304 305 gsap.from(menuItem, { 306 height: '0px', 307 duration: 0.6, 308 }); 309 310 if (caret) { 311 gsap.to(caret, { 312 rotation: 180, 313 transformOrigin: '50% 50%', 314 duration: 0.4, 315 }); 316 } 317 318 menuItem.classList.add('open'); 319} 320 321function hideMobileSidebarSubmenu(menuItem) { 322 const caret = menuItem.querySelector('a img'); 323 324 gsap.to(menuItem, { 325 height: '46px', 326 duration: 0.32, 327 }); 328 329 if (caret) { 330 gsap.to(caret, { 331 rotation: 0, 332 transformOrigin: '50% 50%', 333 duration: 0.4, 334 }); 335 } 336 337 menuItem.classList.remove('open'); 338} 339 340// SECTION CAMPUS 341 342function clearCampusMenuActive() { 343 const campusMenuItems = document.querySelectorAll('.campus__menu li'); 344 345 for (let i = 0; i < campusMenuItems.length; i++) { 346 let campusMenuItem = campusMenuItems[i]; 347 campusMenuItem.classList.remove('active'); 348 } 349} 350 351function campusMenuItemClick(event, flk) { 352 const target = event.currentTarget; 353 const index = parseInt(target.dataset.index); 354 const campusCards = document.querySelector('.campus__cards'); 355 356 if (target.dataset.index) { 357 clearCampusMenuActive(); 358 359 flk.select(index); 360 361 target.classList.add('active'); 362 } 363} 364 365function initCampus() { 366 const campusMenu = document.querySelector('.campus__menu'); 367 const campusMenuItems = document.querySelectorAll('.campus__menu li'); 368 const campusCards = document.querySelector('.campus__cards'); 369 370 if (campusCards) { 371 const flk = new Flickity(campusCards, { 372 pageDots: false,
373 prevNextButtons: false, 374 }); 375 376 for (let i = 0; i < campusMenuItems.length; i++) { 377 let campusMenuItem = campusMenuItems[i]; 378 379 campusMenuItem.addEventListener('click', function (event) { 380 campusMenuItemClick(event, flk); 381 }); 382 } 383 } 384} 385 386// SECTION CURSOS EXTRAS 387 388function cursoIconMouseEnter(event) { 389 const target = event.currentTarget; 390 const curso = target.parentNode; 391 const iconBase = curso.querySelector('.icon__base'); 392 393 gsap.to(iconBase, { 394 rotation: 90, 395 duration: 1, 396 }); 397} 398 399function cursoIconMouseLeave(event) { 400 const target = event.currentTarget; 401 const curso = target.parentNode; 402 const iconBase = curso.querySelector('.icon__base'); 403 404 gsap.to(iconBase, { 405 rotation: 0, 406 duration: 1, 407 }); 408} 409 410function initCursos() { 411 const iconCursosList = document.querySelectorAll('.cursos-extras--icon'); 412 413 for (let i = 0; i < iconCursosList.length; i++) { 414 let listItem = iconCursosList[i]; 415 416 listItem.addEventListener('mouseenter', cursoIconMouseEnter); 417 listItem.addEventListener('mouseleave', cursoIconMouseLeave); 418 } 419} 420 421// SECTION EX ALUNOS ICON 422 423function exAlunosIconMouseEnter(event) { 424 const target = event.currentTarget; 425 const curso = target.parentNode; 426 const iconBase = curso.querySelector('.icon__base'); 427 428 gsap.to(iconBase, { 429 rotation: 90, 430 duration: 1, 431 }); 432} 433 434function exAlunosIconMouseLeave(event) { 435 const target = event.currentTarget; 436 const curso = target.parentNode; 437 const iconBase = curso.querySelector('.icon__base'); 438 439 gsap.to(iconBase, { 440 rotation: 0, 441 duration: 1, 442 }); 443} 444 445function initExAlunos() { 446 const iconExAlunosList = document.querySelectorAll('.ex-alunos__icon--img'); 447 448 for (let i = 0; i < iconExAlunosList.length; i++) { 449 let listItem = iconExAlunosList[i]; 450 451 listItem.addEventListener('mouseenter', exAlunosIconMouseEnter); 452 listItem.addEventListener('mouseleave', exAlunosIconMouseLeave); 453 } 454} 455 456//Slider texts 457 458function hideAllTexts(event) { 459 const texts = document.querySelectorAll('.slider__text'); 460 461 for (let i = 0; i < texts.length; i++) { 462 let text = texts[i]; 463 464 gsap.to(text, { 465 display: 'none', 466 opacity: 0, 467 duration: 0 468 }); 469 } 470 471 return true; 472} 473 474function hideAllBorder() { 475 const borderList = document.querySelectorAll('.slider__border'); 476 477 for (let i = 0; i < borderList.length; i++) { 478 let border = borderList[i]; 479 border.classList.remove('active'); 480 } 481} 482 483function slideBtnClick(event) { 484 const target = event.currentTarget; 485 const border = target.parentElement; 486 const id = target.dataset.id; 487 const text = document.querySelector('.slider__texts [data-id="' + id + '"]'); 488 489 hideAllTexts(); 490 hideAllBorder(); 491 492 gsap.to(text, { 493 display: 'block', 494 opacity: 1, 495 duration: 0 496 }); 497 498 border.classList.add('active'); 499} 500 501function showDescription(event) { 502 const target = event.currentTarget; 503 const description = target.querySelector('.slider__btn-description'); 504 505 gsap.to(description, { 506 display: 'block', 507 transform: 'translate(0px, 3px)', 508 }); 509} 510 511function hiddenDescription(event) { 512 const target = event.currentTarget; 513 const description = target.querySelector('.slider__btn-description'); 514 515 gsap.to(description, { 516 display: 'none', 517 transform: 'translate(0px, 0px)', 518 }); 519} 520 521function initSliderBtns() { 522 const sliderBtns = document.querySelectorAll('.slider__btn'); 523 524 for (let i = 0; i < sliderBtns.length; i++) { 525 let btn = sliderBtns[i]; 526 527 btn.addEventListener('mouseover', slideBtnClick); 528 btn.addEventListener('mouseenter', showDescription); 529 btn.addEventListener('mouseleave', hiddenDescription); 530 } 531} 532 533//section mosaico 534 535function initMosaico() { 536 let elem = document.querySelector('.mosaico'); 537 538 let iso = new Isotope(elem, { 539 layoutMode: 'masonry', 540 masonry: { 541 gutter: 30, 542 horizontalOrder: true, 543 }, 544 itemSelector: '.mosaico__img', 545 });
546} 547 548// section matriz curricular 549 550function hideBox() { 551 const boxes = document.querySelectorAll('.matriz-curricular__box'); 552 553 for (i = 0; i > boxes.length; i++) { 554 let box = boxes[i]; 555 } 556 557 gsap.to(box, { 558 display: 'none', 559 opacity: 0, 560 transition: 0.24, 561 }); 562 563 box.classList.remove('matriz-curricular__box--open'); 564} 565 566function openBox1(event) { 567 const target = event.currentTarget; 568 const row = target.parentNode; 569 const content = row.parentNode; 570 const box = content.querySelector('.box1'); 571 572 if (box.classList.contains('matriz-curricular__box--open')) { 573 gsap.to(box, { 574 height: 0, 575 duration: 0.24, 576 }); 577 578 box.classList.remove('matriz-curricular__box--open'); 579 } else { 580 gsap.set(box, { 581 height: 'auto', 582 }); 583 584 gsap.from(box, { 585 height: 0, 586 duration: 0.24, 587 }); 588 589 box.classList.add('matriz-curricular__box--open'); 590 } 591} 592 593function openBox2(event) { 594 const target = event.currentTarget; 595 const row = target.parentNode; 596 const content = row.parentNode; 597 const box = content.querySelector('.box2'); 598 599 if (box.classList.contains('matriz-curricular__box--open')) { 600 gsap.to(box, { 601 height: 0, 602 duration: 0.24, 603 }); 604 605 box.classList.remove('matriz-curricular__box--open'); 606 } else { 607 gsap.set(box, { 608 height: 'auto', 609 }); 610 611 gsap.from(box, { 612 height: 0, 613 duration: 0.24, 614 }); 615 616 box.classList.add('matriz-curricular__box--open'); 617 } 618} 619 620function openBoxDisciplina(event) { 621 const target = event.currentTarget; 622 const id = target.dataset.id; 623 const disciplinaBox = document.querySelector( 624 '.matriz-curricular__box[data-id="' + id + '"]', 625 ); 626 627 if (disciplinaBox.classList.contains('matriz-curricular__box--open')) { 628 gsap.to(disciplinaBox, { 629 height: 0, 630 duration: 0.24, 631 }); 632 633 disciplinaBox.classList.remove('matriz-curricular__box--open'); 634 } else { 635 gsap.set(disciplinaBox, { 636 height: 'auto', 637 }); 638 639 gsap.from(disciplinaBox, { 640 height: 0, 641 duration: 0.24, 642 }); 643 644 disciplinaBox.classList.add('matriz-curricular__box--open'); 645 } 646} 647 648function initMatrizCurricular() { 649 const professorBtns1 = document.querySelectorAll( 650 '.matriz-curricular__professor--1', 651 ); 652 const professorBtns2 = document.querySelectorAll( 653 '.matriz-curricular__professor--2', 654 ); 655 const disciplinas = document.querySelectorAll('.matriz-curricular__row'); 656 657 for (i = 0; i < professorBtns1.length; i++) { 658 let btn1 = professorBtns1[i]; 659 660 btn1.addEventListener('click', openBox1); 661 } 662 663 for (i = 0; i < professorBtns2.length; i++) { 664 let btn2 = professorBtns2[i]; 665 666 btn2.addEventListener('click', openBox2); 667 } 668 669 for (i = 0; i < disciplinas.length; i++) { 670 let disciplina = disciplinas[i]; 671 672 disciplina.addEventListener('click', openBoxDisciplina); 673 } 674} 675 676function hideAllTabs() { 677 const tabs = document.querySelectorAll('.matriz-curricular__content'); 678 679 for (let i = 0; i < tabs.length; i++) { 680 let tab = tabs[i]; 681 682 gsap.to(tab, { 683 display: 'none', 684 opacity: 0, 685 duration: 0.24, 686 }); 687 688 tab.classList.remove('matriz-curricular__content--visible'); 689 } 690} 691 692function changeTab(event) { 693 const target = event.currentTarget; 694 const id = target.dataset.tab; 695 const tab = document.querySelector( 696 '.matriz-curricular__content[data-tab="' + id + '"]', 697 ); 698 699 hideAllTabs(); 700 701 if (tab.classList.contains('matriz-curricular__content--visible')) { 702 gsap.to(tab, { 703 display: 'none', 704 opacity: 0, 705 duration: 0.24, 706 delay: 0.24,
707 }); 708 709 tab.classList.remove('matriz-curricular__content--visible'); 710 } else { 711 gsap.to(tab, { 712 display: 'block', 713 opacity: 1, 714 duration: 0.24, 715 delay: 0.24, 716 }); 717 718 tab.classList.add('matriz-curricular__content--visible'); 719 } 720} 721 722function hideTitle() { 723 const tabs = document.querySelectorAll('.tab'); 724 725 for (let i = 0; i < tabs.length; i++) { 726 let tab = tabs[i]; 727 const title = tab.querySelector('p'); 728 729 tab.classList.remove('tab--active'); 730 } 731} 732 733function changeTitle(event) { 734 const target = event.currentTarget; 735 const id = target.dataset.tab; 736 const tab = document.querySelector('.tab[data-tab="' + id + '"]'); 737 const title = tab.querySelector('p'); 738 739 hideTitle(); 740 741 if (tab.classList.contains('tab--active')) { 742 tab.classList.remove('tab--active'); 743 } else { 744 tab.classList.add('tab--active'); 745 } 746} 747 748function initTabsMatrizCurricular() { 749 const tabs = document.querySelectorAll('.matriz-curricular__tabs .tab'); 750 751 for (i = 0; i < tabs.length; i++) { 752 let tab = tabs[i]; 753 754 tab.addEventListener('click', changeTab); 755 tab.addEventListener('click', changeTitle); 756 } 757} 758 759//section slider 760 761function hideSliderTexts() { 762 const texts = document.querySelectorAll('.slider__card-text'); 763 764 for (let i = 0; i < texts.length; i++) { 765 let text = texts[i]; 766 767 gsap.to(text, { 768 display: 'none', 769 opacity: 0, 770 duration: 0.24, 771 }); 772 } 773} 774 775function onSliderChange(index) { 776 hideSliderTexts(); 777 778 const card = document.querySelector('.slider__card'); 779 const text = document.querySelector( 780 '.slider__card-text[data-index="' + index + '"]', 781 ); 782 783 gsap.to(text, { 784 display: 'block', 785 opacity: 1, 786 duration: 0.24, 787 delay: 0.24, 788 }); 789 790 card.classList.toggle('slider__card--yellow'); 791} 792 793function initSlider() { 794 const slider = document.querySelector('.slider__imgs'); 795 const arrorLeft = document.querySelector('.slider__card-arrow--left'); 796 const arrorRight = document.querySelector('.slider__card-arrow--right'); 797 798 if (slider) { 799 const flk = new Flickity(slider, { 800 pageDots: false, 801 groupCells: 1, 802 prevNextButtons: false, 803 }); 804 805 arrorLeft.addEventListener('click', function () { 806 flk.previous(); 807 }); 808 809 arrorRight.addEventListener('click', function () { 810 flk.next(); 811 }); 812 813 flk.on('change', onSliderChange); 814 } 815} 816 817function hideSliderMobileTexts() { 818 const texts = document.querySelectorAll('.slider-mobile__card-text'); 819 820 for (let i = 0; i < texts.length; i++) { 821 let text = texts[i]; 822 823 gsap.to(text, { 824 display: 'none', 825 opacity: 0, 826 duration: 0.24, 827 }); 828 } 829} 830 831function onSliderMobileChange(index) { 832 hideSliderMobileTexts(); 833 834 const card = document.querySelector('.slider-mobile__card'); 835 const text = document.querySelector( 836 '.slider-mobile__card-text[data-index="' + index + '"]', 837 ); 838 839 gsap.to(text, { 840 display: 'block', 841 opacity: 1, 842 duration: 0.24, 843 delay: 0.24, 844 }); 845 846 card.classList.toggle('slider-mobile__card--yellow'); 847} 848 849function initSliderMobile() { 850 const slider = document.querySelector('.slider-mobile__imgs'); 851 const arrorLeft = document.querySelector('.slider-mobile__card-arrow--left'); 852 const arrorRight = document.querySelector( 853 '.slider-mobile__card-arrow--right', 854 ); 855 856 if (slider) { 857 const flk = new Flickity(slider, { 858 pageDots: false, 859 groupCells: 1, 860 prevNextButtons: false, 861 }); 862 863 arrorLeft.addEventListener('click', function () { 864 flk.previous(); 865 }); 866 867 arrorRight.addEventListener('click', function () { 868 flk.next(); 869 }); 870 871 flk.on('change', onSliderMobileChange); 872 } 873} 874 875function matrizCurricularOpenModal(event) { 876 const target = event.currentTarget; 877 const id = target.dataset.tab; 878 const modal = document.querySelector( 879 '.modal__horario-semanal[data-tab="' + id + '"]', 880 ); 881 882 gsap.to(modal, { 883 display: 'block', 884 opacity: 1, 885 duration: 0.24,
886 delay: 0.24, 887 }); 888} 889 890function matrizCurricularCloseModal(event) { 891 const target = event.currentTarget; 892 const id = target.dataset.tab; 893 const modal = document.querySelector( 894 '.modal__horario-semanal[data-tab="' + id + '"]', 895 ); 896 897 gsap.to(modal, { 898 display: 'none', 899 opacity: 1, 900 duration: 0.24, 901 delay: 0.24, 902 }); 903} 904 905function initMatrizCurricularModal() { 906 const btnsModalOpen = document.querySelectorAll('.btn--open-modal'); 907 const btnsCloseModal = document.querySelectorAll('.modal__close-btn'); 908 909 for (i = 0; i < btnsModalOpen.length; i++) { 910 let btnModalOpen = btnsModalOpen[i]; 911 912 btnModalOpen.addEventListener('click', matrizCurricularOpenModal); 913 } 914 915 for (i = 0; i < btnsCloseModal.length; i++) { 916 let btnCloseModal = btnsCloseModal[i]; 917 918 btnCloseModal.addEventListener('click', matrizCurricularCloseModal); 919 } 920} 921 922function boxMouseEnter(event) { 923 const target = event.currentTarget; 924 const id = target.dataset.id; 925 const boxTop = document.querySelector('.box__top[data-id="' + id + '"'); 926 const boxCover = boxTop.querySelector('.box__cover'); 927 const boxContent = document.querySelector( 928 '.box__content[data-id="' + id + '"', 929 ); 930 const text = boxContent.querySelector('.box__content-texts'); 931 const boxTitle = boxTop.querySelector('.box__title'); 932 const boxMais = boxTop.querySelector('.box__cover-title--mais'); 933 934 if (boxMais) { 935 gsap.to(boxMais, { 936 x: -30, 937 y: -30, 938 rotation: 20, 939 }); 940 } 941 942 if (!target.classList.contains('box--open')) { 943 gsap.to(boxTop, { 944 width: 350, 945 height: 200, 946 }); 947 948 gsap.to(boxCover, { 949 rotation: -20, 950 zIndex: 2, 951 x: -150, 952 boxShadow: '-20px 0px 40px 0px rgb(0 0 0 / 80%', 953 }); 954 955 gsap.to(boxTitle, { 956 opacity: 1, 957 delay: 0.2, 958 }); 959 960 gsap.to(boxContent, { 961 position: 'absolute', 962 zIndex: 1, 963 width: 260, 964 height: 490, 965 }); 966 967 gsap.to(text, { 968 display: 'block', 969 position: 'relative', 970 zIndex: 3, 971 delay: 0.2, 972 }); 973 974 setTimeout(function () { 975 target.classList.add('box--open'); 976 }, 560); 977 } 978} 979 980function boxDev(box) { 981 const id = box.dataset.id; 982 const boxTop = document.querySelector('.box__top[data-id="' + id + '"'); 983 const boxCover = boxTop.querySelector('.box__cover'); 984 const boxContent = document.querySelector( 985 '.box__content[data-id="' + id + '"', 986 ); 987 const text = boxContent.querySelector('.box__content-texts'); 988 const boxTitle = boxTop.querySelector('.box__title'); 989 990 gsap.to(boxTop, { 991 width: 350, 992 height: 200, 993 }); 994 995 gsap.to(boxCover, { 996 rotation: -20, 997 zIndex: 2, 998 x: -150, 999 boxShadow: '-20px 0px 40px 0px rgb(0 0 0 / 80%', 1000 }); 1001 1002 gsap.to(boxTitle, { 1003 opacity: 1, 1004 delay: 0.2, 1005 }); 1006 1007 gsap.to(boxContent, { 1008 position: 'absolute', 1009 zIndex: 1, 1010 width: 260, 1011 height: 540, 1012 }); 1013 1014 gsap.to(text, { 1015 display: 'block', 1016 position: 'relative', 1017 zIndex: 3, 1018 delay: 0.2, 1019 }); 1020} 1021 1022function boxMouseLeave(event) { 1023 const target = event.currentTarget; 1024 const id = target.dataset.id; 1025 const boxTop = document.querySelector('.box__top[data-id="' + id + '"'); 1026 const boxCover = boxTop.querySelector('.box__cover'); 1027 const boxContent = document.querySelector( 1028 '.box__content[data-id="' + id + '"', 1029 ); 1030 const text = boxContent.querySelector('.box__content-texts'); 1031 const boxTitle = boxTop.querySelector('.box__title'); 1032 const boxMais = boxTop.querySelector('.box__cover-title--mais'); 1033 1034 if (boxMais) { 1035 gsap.to(boxMais, { 1036 x: 0, 1037 y: 0, 1038 rotation: 0, 1039 }); 1040 } 1041 1042 setTimeout(function () { 1043 1044 if (target.classList.contains('box--open')) { 1045 gsap.to(boxTop, { 1046 width: 230, 1047 height: 240, 1048 }); 1049 1050 gsap.to(boxCover, { 1051 rotation: 0, 1052 zIndex: 0, 1053 x: 0, 1054 boxShadow: '0 0 0 0', 1055 }); 1056 1057 gsap.to(boxTitle, { 1058 opacity: 0, 1059 }); 1060 1061 gsap.to(boxContent, { 1062 zIndex: 0, 1063 width: 230, 1064 height: 240, 1065 }); 1066 1067 gsap.to(text, { 1068 display: 'none', 1069 delay: -0.5, 1070 }); 1071 1072 setTimeout(function () { 1073 target.classList.remove('box--open'); 1074 }, 560); 1075 } 1076 1077 }, 560); 1078} 1079 1080function initBoxCursos() { 1081 const boxes = document.querySelectorAll('.box'); 1082 for (i = 0; i < boxes.length; i++) { 1083 let box = boxes[i];
1084 1085 // boxDev(box) 1086 1087 box.addEventListener('mouseenter', boxMouseEnter); 1088 box.addEventListener('mouseleave', boxMouseLeave); 1089 } 1090} 1091 1092// Nossa História 1093 1094function nossaHistoriaMouseEnter(event) { 1095 const target = event.currentTarget; 1096 const cardRight = target.querySelector('.card__right'); 1097 const circle = target.querySelector('.circle__base img'); 1098 const photo = target.querySelector('.circle__photo'); 1099 const circleBg = target.querySelector('.circle__bg'); 1100 const anoCircle = target.querySelector('.ano__circle'); 1101 const lupa = target.querySelector('.circle__lupa'); 1102 1103 gsap.to(circle, { 1104 // scale: 1, 1105 rotation: 90, 1106 duration: 1, 1107 }); 1108 1109 gsap.to(circleBg, { 1110 boxShadow: 'none', 1111 width: 125, 1112 height: 125, 1113 opacity: 1, 1114 }); 1115 1116 gsap.to(photo, { 1117 width: 125, 1118 height: 125, 1119 opacity: 0.4, 1120 }); 1121 1122 gsap.to(lupa, { 1123 display: 'block', 1124 }); 1125 1126 gsap.to(anoCircle, { 1127 marginRight: 0, 1128 }); 1129 1130 cardRight.classList.add('ativo'); 1131} 1132 1133function nossaHistoriaMouseLeave(event) { 1134 const target = event.currentTarget; 1135 const cardRight = target.querySelector('.card__right'); 1136 const circle = target.querySelector('.circle__base img'); 1137 const circleBg = target.querySelector('.circle__bg'); 1138 const photo = target.querySelector('.circle__photo'); 1139 const anoCircle = target.querySelector('.ano__circle'); 1140 const lupa = target.querySelector('.circle__lupa'); 1141 1142 gsap.to(circle, { 1143 rotation: 0, 1144 duration: 1, 1145 }); 1146 1147 gsap.to(circleBg, { 1148 boxShadow: '-10px 18px 30px 5px rgb(0 0 0 / 80%)', 1149 width: 120, 1150 height: 120, 1151 opacity: 1, 1152 }); 1153 1154 gsap.to(photo, { 1155 width: 110, 1156 height: 110, 1157 opacity: 1, 1158 }); 1159 1160 gsap.to(lupa, { 1161 display: 'none', 1162 }); 1163 1164 gsap.to(anoCircle, { 1165 marginRight: 15, 1166 }); 1167 1168 cardRight.classList.remove('ativo'); 1169} 1170 1171function nossaHistoriaModal(event) { 1172 const target = event.currentTarget; 1173 const id = target.dataset.tab; 1174 const modal = document.querySelector('.card__modal[data-tab="' + id + '"]'); 1175 const modalClose = modal.querySelector('.btn__close'); 1176 1177 gsap.to(modal, { 1178 display: 'block', 1179 }); 1180 1181 modalClose.addEventListener('click', function () { 1182 gsap.to(modal, { 1183 display: 'none', 1184 }); 1185 }); 1186} 1187 1188function initNossaHistoria() { 1189 const cardsList = document.querySelectorAll('.card'); 1190 1191 for (let i = 0; i < cardsList.length; i++) { 1192 let card = cardsList[i]; 1193 1194 card.addEventListener('mouseenter', nossaHistoriaMouseEnter); 1195 card.addEventListener('mouseleave', nossaHistoriaMouseLeave); 1196 card.addEventListener('click', nossaHistoriaModal); 1197 } 1198} 1199 1200function hideBtnActive() { 1201 const btns = document.querySelectorAll('.equipes__btns .btn'); 1202 for (let i = 0; i < btns.length; i++) { 1203 let btn = btns[i]; 1204 1205 btn.classList.remove('active'); 1206 } 1207} 1208 1209function equipeGestoraClick(event) { 1210 hideBtnActive(); 1211 1212 const target = event.currentTarget; 1213 target.classList.add('active'); 1214} 1215 1216function initEquipeGestora() { 1217 const btns = document.querySelectorAll('.equipes__btns .btn'); 1218 for (let i = 0; i < btns.length; i++) { 1219 let btn = btns[i]; 1220 1221 btn.addEventListener('click', equipeGestoraClick); 1222 } 1223} 1224 1225function initInovandoBoxes() { 1226 const boxes = document.querySelector('.inovando__boxes--mobile'); 1227 1228 if (boxes) { 1229 new Flickity(boxes, { 1230 slideDots: true, 1231 groupCells: 1, 1232 prevNextButtons: true, 1233 }); 1234 } 1235} 1236 1237function initDirecaoSocial() { 1238 const cards = document.querySelectorAll('.direcao__card'); 1239 1240 for (let i = 0; i < cards.length; i++) { 1241 let card = cards[i]; 1242 1243 card.addEventListener('mouseenter', showDirecaoSocial); 1244 card.addEventListener('mouseleave', hidenDirecaoSocial); 1245 } 1246} 1247 1248function showDirecaoSocial(event) { 1249 const target = event.currentTarget; 1250 const social = target.querySelector('.professional__social'); 1251 const bg = target.querySelector('.direcao-professional__description'); 1252 1253 social.classList.add('active'); 1254 bg.classList.add('active'); 1255} 1256 1257function hidenDirecaoSocial(event) { 1258 const target = event.currentTarget; 1259 const social = target.querySelector('.professional__social'); 1260 const bg = target.querySelector('.direcao-professional__description'); 1261 1262 social.classList.remove('active'); 1263 bg.classList.remove('active'); 1264} 1265 1266function initDirecaoSliders() { 1267 const cardsDirecao = document.querySelector('.direcao__cards--direcao');
1268 const cardsDirecaoPedagogica = document.querySelector('.direcao__cards--direcao-pedag'); 1269 const cardsEscola = document.querySelector('.direcao__cards--escola'); 1270 const cardsDirecaoAlema = document.querySelector('.direcao__cards--direcao-alema'); 1271 const cardsDirecaoExecutiva = document.querySelector('.direcao__cards--direcao-executiva'); 1272 1273 1274 if (window.innerWidth < 996) { 1275 if (cardsDirecao) { 1276 new Flickity(cardsDirecao, { 1277 slideDots: true, 1278 groupCells: 1, 1279 prevNextButtons: true 1280 }); 1281 } 1282 1283 if (cardsDirecaoPedagogica) { 1284 new Flickity(cardsDirecaoPedagogica, { 1285 slideDots: true, 1286 groupCells: 1, 1287 prevNextButtons: true 1288 }); 1289 } 1290 1291 if (cardsEscola) { 1292 new Flickity(cardsEscola, { 1293 slideDots: true, 1294 groupCells: 1, 1295 prevNextButtons: true 1296 }); 1297 } 1298 1299 if (cardsDirecaoAlema) { 1300 new Flickity(cardsDirecaoAlema, { 1301 slideDots: true, 1302 groupCells: 1, 1303 prevNextButtons: true 1304 }); 1305 } 1306 1307 if (cardsDirecaoExecutiva) { 1308 new Flickity(cardsDirecaoExecutiva, { 1309 slideDots: true, 1310 groupCells: 1, 1311 prevNextButtons: true 1312 }); 1313 } 1314 } 1315 1316 1317} 1318 1319function percursoPointMouseenter(event) { 1320 const target = event.currentTarget; 1321 1322 target.classList.add('hover'); 1323} 1324 1325function percursoPointMouseleave(event) { 1326 const target = event.currentTarget; 1327 1328 target.classList.remove('hover'); 1329} 1330 1331function percursoPointContentClick(event) { 1332 const target = event.currentTarget; 1333 const id = target.dataset.id; 1334 const content = document.querySelector( 1335 '.point__content[data-id="' + id + '"]', 1336 ); 1337 1338 content.classList.toggle('active'); 1339 target.classList.toggle('active'); 1340} 1341 1342function initPercursosPoint() { 1343 const listpoints = document.querySelectorAll('.point'); 1344 1345 for (i = 0; i < listpoints.length; i++) { 1346 let point = listpoints[i]; 1347 1348 if (window.innerWidth > 1200) { 1349 point.addEventListener('mouseenter', percursoPointMouseenter); 1350 point.addEventListener('mouseleave', percursoPointMouseleave); 1351 } 1352 1353 point.addEventListener('click', percursoPointContentClick); 1354 } 1355} 1356 1357function initSliderImg() { 1358 const slider = document.querySelector('.section__cards--img'); 1359 const arrorLeft = document.querySelector('.slider__img--left'); 1360 const arrorRight = document.querySelector('.slider__img--right'); 1361 1362 let groupCells = 1; 1363 let cellAlign = 'center'; 1364 1365 if (window.innerWidth > 996) { 1366 groupCells = 3; 1367 cellAlign = 'left'; 1368 } 1369 1370 if (slider) { 1371 const flk = new Flickity(slider, { 1372 slideDots: false, 1373 groupCells: groupCells, 1374 freeScroll: true, 1375 cellAlign: cellAlign, 1376 pageDots: false, 1377 prevNextButtons: false, 1378 }); 1379 1380 arrorLeft.addEventListener('click', function () { 1381 flk.previous(); 1382 }); 1383 1384 arrorRight.addEventListener('click', function () { 1385 flk.next(); 1386 }); 1387 1388 flk.on('change', onSliderChange); 1389 } 1390} 1391 1392function showCountry(event) { 1393 const target = event.currentTarget; 1394 const country = target.querySelector('p'); 1395 1396 if (window.innerWidth > 996) { 1397 gsap.to(country, { 1398 opacity: 1, 1399 transition: 0.2, 1400 }); 1401 } 1402} 1403 1404function hideCountry(event) { 1405 const target = event.currentTarget; 1406 const country = target.querySelector('p'); 1407 1408 if (window.innerWidth > 996) { 1409 gsap.to(country, { 1410 opacity: 0, 1411 transition: 0.2, 1412 }); 1413 } 1414} 1415 1416function initMap() { 1417 const pins = document.querySelectorAll('.pin'); 1418 1419 for (let i = 0; i < pins.length; i++) { 1420 let pin = pins[i]; 1421 1422 pin.addEventListener('mouseenter', showCountry); 1423 pin.addEventListener('mouseleave', hideCountry); 1424 } 1425} 1426 1427function hidePage() { 1428 const pages = document.querySelectorAll('.noticias__pages .page'); 1429 1430 for (let i = 0; i < pages.length; i++) { 1431 let page = pages[i]; 1432 if (page.classList.contains('active')) { 1433 page.classList.remove('active'); 1434 } 1435 } 1436} 1437 1438function changePageNoticias(event) { 1439 const target = event.currentTarget; 1440 hidePage(); 1441 target.classList.add('active'); 1442} 1443 1444function initNoticiasCards() { 1445 const noticiasPages = document.querySelectorAll( 1446 '.noticias__pages--top .page', 1447 ); 1448 1449 for (let i = 0; i < noticiasPages.length; i++) { 1450 let page = noticiasPages[i]; 1451 page.addEventListener('click', changePageNoticias); 1452 } 1453} 1454 1455function initResultadosBusca() { 1456 let elem = document.querySelector('.resultado__cards'); 1457 1458 if (window.innerWidth > 996) { 1459 let iso = new Isotope(elem, { 1460 layoutMode: 'masonry', 1461 masonry: { 1462 gutter: 20, 1463 horizontalOrder: true, 1464 }, 1465 itemSelector: '.resultado__card', 1466 }); 1467 } 1468} 1469 1470// SECTION IMPRENSA 1471 1472function changeTitleSliderImprensa(mes) { 1473 const title = document.querySelector('.section__sub-title'); 1474 1475 title.innerHTML = mes.substring(0, mes.indexOf(" ")); 1476 1477 const year = document.querySelector('.section__title'); 1478 1479 year.innerHTML = mes.substring(mes.indexOf(" ")); 1480} 1481 1482function clearImprensaMenuActive() { 1483 const imprensaMenuItems = document.querySelectorAll('.imprensa__menu li'); 1484
1485 imprensaMenuItems.forEach(function (imprensaMenuItem) { 1486 imprensaMenuItem.classList.remove('active'); 1487 }); 1488 1489 const imprensaPagerItems = document.querySelectorAll('.content__pages .pages .page'); 1490 1491 imprensaPagerItems.forEach(function (imprensaPagerItem) { 1492 imprensaPagerItem.classList.remove('active'); 1493 }); 1494} 1495 1496function changeCardSlider(event, flk) { 1497 const target = event.target; 1498 const menuItems = document.querySelectorAll('.imprensa__menu li'); 1499 1500 for (let i = 0; i < menuItems.length; i++) { 1501 let menuItem = menuItems[i]; 1502 1503 if (menuItem.dataset.mes === target.value) { 1504 clearImprensaMenuActive(); 1505 1506 flk.select(i); 1507 1508 changeTitleSliderImprensa(target.value); 1509 1510 menuItem.classList.add('active'); 1511 } 1512 } 1513} 1514 1515function imprensaMenuItemClick(event, flk) { 1516 const target = event.currentTarget; 1517 const index = parseInt(target.dataset.index); 1518 const mes = target.dataset.mes; 1519 const page = document.querySelector(`.content__pages .pages .page[data-index="${index}"]`); 1520 1521 if (target.dataset.index) { 1522 clearImprensaMenuActive(); 1523 1524 flk.select(index); 1525 1526 changeTitleSliderImprensa(mes); 1527 1528 target.classList.add('active'); 1529 page.classList.add('active'); 1530 } 1531} 1532 1533function imprensaPageItemClick(event, flk) { 1534 const target = event.currentTarget; 1535 const index = parseInt(target.dataset.index); 1536 const menu = document.querySelector(`.imprensa__menu li[data-index="${index}"]`);; 1537 1538 if (target.dataset.index) { 1539 clearImprensaMenuActive(); 1540 1541 flk.select(index); 1542 1543 changeTitleSliderImprensa(menu.dataset.mes); 1544 1545 target.classList.add('active'); 1546 menu.classList.add('active'); 1547 } 1548} 1549 1550function initImprensa() { 1551 const menuItems = document.querySelectorAll('.imprensa__menu li'); 1552 const cards = document.querySelector('.imprensa__cards'); 1553 //const filtroMes = document.querySelector('.imprensa__filtro--mes select'); 1554 const activeMenu = document.querySelector('.imprensa__menu li.active'); 1555 const pages = document.querySelectorAll('.content__pages .pages .page'); 1556 1557 changeTitleSliderImprensa(activeMenu.dataset.mes); 1558 1559 if (cards) { 1560 const flk = new Flickity(cards, { 1561 pageDots: false, 1562 prevNextButtons: false, 1563 }); 1564 1565 flk.on('dragEnd', function () { 1566 var index = this.selectedIndex; 1567 1568 clearImprensaMenuActive(); 1569 1570 const menu = document.querySelector(`.imprensa__menu li[data-index="${index}"]`); 1571 const page = document.querySelector(`.content__pages .pages .page[data-index="${index}"]`); 1572 1573 changeTitleSliderImprensa(menu.dataset.mes); 1574 1575 menu.classList.add('active'); 1576 page.classList.add('active'); 1577 }); 1578 1579 //filtroMes.addEventListener('change', function (event) { 1580 // changeCardSlider(event, flk); 1581 //}); 1582 1583 menuItems.forEach(function (menuItem) { 1584 menuItem.addEventListener('click', function (event) { 1585 imprensaMenuItemClick(event, flk); 1586 }); 1587 }); 1588 1589 pages.forEach(function (pageItem) { 1590 pageItem.addEventListener('click', function (event) { 1591 imprensaPageItemClick(event, flk); 1592 }); 1593 }); 1594 } 1595} 1596 1597function changeImagePreview(event) { 1598 var input = event.target; 1599 1600 var reader = new FileReader(); 1601 reader.onload = function () { 1602 var dataURL = reader.result; 1603 var img = document.querySelector('.img__box img'); 1604 img.src = dataURL; 1605 }; 1606 reader.readAsDataURL(input.files[0]); 1607} 1608 1609function initFileReader() { 1610 const sendFile = document.querySelector('.send-file'); 1611 1612 sendFile.addEventListener('change', changeImagePreview); 1613 1614 console.log(sendFile); 1615} 1616 1617function addClass() { 1618 const elemento1 = document.querySelector('.card--024'); 1619 const imagem1 = document.querySelector('.card--024 .ano__bg'); 1620 const imagem2 = document.querySelector('.card--024 .ano__seta-img'); 1621 const imagem3 = document.querySelector('.card--024 .circle__base-img'); 1622 const imagem4 = document.querySelector('.card--024 .circle__lupa'); 1623 1624 imagem1.src = "./resources/img/historia-bg-01.png" 1625 elemento1.classList.add("card--05") 1626 card2022.classList.add("card--06") 1627} 1628 1629function main() { 1630 initHeroSlider(); 1631 initNavbarMenu();
1632 initCompetencias(); 1633 initNavbarSearch(); 1634 initMobileSidebar(); 1635 initCursos(); 1636 initSliderBtns(); 1637 initMatrizCurricularModal(); 1638 initBoxCursos(); 1639 initEquipeGestora(); 1640 initInovandoBoxes(); 1641 initDirecaoSocial(); 1642 initDirecaoSliders(); 1643 initPercursosPoint(); 1644 initExAlunos(); 1645 initMap(); 1646 initFileReader(); 1647 // initNoticiasCards(); 1648 addClass(); 1649} 1650 1651function load() { 1652 initSliderCard(); 1653 initDepoimentosSlider(); 1654 initCampus(); 1655 initMosaico(); 1656 initSlider(); 1657 initSliderMobile(); 1658 initNossaHistoria(); 1659 initSliderImg(); 1660 initResultadosBusca(); 1661 initImprensa(); 1662 addClass(); 1663} 1664 1665// roda a função main quando o html termina de carregar 1666document.addEventListener('DOMContentLoaded', main); 1667 1668// roda a função main quando o html e todos os arquivos (img/css/js) terminarem de carregar 1669window.addEventListener('load', load);
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.