1(function (window, document, $, undefined) { 2 "use strict"; 3 4 var eduJs = { 5 i: function (e) { 6 eduJs.d(); 7 eduJs.methods(); 8 }, 9 10 d: function (e) { 11 (this._window = $(window)), 12 (this._document = $(document)), 13 (this._body = $("body")), 14 (this._html = $("html")), 15 (this.sideNav = $(".rbt-search-dropdown")); 16 }, 17 methods: function (e) { 18 eduJs.salActive(); 19 eduJs.menuCurrentLink(); 20 eduJs.eduSwiperActive(); 21 eduJs.eduBgCardHover(); 22 eduJs.magnigyPopup(); 23 eduJs.counterUp(); 24 eduJs.pricingPlan(); 25 eduJs.courseView(); 26 eduJs.stickyHeader(); 27 eduJs.masonryActivation(); 28 eduJs._clickDoc(); 29 eduJs.wowActivation(); 30 eduJs.radialProgress(); 31 eduJs.marqueImage(); 32 eduJs.popupMobileMenu(); 33 eduJs.headerSticky(); 34 eduJs.qtyBtn(); 35 eduJs.checkoutPage(); 36 eduJs.offCanvas(); 37 eduJs.onePageNav(); 38 eduJs.transparentHeader(); 39 eduJs.categoryMenuHover(); 40 eduJs.cartSidenav(); 41 eduJs.filterClickButton(); 42 eduJs.selectPicker(); 43 eduJs.headerTopActivation(); 44 eduJs.magnificPopupActivation(); 45 eduJs.showMoreBtn(); 46 eduJs.sidebarVideoHidden(); 47 eduJs.courseActionBottom(); 48 eduJs.topbarExpend(); 49 eduJs.categoryOffcanvas(); 50 eduJs.autoslidertab(); 51 eduJs.moveAnimation(); 52 eduJs.contactForm(); 53 eduJs.player(); 54 eduJs.quizAns(); 55 eduJs.lessonAccor(); 56 eduJs.unloadImage(); 57 eduJs.searchValue();
58 eduJs.lessonToggle(); 59 eduJs.categoryMenuHover2(); 60 eduJs.typeField(); // new added 61 eduJs.countDown(); // new added 62 eduJs.editor(); // new added 63 eduJs.toggleModal(); // new added 64 eduJs.dnd(); // new added 65 eduJs.multiStepForm(); // new added 66 eduJs.cursorFollow(); // new added 67 }, 68 dnd: function () { 69 // Select the sortable containers 70 const dnd1 = document.getElementById("dnd1"); 71 const dnd2 = document.getElementById("dnd2"); 72 // const dnd3 = document.getElementById("dnd3"); 73 74 // Initialize Sortable only if the element exists 75 if (dnd1) { 76 new Sortable(dnd1, { 77 animation: 150, 78 }); 79 } 80 81 if (dnd2) { 82 new Sortable(dnd2, { 83 animation: 150, 84 }); 85 } 86 87 // if (dnd3) { 88 // new Sortable(dnd3, { 89 // animation: 150, 90 // }); 91 // } 92 }, 93 editor: function initializeJoditEditors() { 94 Jodit.plugins.add("stat", function (editor) { 95 const statusbar = document.createElement("div"); 96 statusbar.style.backgroundColor = "#fff"; 97 statusbar.style.fontSize = "16px"; 98 statusbar.style.padding = "1px 4px"; 99 100 function calcStat() { 101 var text = Jodit.modules.Helpers.trim(editor.editor.innerText), 102 wordCount = text.split(/[\s\n\r\t]+/).filter(function (value) { 103 return value; 104 }).length, 105 charCount = text.replace(/[\s\n\r\t]+/, "").length; 106 107 statusbar.innerText = "words: " + wordCount + " chars: " + charCount; 108 } 109 110 editor.events 111 .on("change afterInit", editor.async.debounce(calcStat, 100)) 112 .on("afterInit", function () { 113 editor.container.appendChild(statusbar); 114 }); 115 }); 116 117 // Check if the element exists before initializing Jodit 118 const editor1Element = document.querySelector("#editor1"); 119 const editor2Element = document.querySelector("#editor2"); 120 const editor3Element = document.querySelector("#editor3"); 121 122 if (editor1Element) { 123 Jodit.make(editor1Element); 124 } 125 if (editor2Element) { 126 Jodit.make(editor2Element); 127 } 128 if (editor3Element) { 129 Jodit.make(editor3Element); 130 } 131 }, 132 133 multiStepForm: function () { 134 document.addEventListener('DOMContentLoaded', () => { 135 const DOMstrings = { 136 stepsBtnClass: 'multisteps-form__progress-btn', 137 stepsBtns: document.querySelectorAll('.multisteps-form__progress-btn'), 138 stepsBar: document.querySelector('.multisteps-form__progress'), 139 stepsForm: document.querySelector('.multisteps-form__form'), 140 stepsFormTextareas: document.querySelectorAll('.multisteps-form__textarea'), 141 stepFormPanelClass: 'multisteps-form__panel', 142 stepFormPanels: document.querySelectorAll('.multisteps-form__panel'), 143 stepPrevBtnClass: 'rbt-step-btn-prev', 144 stepNextBtnClass: 'rbt-step-btn-next', 145 }; 146 147 // Function to remove classes 148 const removeClasses = (elemSet, className) => { 149 elemSet.forEach(elem => { 150 elem.classList.remove(className); 151 }); 152 }; 153 154 // Find parent of an element 155 const findParent = (elem, parentClass) => { 156 let currentNode = elem; 157 while (!currentNode.classList.contains(parentClass)) { 158 currentNode = currentNode.parentNode; 159 } 160 return currentNode; 161 }; 162 163 // Get active step 164 const getActiveStep = elem => { 165 return Array.from(DOMstrings.stepsBtns).indexOf(elem); 166 }; 167 168 // Set active step 169 const setActiveStep = activeStepNum => { 170 removeClasses(DOMstrings.stepsBtns, 'rbt-active'); 171 DOMstrings.stepsBtns.forEach((elem, index) => { 172 if (index <= activeStepNum) { 173 elem.classList.add('rbt-active'); 174 } 175 }); 176 }; 177 178 // Get active panel 179 const getActivePanel = () => { 180 let activePanel;
181 DOMstrings.stepFormPanels.forEach(elem => { 182 if (elem.classList.contains('rbt-active')) { 183 activePanel = elem; 184 } 185 }); 186 return activePanel; 187 }; 188 189 // Set active panel 190 const setActivePanel = activePanelNum => { 191 removeClasses(DOMstrings.stepFormPanels, 'rbt-active'); 192 DOMstrings.stepFormPanels.forEach((elem, index) => { 193 if (index === activePanelNum) { 194 elem.classList.add('rbt-active'); 195 } 196 }); 197 }; 198 199 // Add event listener to stepsBar 200 if (DOMstrings.stepsBar) { 201 DOMstrings.stepsBar.addEventListener('click', e => { 202 const eventTarget = e.target; 203 204 if (!eventTarget.classList.contains(DOMstrings.stepsBtnClass)) { 205 return; 206 } 207 208 const activeStep = getActiveStep(eventTarget);
209 setActiveStep(activeStep); 210 setActivePanel(activeStep); 211 }); 212 } 213 214 // Add event listener to stepsForm 215 if (DOMstrings.stepsForm) { 216 DOMstrings.stepsForm.addEventListener('click', e => { 217 const eventTarget = e.target; 218 219 if ( 220 !( 221 eventTarget.classList.contains(DOMstrings.stepPrevBtnClass) || 222 eventTarget.classList.contains(DOMstrings.stepNextBtnClass) 223 ) 224 ) { 225 return; 226 } 227 228 const activePanel = findParent(eventTarget, DOMstrings.stepFormPanelClass); 229 let activePanelNum = Array.from(DOMstrings.stepFormPanels).indexOf(activePanel); 230 231 if (eventTarget.classList.contains(DOMstrings.stepPrevBtnClass)) { 232 activePanelNum--; 233 } else { 234 activePanelNum++; 235 } 236
237 setActiveStep(activePanelNum); 238 setActivePanel(activePanelNum); 239 }); 240 } 241 }); 242 }, 243 244 cursorFollow: function () { 245 let mouseX = 0, mouseY = 0; 246 let xp = 0, yp = 0; 247 const cursorFollower = document.getElementById("cursorFollower"); 248 const container = document.querySelector(".cf_boundary"); 249 250 if (container) { 251 document.addEventListener("mousemove", (e) => { 252 const rect = container.getBoundingClientRect(); 253 254 mouseX = e.clientX - rect.left; 255 mouseY = e.clientY - rect.top; 256 257 const maxX = rect.width - cursorFollower.offsetWidth / 2; 258 const maxY = rect.height - cursorFollower.offsetHeight / 2; 259 const minX = cursorFollower.offsetWidth / 2; 260 const minY = cursorFollower.offsetHeight / 2; 261 262 mouseX = Math.max(minX, Math.min(mouseX, maxX)); 263 mouseY = Math.max(minY, Math.min(mouseY, maxY)); 264 }); 265 266 function animateCursor() { 267 xp += (mouseX - xp) * 0.1; 268 yp += (mouseY - yp) * 0.1; 269 270 cursorFollower.style.left = `${xp}px`; 271 cursorFollower.style.top = `${yp}px`; 272 273 requestAnimationFrame(animateCursor); 274 } 275 276 animateCursor(); 277 } 278 279 }, 280 281 toggleModal: function () { 282 var currentQuestion = 1; 283 var totalQuestions = $(".question").length; 284 showQuestion(currentQuestion); 285 286 $("#next-btn, #next-btn-2").click(function () { 287 if (currentQuestion < totalQuestions) { 288 markQuestionAsComplete(currentQuestion); // Mark the current question as complete 289 currentQuestion++; 290 updateProgressBar(currentQuestion); 291 showQuestion(currentQuestion); 292 } 293 }); 294 295 $("#prev-btn").click(function () { 296 if (currentQuestion > 1) { 297 currentQuestion--; 298 updateProgressBar(currentQuestion); 299 showQuestion(currentQuestion); 300 } 301 }); 302 303 function showQuestion(questionNumber) { 304 $(".question").hide(); 305 $("#question-" + questionNumber).show(); 306 307 if (questionNumber == 1) { 308 $("#prev-btn").prop("disabled", true); 309 } else { 310 $("#prev-btn").prop("disabled", false); 311 } 312 313 if (questionNumber == totalQuestions) { 314 $("#next-btn-2").show(); 315 $("#submit-btn").show(); 316 } else { 317 $("#next-btn-2").show(); 318 $("#submit-btn").hide(); 319 } 320 } 321 322 function updateProgressBar(questionNumber) { 323 var progressPercentage = (questionNumber / totalQuestions) * 100; 324 $(".progress-bar").css("width", progressPercentage + "%"); 325 $(".progress").attr("aria-valuenow", progressPercentage); 326 } 327 328 function markQuestionAsComplete(questionNumber) { 329 const buttonSelector = `.quiz-modal-btn:nth-child(${questionNumber})`; 330 const button = $(buttonSelector); 331 332 button.html('<i class="feather-check"></i>'); 333 button.addClass("quiz-modal__active"); 334 335 if (questionNumber == 3) { 336 button.html('<i class="feather-check"></i>'); 337 button.addClass("quiz-modal__active"); 338 } 339 } 340 341 $("#quiz-form").submit(function (event) { 342 event.preventDefault(); 343 }); 344 }, 345 typeField: function () { 346 const textarea = document.getElementById("answerTextArea"); 347 const charCountSpan = document.querySelector(".chr"); 348 349 // Check if the textarea element exists before adding the event listener 350 if (textarea && charCountSpan) { 351 textarea.addEventListener("input", () => { 352 const currentLength = textarea.value.length; 353 const remainingChars = 500 - currentLength; 354 355 if (remainingChars >= 0) { 356 charCountSpan.textContent = `Character Remaining: ${remainingChars}`; 357 } else { 358 textarea.value = textarea.value.substring(0, 500); 359 charCountSpan.textContent = `Character Remaining: 0`; 360 } 361 }); 362 } 363 }, 364 countDown: function () { 365 let time = 3600; 366 let isTimeEnd = false; 367 368 function updateTimer() { 369 const timerText = document.getElementById("timerText"); 370 371 if (timerText) { 372 if (time <= 0) { 373 isTimeEnd = true; 374 timerText.textContent = "0h 0m 0s"; 375 return; 376 } 377 378 const getHours = Math.floor(time / 3600); 379 const getMinutes = Math.floor((time % 3600) / 60); 380 const getSeconds = time % 60; 381 382 timerText.textContent = `${getHours}h ${getMinutes}m ${getSeconds}s`; 383 384 time -= 1;
385 } else { 386 clearInterval(interval); 387 } 388 } 389 390 const interval = setInterval(() => { 391 updateTimer(); 392 393 if (isTimeEnd) { 394 clearInterval(interval); 395 } 396 }, 1000); 397 }, 398 autoslidertab: function (params) { 399 function tabChange() { 400 var tabs = $(".nav-tabs.splash-nav-tabs > li"); 401 var active = tabs.find("a.active"); 402 var next = active.parent("li").next("li").find("a"); 403 if (next.length === 0) { 404 next = tabs.first().find("a").on("click"); 405 } 406 next.tab("show"); 407 } 408 var tabCycle = setInterval(tabChange, 5000); 409 }, 410 411 offCanvas: function (params) { 412 if ($("#rbt-offcanvas-activation").length) { 413 $("#rbt-offcanvas-activation").on("click", function () { 414 $(".side-menu").addClass("side-menu-active"), 415 $("body").addClass("offcanvas-menu-active"); 416 }), 417 $(".close_side_menu").on("click", function () { 418 $(".side-menu").removeClass("side-menu-active"), 419 $("body").removeClass("offcanvas-menu-active"); 420 }), 421 $(".side-menu .side-nav .navbar-nav li a").on("click", function () { 422 $(".side-menu").removeClass("side-menu-active"), 423 $("body").removeClass("offcanvas-menu-active"); 424 }), 425 $("#btn_sideNavClose").on("click", function () { 426 $(".side-menu").removeClass("side-menu-active"), 427 $("body").removeClass("offcanvas-menu-active"); 428 }); 429 } 430 }, 431 432 cartSidenav: function (params) { 433 if ($(".rbt-cart-sidenav-activation").length) { 434 $(".rbt-cart-sidenav-activation").on("click", function () { 435 $(".rbt-cart-side-menu").addClass("side-menu-active"), 436 $("body").addClass("cart-sidenav-menu-active"); 437 }), 438 $(".minicart-close-button").on("click", function () { 439 $(".rbt-cart-side-menu").removeClass("side-menu-active"), 440 $("body").removeClass("cart-sidenav-menu-active"); 441 }), 442 $(".side-menu .side-nav .navbar-nav li a").on("click", function () { 443 $(".rbt-cart-side-menu").removeClass("side-menu-active"), 444 $("body").removeClass("cart-sidenav-menu-active"); 445 }), 446 $("#btn_sideNavClose, .close_side_menu").on("click", function () { 447 $(".rbt-cart-side-menu").removeClass("side-menu-active"), 448 $("body").removeClass("cart-sidenav-menu-active"); 449 }); 450 } 451 }, 452 453 menuCurrentLink: function () { 454 var currentPage = location.pathname.split("https://histudy.pixcelsthemes.com/"), 455 current = currentPage[currentPage.length - 1]; 456 $( 457 ".mainmenu li a, .dashboard-mainmenu li a, .for-right-content .rbt-course-main-content li a" 458 ).each(function () { 459 var $this = $(this); 460 if ($this.attr("href") === current) { 461 $this.addClass("active"); 462 $this.parents(".has-menu-child-item").addClass("menu-item-open"); 463 } 464 }); 465 }, 466 467 salActive: function () { 468 sal({ 469 threshold: 0.01, 470 once: true, 471 }); 472 }, 473 474 eduParalax: function () { 475 var scene = document.getElementById("scene"); 476 var parallaxInstance = new Parallax(scene); 477 }, 478 479 eduSwiperActive: function () { 480 var swiper = new Swiper(".banner-swiper-active", { 481 effect: "cards", 482 grabCursor: true, 483 pagination: { 484 el: ".rbt-swiper-pagination", 485 clickable: true, 486 }, 487 }); 488 489 var swiper = new Swiper(".team-slide-activation", { 490 slidesPerView: 1, 491 spaceBetween: 30, 492 loop: true, 493 pagination: { 494 el: ".rbt-swiper-pagination", 495 clickable: true, 496 }, 497 navigation: { 498 nextEl: ".rbt-arrow-right", 499 prevEl: ".rbt-arrow-left", 500 clickable: true, 501 }, 502 breakpoints: { 503 575: { 504 slidesPerView: 1, 505 }, 506 768: { 507 slidesPerView: 2, 508 }, 509 992: { 510 slidesPerView: 3, 511 }, 512 }, 513 }); 514 515 var swiper = new Swiper(".team-slide-activation-4", { 516 slidesPerView: 1, 517 spaceBetween: 30, 518 loop: true, 519 pagination: { 520 el: ".rbt-swiper-pagination", 521 clickable: true, 522 }, 523 navigation: { 524 nextEl: ".rbt-arrow-right", 525 prevEl: ".rbt-arrow-left", 526 clickable: true, 527 }, 528 breakpoints: { 529 575: { 530 slidesPerView: 1, 531 }, 532 768: { 533 slidesPerView: 2, 534 }, 535 992: { 536 slidesPerView: 3, 537 }, 538 539 1200: { 540 slidesPerView: 4, 541 }, 542 }, 543 }); 544 545 var swiper = new Swiper(".blog-post-gallery-activation", { 546 slidesPerView: 1, 547 autoHeight: true, 548 loop: true, 549 navigation: { 550 nextEl: ".rbt-arrow-right", 551 prevEl: ".rbt-arrow-left", 552 clickable: true, 553 }, 554 }); 555 556 var swiper = new Swiper(".team-slide-activation-2", { 557 slidesPerView: 3, 558 spaceBetween: 0, 559 loop: true, 560 pagination: { 561 el: ".rbt-swiper-pagination", 562 clickable: true, 563 }, 564 breakpoints: { 565 320: { 566 slidesPerView: 1, 567 }, 568 480: { 569 slidesPerView: 2, 570 }, 571 768: { 572 slidesPerView: 2, 573 }, 574 992: { 575 slidesPerView: 3, 576 }, 577 }, 578 }); 579 580 var swiper = new Swiper(".service-item-3-activation", { 581 slidesPerView: 1, 582 spaceBetween: 0, 583 loop: false, 584 navigation: { 585 nextEl: ".rbt-arrow-right", 586 prevEl: ".rbt-arrow-left", 587 clickable: true, 588 }, 589 breakpoints: { 590 480: { 591 slidesPerView: 1, 592 }, 593 481: { 594 slidesPerView: 2, 595 }, 596 768: { 597 slidesPerView: 3, 598 }, 599 992: { 600 slidesPerView: 3, 601 }, 602 }, 603 }); 604 605 var swiper = new Swiper(".viral-banner-activation", { 606 slidesPerView: 1, 607 spaceBetween: 0, 608 loop: false, 609 navigation: { 610 nextEl: ".rbt-arrow-right", 611 prevEl: ".rbt-arrow-left", 612 clickable: true, 613 }, 614 }); 615 616 var swiper = new Swiper(".udemy-affilite-activation", { 617 slidesPerView: 1, 618 spaceBetween: 0, 619 loop: true, 620 navigation: { 621 nextEl: ".rbt-arrow-right", 622 prevEl: ".rbt-arrow-left", 623 clickable: true, 624 }, 625 }); 626 627 var swiperThumb = new Swiper(".rbtmySwiperThumb", { 628 spaceBetween: 10, 629 slidesPerView: 2, 630 freeMode: true, 631 watchSlidesProgress: true, 632 }); 633 634 var swiper = new Swiper(".rbt-banner-activation", { 635 slidesPerView: 1, 636 spaceBetween: 0, 637 loop: true, 638 autoplay: true, 639 autoHeight: true, 640 autoplaySpeed: 12000, 641 navigation: { 642 nextEl: ".rbt-arrow-right", 643 prevEl: ".rbt-arrow-left", 644 clickable: true, 645 }, 646 thumbs: { 647 swiper: swiperThumb,
648 }, 649 }); 650 651 652 653 654 var swiper = new Swiper(".rbt-banner-activation-2", { 655 slidesPerView: 1, 656 spaceBetween: 0, 657 loop: false, 658 autoHeight: true, 659 navigation: { 660 nextEl: ".rbt-arrow-right", 661 prevEl: ".rbt-arrow-left", 662 clickable: true, 663 }, 664 }); 665 666 var swiper = new Swiper(".rbt-gif-banner-area", { 667 slidesPerView: 1, 668 spaceBetween: 0, 669 loop: true, 670 navigation: { 671 nextEl: ".rbt-arrow-right", 672 prevEl: ".rbt-arrow-left", 673 clickable: true, 674 }, 675 }); 676 677 var swiper = new Swiper(".announcement-slide", { 678 slidesPerView: 1, 679 spaceBetween: 0, 680 autoplay: true, 681 margin: 5, 682 loop: true, 683 navigation: { 684 nextEl: ".rbt-arrow-right", 685 prevEl: ".rbt-arrow-left", 686 clickable: true, 687 }, 688 pagination: { 689 el: ".rbt-swiper-pagination", 690 clickable: true, 691 }, 692 breakpoints: { 693 575: { 694 slidesPerView: 1, 695 }, 696 697 768: { 698 slidesPerView: 1, 699 }, 700 701 992: { 702 slidesPerView: 1, 703 }, 704 }, 705 }); 706 707 var swiper = new Swiper(".event-cstm-carousel", { 708 slidesPerView: 1, 709 spaceBetween: 0, 710 autoplay: true, 711 margin: 5, 712 loop: true, 713 navigation: { 714 nextEl: ".rbt-arrow-right", 715 prevEl: ".rbt-arrow-left", 716 clickable: true, 717 }, 718 pagination: { 719 el: ".rbt-swiper-pagination", 720 clickable: true, 721 }, 722 breakpoints: { 723 575: { 724 slidesPerView: 1, 725 }, 726 727 768: { 728 slidesPerView: 1, 729 }, 730 731 992: { 732 slidesPerView: 1, 733 }, 734 }, 735 }); 736 var swiper = new Swiper(".social-item", { 737 slidesPerView: 1, 738 spaceBetween: 0, 739 autoplay: true, 740 margin: 5, 741 loop: true, 742 navigation: { 743 nextEl: ".rbt-arrow-right", 744 prevEl: ".rbt-arrow-left", 745 clickable: true, 746 }, 747 pagination: { 748 el: ".rbt-swiper-pagination", 749 clickable: true, 750 }, 751 breakpoints: { 752 575: { 753 slidesPerView: 1, 754 }, 755 756 768: { 757 slidesPerView: 2, 758 }, 759 760 992: { 761 slidesPerView: 3, 762 }, 763 }, 764 }); 765 766 var swiper = new Swiper(".tender-item-4-activation", { 767 slidesPerView: 1, 768 spaceBetween: 0, 769 autoplay: true, 770 margin: 5, 771 loop: true, 772 navigation: { 773 nextEl: ".rbt-arrow-right", 774 prevEl: ".rbt-arrow-left", 775 clickable: true, 776 }, 777 pagination: { 778 el: ".rbt-swiper-pagination", 779 clickable: true, 780 }, 781 breakpoints: { 782 575: { 783 slidesPerView: 1, 784 }, 785 786 768: { 787 slidesPerView: 2, 788 }, 789 790 992: { 791 slidesPerView: 4, 792 }, 793 }, 794 }); 795 796 var swiper = new Swiper(".testimonial-item-3-activation", { 797 slidesPerView: 1, 798 spaceBetween: 0, 799 loop: true, 800 navigation: { 801 nextEl: ".rbt-arrow-right", 802 prevEl: ".rbt-arrow-left", 803 clickable: true, 804 }, 805 pagination: { 806 el: ".rbt-swiper-pagination", 807 clickable: true, 808 }, 809 breakpoints: { 810 575: { 811 slidesPerView: 1, 812 }, 813 814 768: { 815 slidesPerView: 2, 816 }, 817 818 1025: { 819 slidesPerView: 2, 820 }, 821 822 1200: { 823 slidesPerView: 3, 824 }, 825 826 }, 827 }); 828 829 var swiper = new Swiper(".testimonial-item-3-activation-social", { 830 slidesPerView: 1, 831 spaceBetween: 0, 832 loop: true, 833 navigation: { 834 nextEl: ".rbt-arrow-right", 835 prevEl: ".rbt-arrow-left", 836 clickable: true, 837 }, 838 pagination: { 839 el: ".rbt-swiper-pagination", 840 clickable: true, 841 }, 842 breakpoints: { 843 575: { 844 slidesPerView: 1, 845 }, 846 847 768: { 848 slidesPerView: 2, 849 }, 850 851 992: { 852 slidesPerView: 3, 853 }, 854 }, 855 }); 856 857 858 var swiper = new Swiper(".global-network-slide", { 859 slidesPerView: 1, 860 spaceBetween: 0, 861 loop: true, 862 navigation: { 863 nextEl: ".rbt-arrow-right", 864 prevEl: ".rbt-arrow-left", 865 clickable: true, 866 }, 867 pagination: { 868 el: ".rbt-swiper-pagination", 869 clickable: true, 870 }, 871 breakpoints: { 872 575: { 873 slidesPerView: 2, 874 }, 875 876 768: { 877 slidesPerView: 2, 878 }, 879 880 992: { 881 slidesPerView: 7, 882 }, 883 }, 884 }); 885 886 var swiper = new Swiper(".global-network-slide2", { 887 slidesPerView: 1, 888 spaceBetween: 0, 889 loop: true, 890 navigation: { 891 nextEl: ".rbt-arrow-right", 892 prevEl: ".rbt-arrow-left", 893 clickable: true, 894 }, 895 pagination: { 896 el: ".rbt-swiper-pagination", 897 clickable: true, 898 }, 899 breakpoints: { 900 575: { 901 slidesPerView: 2, 902 }, 903 904 768: { 905 slidesPerView: 3, 906 }, 907 908 992: { 909 slidesPerView: 6, 910 }, 911 }, 912 }); 913 914 var swiper = new Swiper(".testimonial-activation-1", { 915 slidesPerView: 1, 916 spaceBetween: 0, 917 loop: true, 918 pagination: { 919 el: ".rbt-swiper-pagination", 920 clickable: true, 921 }, 922 }); 923 924 var swiper = new Swiper(".modern-course-carousel-activation", { 925 slidesPerView: 1, 926 spaceBetween: 0, 927 loop: true, 928 navigation: { 929 nextEl: ".rbt-arrow-right", 930 prevEl: ".rbt-arrow-left", 931 clickable: true, 932 }, 933 }); 934 935 var swiper = new Swiper(".category-activation-one", { 936 slidesPerView: 1, 937 spaceBetween: 0, 938 loop: true, 939 navigation: { 940 nextEl: ".rbt-arrow-right", 941 prevEl: ".rbt-arrow-left", 942 clickable: true, 943 }, 944 pagination: { 945 el: ".rbt-swiper-pagination", 946 clickable: true, 947 }, 948 breakpoints: { 949 481: { 950 slidesPerView: 1, 951 }, 952 768: { 953 slidesPerView: 2, 954 }, 955 992: { 956 slidesPerView: 3, 957 }, 958 1200: { 959 slidesPerView: 4, 960 }, 961 }, 962 }); 963 964 var swiper = new Swiper(".category-activation-two", { 965 slidesPerView: 1, 966 spaceBetween: 0, 967 loop: false, 968 navigation: { 969 nextEl: ".rbt-arrow-right", 970 prevEl: ".rbt-arrow-left", 971 clickable: true, 972 }, 973 scrollbar: { 974 el: ".swiper-scrollbar", 975 draggable: true, 976 hide: true, 977 snapOnRelease: true, 978 }, 979 breakpoints: { 980 480: { 981 slidesPerView: 1, 982 }, 983 481: { 984 slidesPerView: 2, 985 }, 986 768: { 987 slidesPerView: 2, 988 }, 989 992: { 990 slidesPerView: 3, 991 }, 992 993 1200: { 994 slidesPerView: 6, 995 }, 996 }, 997 }); 998 999 var swiper = new Swiper(".category-activation-three", { 1000 slidesPerView: 1, 1001 spaceBetween: 0, 1002 loop: true, 1003 navigation: { 1004 nextEl: ".rbt-arrow-right", 1005 prevEl: ".rbt-arrow-left", 1006 clickable: true, 1007 }, 1008 scrollbar: { 1009 el: ".swiper-scrollbar", 1010 draggable: true, 1011 hide: true, 1012 snapOnRelease: true, 1013 }, 1014 breakpoints: { 1015 480: { 1016 slidesPerView: 1, 1017 }, 1018 481: { 1019 slidesPerView: 2, 1020 }, 1021 768: { 1022 slidesPerView: 2, 1023 }, 1024 992: { 1025 slidesPerView: 3, 1026 }, 1027 1200: { 1028 slidesPerView: 4, 1029 }, 1030 }, 1031 }); 1032 1033 var swiper = new Swiper(".category-activation-four", { 1034 slidesPerView: 1, 1035 spaceBetween: 30, 1036 loop: true, 1037 navigation: { 1038 nextEl: ".rbt-arrow-right", 1039 prevEl: ".rbt-arrow-left", 1040 clickable: true, 1041 }, 1042 scrollbar: { 1043 el: ".swiper-scrollbar", 1044 draggable: true, 1045 hide: true, 1046 snapOnRelease: true, 1047 }, 1048 breakpoints: { 1049 480: { 1050 slidesPerView: 1, 1051 }, 1052 481: { 1053 slidesPerView: 2, 1054 }, 1055 768: { 1056 slidesPerView: 2, 1057 }, 1058 992: { 1059 slidesPerView: 3, 1060 }, 1061 1200: { 1062 slidesPerView: 4, 1063 }, 1064 }, 1065 }); 1066 1067 var swiper = new Swiper(".event-activation-1", { 1068 slidesPerView: 1, 1069 slidesPerGroup: 1, 1070 loop: true, 1071 spaceBetween: 30, 1072 navigation: { 1073 nextEl: ".rbt-arrow-right", 1074 prevEl: ".rbt-arrow-left", 1075 clickable: true, 1076 }, 1077 scrollbar: { 1078 el: ".swiper-scrollbar", 1079 draggable: true, 1080 hide: true, 1081 snapOnRelease: true, 1082 }, 1083 pagination: { 1084 el: ".rbt-swiper-pagination", 1085 clickable: true, 1086 }, 1087 breakpoints: { 1088 575: { 1089 slidesPerView: 1, 1090 }, 1091 1092 768: { 1093 slidesPerView: 2, 1094 }, 1095 1096 992: { 1097 slidesPerView: 3, 1098 }, 1099 1200: { 1100 slidesPerView: 3, 1101 slidesPerGroup: 3, 1102 }, 1103 }, 1104 }); 1105 1106 var swiper = new Swiper(".banner-splash-inner-layout-active", { 1107 effect: "cards", 1108 grabCursor: true, 1109 clickable: true, 1110 loop: true, 1111 pagination: { 1112 el: ".rbt-swiper-pagination", 1113 clickable: true, 1114 type: "fraction", 1115 }, 1116 navigation: { 1117 nextEl: ".rbt-arrow-right", 1118 prevEl: ".rbt-arrow-left", 1119 clickable: true, 1120 }, 1121 }); 1122 }, 1123 1124 eduBgCardHover: function () {
1125 $(".rbt-hover-active").mouseenter(function () { 1126 var self = this; 1127 setTimeout(function () { 1128 $(".rbt-hover-active.active").removeClass("active"); 1129 $(self).addClass("active"); 1130 }, 0); 1131 }); 1132 }, 1133 1134 magnigyPopup: function () { 1135 $(document).on("ready", function () { 1136 $(".popup-video").magnificPopup({ 1137 disableOn: 700, 1138 type: "iframe", 1139 mainClass: "mfp-fade", 1140 removalDelay: 160, 1141 preloader: false, 1142 fixedContentPos: false, 1143 }); 1144 }); 1145 }, 1146 1147 counterUp: function () { 1148 var odo = $(".odometer"); 1149 odo.each(function () { 1150 $(".odometer").appear(function (e) { 1151 var countNumber = $(this).attr("data-count"); 1152 $(this).html(countNumber); 1153 }); 1154 }); 1155 }, 1156 1157 pricingPlan: function () { 1158 var mainPlan = $(".rbt-pricing-area"); 1159 mainPlan.each(function () { 1160 var yearlySelectBtn = $(".yearly-plan-btn"), 1161 monthlySelectBtn = $(".monthly-plan-btn"), 1162 monthlyPrice = $(".monthly-pricing"), 1163 yearlyPrice = $(".yearly-pricing"), 1164 buttonSlide = $(".pricing-checkbox"); 1165 1166 $(monthlySelectBtn).on("click", function () { 1167 buttonSlide.prop("checked", true); 1168 $(this) 1169 .addClass("active") 1170 .parent(".nav-item") 1171 .siblings() 1172 .children() 1173 .removeClass("active"); 1174 monthlyPrice.css("display", "block"); 1175 yearlyPrice.css("display", "none"); 1176 }); 1177 1178 $(yearlySelectBtn).on("click", function () { 1179 buttonSlide.prop("checked", false); 1180 $(this) 1181 .addClass("active") 1182 .parent(".nav-item") 1183 .siblings() 1184 .children() 1185 .removeClass("active"); 1186 monthlyPrice.css("display", "none"); 1187 yearlyPrice.css("display", "block"); 1188 }); 1189 1190 $(buttonSlide).change(function () { 1191 if ($('input[class="pricing-checkbox"]:checked').length > 0) { 1192 monthlySelectBtn.addClass("active"); 1193 yearlySelectBtn.removeClass("active"); 1194 monthlyPrice.css("display", "block"); 1195 yearlyPrice.css("display", "none"); 1196 } else { 1197 yearlySelectBtn.addClass("active"); 1198 monthlySelectBtn.removeClass("active"); 1199 monthlyPrice.css("display", "none"); 1200 yearlyPrice.css("display", "block"); 1201 } 1202 }); 1203 }); 1204 }, 1205 1206 courseView: function () { 1207 var gridViewBtn = $(".rbt-grid-view"), 1208 listViewBTn = $(".rbt-list-view"); 1209 1210 $(gridViewBtn).on("click", function () { 1211 $(this) 1212 .addClass("active") 1213 .parent(".course-switch-item") 1214 .siblings() 1215 .children() 1216 .removeClass("active"); 1217 $(".rbt-course-grid-column").addClass("active-grid-view"); 1218 $(".rbt-course-grid-column").removeClass("active-list-view"); 1219 $(".rbt-card").removeClass("card-list-2"); 1220 }); 1221 1222 $(listViewBTn).on("click", function () { 1223 $(this) 1224 .addClass("active") 1225 .parent(".course-switch-item") 1226 .siblings() 1227 .children() 1228 .removeClass("active"); 1229 $(".rbt-course-grid-column").removeClass("active-grid-view"); 1230 $(".rbt-course-grid-column").addClass("active-list-view"); 1231 $(".rbt-card").addClass("card-list-2"); 1232 }); 1233 }, 1234 1235 stickyHeader: function () {
1236 // Header Transparent 1237 if ($("header").hasClass("header-transparent")) { 1238 $("body").addClass("active-header-transparent"); 1239 } else { 1240 $("body").removeClass("active-header-transparent"); 1241 } 1242 }, 1243 1244 masonryActivation: function name(params) { 1245 $(window).load(function () { 1246 $(".masonary-wrapper-activation").imagesLoaded(function () { 1247 // filter items on button click 1248 $(".messonry-button").on("click", "button", function () { 1249 var filterValue = $(this).attr("data-filter"); 1250 $(this).siblings(".is-checked").removeClass("is-checked"); 1251 $(this).addClass("is-checked"); 1252 $grid.isotope({ 1253 filter: filterValue, 1254 }); 1255 }); 1256 // init Isotope 1257 var $grid = $(".mesonry-list").isotope({ 1258 percentPosition: true, 1259 transitionDuration: "0.7s", 1260 layoutMode: "masonry", 1261 masonry: { 1262 columnWidth: ".resizer", 1263 }, 1264 }); 1265 }); 1266 }); 1267 1268 $(window).load(function () { 1269 $(".splash-masonary-wrapper-activation").imagesLoaded(function () { 1270 // filter items on button click 1271 $(".messonry-button").on("click", "button", function () { 1272 var filterValue = $(this).attr("data-filter"); 1273 $(this).siblings(".is-checked").removeClass("is-checked"); 1274 $(this).addClass("is-checked"); 1275 $grid.isotope({ 1276 filter: filterValue, 1277 }); 1278 }); 1279 // init Isotope 1280 var $grid = $(".splash-mesonry-list").isotope({ 1281 percentPosition: true, 1282 transitionDuration: "0.7s", 1283 layoutMode: "masonry", 1284 masonry: { 1285 columnWidth: ".resizer", 1286 }, 1287 }); 1288 }); 1289 }); 1290 }, 1291 1292 _clickDoc: function () { 1293 var inputblur, inputFocus, openSideNav, closeSideNav; 1294 inputblur = function (e) { 1295 if (!$(this).val()) { 1296 $(this).parent(".form-group").removeClass("focused"); 1297 } 1298 }; 1299 inputFocus = function (e) { 1300 $(this).parents(".form-group").addClass("focused"); 1301 }; 1302 openSideNav = function (e) { 1303 e.preventDefault(); 1304 eduJs.sideNav.addClass("active"); 1305 $(".search-trigger-active").addClass("open"); 1306 eduJs._html.addClass("side-nav-opened"); 1307 }; 1308 1309 closeSideNav = function (e) { 1310 if ( 1311 !$( 1312 '.rbt-search-dropdown, .rbt-search-dropdown *:not(".search-trigger-active, .search-trigger-active *")' 1313 ).is(e.target) 1314 ) { 1315 eduJs.sideNav.removeClass("active"); 1316 $(".search-trigger-active").removeClass("open"); 1317 eduJs._html.removeClass("side-nav-opened"); 1318 } 1319 }; 1320 eduJs._document 1321 .on("blur", "input,textarea,select", inputblur) 1322 .on( 1323 "focus", 1324 'input:not([type="radio"]),input:not([type="checkbox"]),textarea,select', 1325 inputFocus 1326 ) 1327 .on("click", ".search-trigger-active", openSideNav) 1328 .on("click", ".side-nav-opened", closeSideNav); 1329 }, 1330 1331 wowActivation: function () { 1332 new WOW().init(); 1333 }, 1334 1335 radialProgress: function () { 1336 $(window).scroll(function () { 1337 /* Check the location of each desired element */ 1338 $(".radial-progress").each(function (i) { 1339 var bottom_of_object = $(this).offset().top + $(this).outerHeight(); 1340 var bottom_of_window = $(window).scrollTop() + $(window).height(); 1341 /* If the object is completely visible in the window, fade it in */ 1342 if (bottom_of_window > bottom_of_object) { 1343 $(".radial-progress").easyPieChart({ 1344 lineWidth: 10, 1345 scaleLength: 0, 1346 rotate: 0, 1347 trackColor: false, 1348 lineCap: "round", 1349 size: 180, 1350 onStep: function (from, to, percent) { 1351 $(this.el).find(".percent").text(Math.round(percent)); 1352 }, 1353 }); 1354 } 1355 }); 1356 }); 1357 }, 1358 1359 marqueImage: function () { 1360 $(".edumarque").each(function () { 1361 var t = 0; 1362 var i = 1; 1363 var $this = $(this); 1364 setInterval(function () { 1365 t += i; 1366 $this.css("background-position-x", -t + "px"); 1367 }, 10); 1368 }); 1369 }, 1370 1371 popupMobileMenu: function (e) { 1372 $(".hamberger-button").on("click", function (e) { 1373 $(".popup-mobile-menu").addClass("active"); 1374 }); 1375 1376 $(".close-button").on("click", function (e) { 1377 $(".popup-mobile-menu").removeClass("active"); 1378 $( 1379 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a" 1380 ) 1381 .siblings(".submenu, .rbt-megamenu") 1382 .removeClass("active") 1383 .slideUp("400"); 1384 $( 1385 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a" 1386 ).removeClass("open"); 1387 }); 1388 1389 $( 1390 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a" 1391 ).on("click", function (e) { 1392 e.preventDefault(); 1393 $(this) 1394 .siblings(".submenu, .rbt-megamenu") 1395 .toggleClass("active") 1396 .slideToggle("400"); 1397 $(this).toggleClass("open"); 1398 }); 1399 1400 $(".popup-mobile-menu, .popup-mobile-menu .mainmenu.onepagenav li a").on( 1401 "click", 1402 function (e) { 1403 e.target === this && 1404 $(".popup-mobile-menu").removeClass("active") && 1405 $( 1406 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a" 1407 ) 1408 .siblings(".submenu, .rbt-megamenu") 1409 .removeClass("active") 1410 .slideUp("400") && 1411 $( 1412 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a" 1413 ).removeClass("open"); 1414 } 1415 ); 1416 }, 1417 1418 headerSticky: function () { 1419 $(window).on("scroll", function () { 1420 if ($("body").hasClass("rbt-header-sticky")) { 1421 var stickyPlaceHolder = $(".rbt-sticky-placeholder"), 1422 headerConainer = $(".rbt-header-wrapper"), 1423 headerConainerH = headerConainer.outerHeight(), 1424 topHeaderH = $(".rbt-header-top").outerHeight() || 0, 1425 targrtScroll = topHeaderH + 200; 1426 if ($(window).scrollTop() > targrtScroll) { 1427 headerConainer.addClass("rbt-sticky"); 1428 stickyPlaceHolder.height(headerConainerH); 1429 } else { 1430 headerConainer.removeClass("rbt-sticky"); 1431 stickyPlaceHolder.height(0); 1432 } 1433 } 1434 }); 1435 }, 1436 1437 qtyBtn: function () { 1438 $(".pro-qty").prepend('<span class="dec qtybtn">-</span>'); 1439 $(".pro-qty").append('<span class="inc qtybtn">+</span>'); 1440 $(".qtybtn").on("click", function () { 1441 var $button = $(this); 1442 var oldValue = $button.parent().find("input").val(); 1443 if ($button.hasClass("inc")) { 1444 var newVal = parseFloat(oldValue) + 1; 1445 } else { 1446 if (oldValue > 0) { 1447 var newVal = parseFloat(oldValue) - 1; 1448 } else { 1449 newVal = 0; 1450 } 1451 } 1452 $button.parent().find("input").val(newVal); 1453 }); 1454 }, 1455 1456 checkoutPage: function () { 1457 $("[data-shipping]").on("click", function () { 1458 if ($("[data-shipping]:checked").length > 0) { 1459 $("#shipping-form").slideDown(); 1460 } else { 1461 $("#shipping-form").slideUp(); 1462 } 1463 }); 1464 $('[name="payment-method"]').on("click", function () { 1465 var $value = $(this).attr("value");
1466 $(".single-method p").slideUp(); 1467 $('[data-method="' + $value + '"]').slideDown(); 1468 }); 1469 }, 1470 1471 onePageNav: function () { 1472 $(".onepagenav").onePageNav({ 1473 currentClass: "current", 1474 changeHash: false, 1475 scrollSpeed: 500, 1476 scrollThreshold: 0.2, 1477 filter: "", 1478 easing: "swing", 1479 }); 1480 }, 1481 1482 transparentHeader: function () { 1483 if ($(".rbt-header").hasClass("rbt-transparent-header")) { 1484 var mainHeader = $(".rbt-header").outerHeight(); 1485 $("body").addClass("rbt-header-transpernt-active"); 1486 $(".header-transperent-spacer").css("padding-top", mainHeader + "px"); 1487 } 1488 }, 1489 1490 categoryMenuHover: function () { 1491 $(".vertical-nav-menu li.vertical-nav-item").mouseover(function () { 1492 $(".rbt-vertical-inner").hide(); 1493 $(".vertical-nav-menu li.vertical-nav-item").removeClass("active"); 1494 $(this).addClass("active"); 1495 var selected_tab = $(this).find("a").attr("href"); 1496 $(selected_tab).stop().fadeIn(); 1497 return false; 1498 }); 1499 }, 1500 1501 selectPicker: function () { 1502 $("select").selectpicker(); 1503 }, 1504 1505 filterClickButton: function () { 1506 $(".discover-filter-activation").on("click", function () { 1507 $(this).toggleClass("open"); 1508 $(".default-exp-expand").slideToggle("400"); 1509 }); 1510 $("#slider-range").slider({ 1511 range: true, 1512 min: 10, 1513 max: 500, 1514 values: [100, 300], 1515 slide: function (event, ui) { 1516 $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); 1517 }, 1518 }); 1519 $("#amount").val( 1520 "$" + 1521 $("#slider-range").slider("values", 0) + 1522 " - $" + 1523 $("#slider-range").slider("values", 1) 1524 ); 1525 }, 1526 1527 headerTopActivation: function () { 1528 $(".bgsection-activation").on("click", function () { 1529 $(this).parents(".rbt-header-campaign").addClass("deactive"); 1530 }); 1531 }, 1532 1533 magnificPopupActivation: function () { 1534 $(".parent-gallery-container").magnificPopup({ 1535 delegate: ".child-gallery-single", // child items selector, by clicking on it popup will open 1536 type: "image", 1537 mainClass: "mfp-with-zoom", 1538 // other options 1539 gallery: { 1540 enabled: true, 1541 }, 1542 image: { 1543 titleSrc: 'data-title' 1544 }, 1545 zoom: { 1546 enabled: true, // By default it's false, so don't forget to enable it 1547 duration: 300, // duration of the effect, in milliseconds 1548 easing: "ease-in-out", // CSS transition easing function 1549 // The "opener" function should return the element from which popup will be zoomed in 1550 // and to which popup will be scaled down 1551 // By defailt it looks for an image tag: 1552 opener: function (openerElement) { 1553 // openerElement is the element on which popup was initialized, in this case its <a> tag 1554 // you don't need to add "opener" option if this code matches your needs, it's defailt one. 1555 return openerElement.is("img") 1556 ? openerElement 1557 : openerElement.find("img"); 1558 }, 1559 }, 1560 }); 1561 }, 1562 1563 showMoreBtn: function () { 1564 $.fn.hasShowMore = function () { 1565 return this.each(function () { 1566 $(this).toggleClass("active"); 1567 $(this).text("Show Less"); 1568 $(this).parent(".has-show-more").toggleClass("active"); 1569 if ($(this).parent(".has-show-more").hasClass("active")) { 1570 $(this).text("Show Less"); 1571 } else { 1572 $(this).text("Show More"); 1573 } 1574 }); 1575 }; 1576 $(document).on("click", ".rbt-show-more-btn", function () { 1577 $(this).hasShowMore(); 1578 }); 1579 }, 1580 1581 sidebarVideoHidden: function () { 1582 var scrollTop = $(".sidebar-video-hidden"); 1583 $(window).scroll(function () { 1584 // declare variable 1585 var topPos = $(this).scrollTop(); 1586 // if user scrolls down - show scroll to top button 1587 if (topPos > 250) { 1588 $(scrollTop).css("display", "none"); 1589 } else { 1590 $(scrollTop).css("display", "block"); 1591 } 1592 }); 1593 }, 1594 1595 courseActionBottom: function () { 1596 var scrollBottom = $(".rbt-course-action-bottom"); 1597 $(window).scroll(function () { 1598 var topPos = $(this).scrollTop(); 1599 var targetPossition = $(document).height() * 0.66; 1600 var filled = 1601 ($(document).scrollTop() + window.innerHeight) / $(document).height(); 1602 if (topPos > targetPossition && filled != 1) { 1603 $(scrollBottom).addClass("rbt-course-action-active"); 1604 } else { 1605 $(scrollBottom).removeClass("rbt-course-action-active"); 1606 } 1607 }); 1608 }, 1609 1610 topbarExpend: function () { 1611 var windowWidth = $(window).width(); 1612 { 1613 if (windowWidth < 1199) { 1614 $(".top-bar-expended").on("click", function () { 1615 $(".top-expended-activation").hasClass("active") 1616 ? ($(".top-expended-activation").removeClass("active"), 1617 $(".top-expended-activation") 1618 .find(".top-expended-wrapper") 1619 .css({ height: "32px" })) 1620 : ($(".top-expended-activation").addClass("active"), 1621 $(".top-expended-activation") 1622 .find(".top-expended-wrapper") 1623 .css({ 1624 height: $(".top-expended-inner").outerHeight() + "px", 1625 })); 1626 }); 1627 $(window).on("hresize", function () { 1628 $(".top-expended-activation").hasClass("active") && 1629 $(".top-expended-activation") 1630 .find(".top-expended-inner") 1631 .css({ 1632 height: $(".top-expended-inner").outerHeight() + "px", 1633 }); 1634 }); 1635 } 1636 } 1637 }, 1638 1639 categoryOffcanvas: function () { 1640 var windowWidth = $(window).width(); 1641 if (windowWidth < 1200) { 1642 $(".rbt-side-offcanvas-activation").on("click", function () { 1643 $(".rbt-offcanvas-side-menu").addClass("active-offcanvas"); 1644 }); 1645 $(".rbt-close-offcanvas").on("click", function () { 1646 $(".rbt-offcanvas-side-menu").removeClass("active-offcanvas"); 1647 }); 1648 $(".rbt-offcanvas-side-menu").on("click", function (e) { 1649 e.target === this && 1650 $(".rbt-offcanvas-side-menu").removeClass("active-offcanvas"); 1651 }); 1652 $(".rbt-vertical-nav-list-wrapper .vertical-nav-item a").on( 1653 "click", 1654 function (e) { 1655 e.preventDefault(); 1656 $(this) 1657 .siblings(".vartical-nav-content-menu-wrapper") 1658 .toggleClass("active") 1659 .slideToggle("400"); 1660 $(this).toggleClass("active"); 1661 } 1662 ); 1663 } 1664 }, 1665 1666 moveAnimation: function () {
1667 $(".scene").each(function () { 1668 new Parallax($(this)[0]); 1669 }); 1670 }, 1671 1672 contactForm: function () { 1673 $(".rainbow-dynamic-form").on("submit", function (e) { 1674 e.preventDefault(); 1675 var _self = $(this); 1676 var __selector = _self.closest("input,textarea"); 1677 _self.closest("div").find("input,textarea").removeAttr("style"); 1678 _self.find(".error-msg").remove(); 1679 _self 1680 .closest("div") 1681 .find('button[type="submit"]') 1682 .attr("disabled", "disabled"); 1683 var data = $(this).serialize(); 1684 $.ajax({ 1685 url: "mail.php", 1686 type: "post", 1687 dataType: "json", 1688 data: data, 1689 success: function (data) { 1690 _self 1691 .closest("div") 1692 .find('button[type="submit"]') 1693 .removeAttr("disabled"); 1694 if (data.code == false) { 1695 _self.closest("div").find('[name="' + data.field + '"]'); 1696 _self 1697 .find(".rainbow-btn") 1698 .after('<div class="error-msg"><p>*' + data.err + "</p></div>"); 1699 } else { 1700 $(".error-msg").hide(); 1701 $(".form-group").removeClass("focused"); 1702 _self 1703 .find(".rainbow-btn") 1704 .after( 1705 '<div class="success-msg"><p>' + data.success + "</p></div>" 1706 ); 1707 _self.closest("div").find("input,textarea").val(""); 1708 1709 setTimeout(function () { 1710 $(".success-msg").fadeOut("slow"); 1711 }, 5000); 1712 } 1713 }, 1714 }); 1715 }); 1716 }, 1717 1718 player: function () { 1719 var player = new Plyr(".rbtplayer", { 1720 muted: false, 1721 volume: 1, 1722 controls: [ 1723 "play-large", 1724 "play", 1725 "progress", 1726 "current-time", 1727 "mute", 1728 "volume", 1729 "fullscreen", 1730 ], 1731 }); 1732 }, 1733 1734 quizAns: function () { 1735 var currentQuestion = 1; 1736 showQuestion(currentQuestion); 1737 1738 $("#next-btn").click(function () { 1739 if (currentQuestion < $(".question").length) { 1740 currentQuestion++; 1741 showQuestion(currentQuestion); 1742 } 1743 }); 1744 1745 $("#prev-btn").click(function () { 1746 if (currentQuestion > 1) { 1747 currentQuestion--; 1748 showQuestion(currentQuestion); 1749 } 1750 }); 1751 1752 function showQuestion(questionNumber) { 1753 $(".question").hide(); 1754 $("#question-" + questionNumber).show(); 1755 1756 if (questionNumber == 1) { 1757 $("#prev-btn").prop("disabled", true); 1758 } else { 1759 $("#prev-btn").prop("disabled", false); 1760 } 1761 1762 if (questionNumber == $(".question").length) { 1763 $("#next-btn").hide(); 1764 $("#submit-btn").show(); 1765 } else { 1766 $("#next-btn").show(); 1767 $("#submit-btn").hide(); 1768 } 1769 } 1770 $("#quiz-form").submit(function (event) { 1771 event.preventDefault(); 1772 1773 // Here, you can add your logic to grade the quiz and show the results to the user 1774 // alert("Quiz submitted!"); 1775 }); 1776 }, 1777 1778 lessonAccor: function () { 1779 // Get saved data from sessionStorage 1780 let selectedCollapse = sessionStorage.getItem("selectedCollapse"); 1781 if (selectedCollapse != null) { 1782 $(".accordion .collapse").removeClass("show"); 1783 $(".accordion-button") 1784 .addClass("collapsed") 1785 .attr("aria-expanded", false); 1786 $(selectedCollapse).addClass("show"); 1787 $(selectedCollapse) 1788 .siblings() 1789 .find("button") 1790 .removeClass("collapsed") 1791 .attr("aria-expanded", true); 1792 } 1793 // To set, which one will be opened 1794 $(".accordion .accordion-button").on("click", function () { 1795 let target = $(this).data("bs-target"); 1796 // Save data to sessionStorage 1797 sessionStorage.setItem("selectedCollapse", target); 1798 }); 1799 }, 1800 1801 unloadImage: function name() { 1802 $("#createfileImage").click(function (e) { 1803 $("#createinputfile").click(); 1804 }); 1805 function rbtPreview() { 1806 const [file2] = createinputfile.files; 1807 if (file2) { 1808 createfileImage.src = URL.createObjectURL(file2); 1809 } 1810 } 1811 $("#createinputfile").change(function () { 1812 rbtPreview(this); 1813 }); 1814 }, 1815 1816 searchValue: function () { 1817 $(document).on("keyup", ".rbt-search-active", function () { 1818 var value = $(this).val().toLowerCase(); 1819 $(".rbt-search-activation .accordion .accordion-item").filter( 1820 function () { 1821 $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); 1822 } 1823 ); 1824 }); 1825 }, 1826 1827 lessonToggle: function () { 1828 $(".lesson-toggle-active").on("click", function () { 1829 $(this).toggleClass("sidebar-hide"); 1830 $(".rbt-lesson-leftsidebar").toggleClass("sibebar-none"); 1831 }); 1832 }, 1833 1834 categoryMenuHover2: function () { 1835 $(".dropdown-parent-wrapper li.dropdown-parent-list").mouseover( 1836 function () { 1837 $(".dropdown-child-wrapper").hide(); 1838 $(".dropdown-parent-wrapper li.dropdown-parent-list").removeClass( 1839 "active" 1840 ); 1841 $(this).addClass("active"); 1842 var selected_tab = $(this).find("a").attr("href"); 1843 $(selected_tab).stop().fadeIn(); 1844 return false; 1845 } 1846 ); 1847 }, 1848 }; 1849 1850 1851 1852 /*Oasys Code*/ 1853 1854 1855 // var $animation_elements = $('.animation-element'); 1856 // var $window = $(window); 1857 1858 // function check_if_in_view() { 1859 // var window_height = $window.height(); 1860 // var window_top_position = $window.scrollTop(); 1861 // var window_bottom_position = (window_top_position + window_height); 1862 1863 // $.each($animation_elements, function () { 1864 // var $element = $(this); 1865 // var element_height = $element.outerHeight(); 1866 // var element_top_position = $element.offset().top; 1867 // var element_bottom_position = (element_top_position + element_height); 1868 1869 // //check to see if this current container is within viewport 1870 // if ((element_bottom_position >= window_top_position) && 1871 // (element_top_position <= window_bottom_position)) { 1872 // $element.addClass('in-view'); 1873 // } else { 1874 // $element.removeClass('in-view'); 1875 // } 1876 // }); 1877 // } 1878 1879 // $window.on('scroll resize', check_if_in_view); 1880 // $window.trigger('scroll'); 1881 1882 /*Active Menu*/ 1883 1884 document.querySelectorAll(".trigger").forEach(item => { 1885 item.addEventListener("mouseenter", function (e) { 1886 e.preventDefault(); 1887 1888 const parentMenu = this.closest(".rbt-megamenu"); // scope inside parent mega menu 1889 1890 // Hide only sections inside this menu 1891 parentMenu.querySelectorAll(".right-side-sec.extra") 1892 .forEach(sec => sec.classList.remove("active"));
1893 1894 // Remove active only from triggers inside this menu 1895 parentMenu.querySelectorAll(".mega-menu-item li a.trigger") 1896 .forEach(link => link.classList.remove("active")); 1897 1898 // Show target section 1899 const target = this.getAttribute("data-target"); 1900 const section = parentMenu.querySelector(`#${target}`); 1901 if (section) section.classList.add("active"); 1902 1903 // Highlight menu item 1904 this.classList.add("active"); 1905 }); 1906 }); 1907 1908 // â Make sure correct link is active on first load 1909 window.addEventListener("DOMContentLoaded", () => { 1910 document.querySelectorAll(".rbt-megamenu").forEach(menu => { 1911 const activeSection = menu.querySelector(".right-side-sec.extra.active"); 1912 if (activeSection) { 1913 const id = activeSection.getAttribute("id"); 1914 const activeTrigger = menu.querySelector(`.trigger[data-target="${id}"]`); 1915 if (activeTrigger) { 1916 activeTrigger.classList.add("active"); 1917 } 1918 } 1919 }); 1920 }); 1921 1922 /*Reveal*/ 1923 1924 function reveal() { 1925 var reveals = document.querySelectorAll(".reveal"); 1926 1927 for (var i = 0; i < reveals.length; i++) { 1928 var windowHeight = window.innerHeight; 1929 var elementTop = reveals[i].getBoundingClientRect().top; 1930 var elementVisible = 150; 1931 1932 if (elementTop < windowHeight - elementVisible) { 1933 reveals[i].classList.add("active"); 1934 } else { 1935 reveals[i].classList.remove("active"); 1936 } 1937 } 1938 } 1939 1940 window.addEventListener("scroll", reveal); 1941 1942 1943 /*Visitor Counter*/ 1944 1945 $.fn.jQuerySimpleCounter = function (options) { 1946 var settings = $.extend({ 1947 start: 0, 1948 end: 100, 1949 easing: 'swing', 1950 duration: 400, 1951 complete: '' 1952 }, options); 1953 var thisElement = $(this); 1954 1955 $({ count: settings.start }).animate({ count: settings.end }, { 1956 duration: settings.duration, 1957 easing: settings.easing, 1958 step: function () { 1959 var mathCount = Math.ceil(this.count); 1960 thisElement.text(mathCount); 1961 }, 1962 complete: settings.complete 1963 }); 1964 }; 1965 //$('#number1').jQuerySimpleCounter({ end: 730, duration: 4000 }); 1966 1967 /*Chat Screen*/ 1968 $(document).ready(function () { 1969 $('.chatbot').click(function () { 1970 $('.chat-screen').toggleClass('active'); 1971 }); 1972 }); 1973 1974 1975 1976 1977 var $affectedElements = $("p, section h2, section h4, section p, section a"); 1978 1979 $affectedElements.each(function () { 1980 var $this = $(this); 1981 $this.data("orig-size", $this.css("font-size")); 1982 }); 1983 1984 $("#btn-increase").click(function () { 1985 changeFontSize(1); 1986 }) 1987 1988 $("#btn-decrease").click(function () { 1989 changeFontSize(-1); 1990 }) 1991 1992 $("#btn-orig").click(function () { 1993 $affectedElements.each(function () { 1994 var $this = $(this); 1995 $this.css("font-size", $this.data("orig-size")); 1996 }); 1997 }) 1998 1999 function changeFontSize(direction) { 2000 $affectedElements.each(function () { 2001 var $this = $(this); 2002 $this.css("font-size", parseInt($this.css("font-size")) + direction); 2003 }); 2004 } 2005 2006 $(document).ready(function () { 2007 $(".cstm-table, table").wrap("<div class='table-responsive'></div>"); 2008 2009 }); 2010 2011 /*Screen Read*/ 2012 2013 $(document).ready(function () { 2014 2015 if (!('speechSynthesis' in window)) { 2016 alert('Screen Reader not supported in your browser. Please use Chrome, Edge, or Safari.'); 2017 $('.screen-reader-toggle').prop('disabled', true); 2018 return; 2019 } 2020 2021 let screenReaderActive = false; 2022 let speechSynthesis = window.speechSynthesis; 2023 let currentUtterance = null; 2024 let speechSettings = { 2025 rate: 0.9, 2026 pitch: 1, 2027 volume: 1 2028 }; 2029 2030 $('.screen-reader-toggle').on('click', function (e) { 2031 e.preventDefault(); 2032 2033 screenReaderActive = !screenReaderActive; 2034 2035 if (screenReaderActive) { 2036 $(this).addClass('active').text('Screen Reader: ON'); 2037 $('#screenReaderControls').fadeIn(); 2038 enableScreenReader(); 2039 speakText('Screen reader activated. Click on any text element to read it aloud. Press Escape to stop reading.'); 2040 } else { 2041 $(this).removeClass('active').text('Screen Reader Off'); 2042 $('#screenReaderControls').fadeOut(); 2043 disableScreenReader(); 2044 stopSpeaking(); 2045 } 2046 }); 2047 2048 function enableScreenReader() { 2049 $('h1, h2, h3, h4, h5, h6, p, a, button, li, span.content, div.text, label, td, th, li a').each(function () { 2050 const text = $(this).text().trim(); 2051 if (text && text.length > 0 && !$(this).hasClass('screen-reader-active')) { 2052 $(this).addClass('screen-reader-active').attr('tabindex', '0'); 2053 } 2054 }); 2055 2056 $(document).on('click.screenReader', '.screen-reader-active', function (e) { 2057 if (screenReaderActive) { 2058 e.preventDefault(); 2059 const text = $(this).text().trim(); 2060 if (text) { 2061 $(this).addClass('speaking');
2062 speakText(text, () => { 2063 $(this).removeClass('speaking'); 2064 }); 2065 } 2066 } 2067 }); 2068 2069 // Read headings on hover 2070 $(document).on('mouseenter.screenReader', 'h1, h2, h3, h4, h5, h6, a', function () { 2071 if (screenReaderActive) { 2072 const text = $(this).text().trim(); 2073 if (text) speakText(text); 2074 } 2075 }); 2076 } 2077 2078 function disableScreenReader() { 2079 $('.screen-reader-active').removeClass('screen-reader-active speaking').removeAttr('tabindex'); 2080 $(document).off('.screenReader'); 2081 } 2082 2083 function speakText(text, callback) { 2084 stopSpeaking(); 2085 2086 currentUtterance = new SpeechSynthesisUtterance(text); 2087 currentUtterance.lang = '{{ app()->getLocale() }}' === 'hi' ? 'hi-IN' : 'en-US'; 2088 currentUtterance.rate = speechSettings.rate; 2089 currentUtterance.pitch = speechSettings.pitch; 2090 currentUtterance.volume = speechSettings.volume; 2091 2092 const voices = speechSynthesis.getVoices(); 2093 const voice = voices.find(v => v.lang.startsWith(currentUtterance.lang)); 2094 if (voice) currentUtterance.voice = voice; 2095 2096 currentUtterance.onend = function () { 2097 if (callback) callback(); 2098 }; 2099 2100 speechSynthesis.speak(currentUtterance); 2101 } 2102 2103 function stopSpeaking() { 2104 if (speechSynthesis.speaking) { 2105 speechSynthesis.cancel(); 2106 } 2107 $('.speaking').removeClass('speaking'); 2108 } 2109 2110 $(document).on('keydown', function (e) { 2111 if ($(e.target).is('input, textarea')) return; 2112 2113 if (e.key === 'r' || e.key === 'R') { 2114 $('.screen-reader-toggle').click(); 2115 } 2116 if (e.key === 'Escape' && screenReaderActive) { 2117 stopSpeaking(); 2118 } 2119 2120 }); 2121 2122 2123 speechSynthesis.onvoiceschanged = function () { 2124 console.log('Loaded', speechSynthesis.getVoices().length, 'voices'); 2125 }; 2126 2127 $(window).on('beforeunload', stopSpeaking); 2128 }); 2129 2130 2131 //$('.sidebar-sub-menu ul').hide(); 2132 //$(".sidebar-sub-menu a").click(function () { 2133 // $(this).parent(".sidebar-sub-menu").children("ul").slideToggle("100"); 2134 // $(this).find(".right").toggleClass("feather-chevron-up feather-chevron-downn"); 2135 //}); 2136 2137 $('.sidebar-sub-menu ul').hide(); 2138 2139 $(".sidebar-sub-menu > a").click(function (e) { 2140 e.preventDefault(); 2141 $(".sidebar-sub-menu ul").not($(this).next("ul")).slideUp(); 2142 $(this).next("ul").slideToggle(200); 2143 $(".sidebar-sub-menu .right") 2144 .removeClass("feather-chevron-up") 2145 .addClass("feather-chevron-down"); 2146 $(this).find(".right") 2147 .toggleClass("feather-chevron-up feather-chevron-down"); 2148 }); 2149 2150 2151 /* sticky menu*/ 2152 $(window).on('scroll', function () { 2153 if ($(this).scrollTop() > 450) { 2154 $('.header-sticky').addClass('rbt-sticky'); 2155 } else { 2156 $('.header-sticky').removeClass('rbt-sticky'); 2157 } 2158 }); 2159 2160 2161/*Counter*/ 2162 2163 var counted = 0; 2164 $(window).scroll(function() { 2165 2166 var oTop = $('#counter').offset().top - window.innerHeight; 2167 if (counted == 0 && $(window).scrollTop() > oTop) { 2168 $('.count').each(function () { 2169 var $this = $(this), 2170 countTo = $this.attr('data-count'); 2171 $({ 2172 countNum: $this.text() 2173 }).animate({ 2174 countNum: countTo 2175 }, 2176 2177 { 2178 2179 duration: 2000, 2180 easing: 'swing', 2181 step: function () { 2182 $this.text(Math.floor(this.countNum)); 2183 }, 2184 complete: function () { 2185 $this.text(this.countNum); 2186 //alert('finished'); 2187 } 2188 2189 }); 2190 }); 2191 counted = 1; 2192 } 2193 2194}); 2195 2196 2197 2198 2199 eduJs.i(); 2200})(window, document, jQuery); 2201 2202 2203 2204 2205 2206
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.