custom.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // responsive navbar for mobile menu
  2. const resBtn = document.getElementById("res-btn");
  3. const bodyTag = document.querySelector("body");
  4. resBtn.addEventListener('click', () => {
  5. bodyTag.classList.toggle("show-mobile-menu");
  6. })
  7. // responsive navbar for mobile menu end
  8. // course short description slider
  9. var swiper = new Swiper(".courses-short-desc", {
  10. spaceBetween: 30,
  11. loop: true,
  12. spaceBetween: 10,
  13. autoHeight: true,
  14. allowTouchMove: true,
  15. slidesPerView: 1,
  16. breakpoints: {
  17. 640: {
  18. slidesPerView: 2,
  19. spaceBetween: 10,
  20. },
  21. 768: {
  22. slidesPerView: 3,
  23. spaceBetween: 20,
  24. },
  25. 1024: {
  26. slidesPerView: 4,
  27. spaceBetween: 30,
  28. },
  29. },
  30. autoplay: {
  31. delay: 2500,
  32. disableOnInteraction: false,
  33. },
  34. });
  35. // why slider
  36. var swiper = new Swiper(".why-slider-1", {
  37. slidesPerView: "auto",
  38. centeredSlides: true,
  39. direction: "vertical",
  40. loop: true,
  41. speed: 5000,
  42. autoplay: {
  43. delay: 1,
  44. pauseOnMouseEnter: false,
  45. reverseDirection: true
  46. },
  47. spaceBetween: 20,
  48. });
  49. // new course slider
  50. var swiper = new Swiper(".new-course", {
  51. loop: true,
  52. spaceBetween: 10,
  53. autoHeight: true,
  54. allowTouchMove: true,
  55. slidesPerView: 1,
  56. breakpoints: {
  57. 640: {
  58. slidesPerView: 1,
  59. spaceBetween: 10,
  60. },
  61. 768: {
  62. slidesPerView: 3,
  63. spaceBetween: 20,
  64. },
  65. 1024: {
  66. slidesPerView: 4,
  67. spaceBetween: 30,
  68. },
  69. },
  70. autoplay: {
  71. delay: 2500,
  72. disableOnInteraction: false,
  73. pauseOnMouseEnter: true
  74. },
  75. navigation: {
  76. nextEl: ".new-course-next",
  77. prevEl: ".new-course-prev",
  78. },
  79. });
  80. // memory slider
  81. var swiper = new Swiper(".memory-slider", {
  82. slidesPerView: 1,
  83. spaceBetween: 80,
  84. loop: true,
  85. navigation: {
  86. nextEl: ".memory-slider-next",
  87. prevEl: ".memory-slider-prev",
  88. },
  89. });