|
| 1 | +$(document).ready(function () { |
| 2 | + |
| 3 | + $('#menu-bar').click(function () { |
| 4 | + $(this).toggleClass('fa-times'); |
| 5 | + $('.navbar').toggleClass('nav-toggle'); |
| 6 | + }); |
| 7 | + |
| 8 | + $(window).on('load scroll', function () { |
| 9 | + |
| 10 | + $('#menu-bar').removeClass('fa-times'); |
| 11 | + $('.navbar').removeClass('nav-toggle'); |
| 12 | + |
| 13 | + $('section').each(function () { |
| 14 | + |
| 15 | + let top = $(window).scrollTop(); |
| 16 | + let height = $(this).height(); |
| 17 | + let id = $(this).attr('id'); |
| 18 | + let offset = $(this).offset().top - 200; |
| 19 | + |
| 20 | + if (top > offset && top < offset + height) { |
| 21 | + $('.navbar ul li a').removeClass('active'); |
| 22 | + $('.navbar').find(`[href="#${id}"]`).addClass('active'); |
| 23 | + } |
| 24 | + |
| 25 | + }); |
| 26 | + |
| 27 | + }); |
| 28 | + |
| 29 | + $('.list .btn').click(function () { |
| 30 | + $(this).addClass('active').siblings().removeClass('active'); |
| 31 | + let src = $(this).attr('data-src'); |
| 32 | + $('.projects .row .image img').attr('src', src); |
| 33 | + }); |
| 34 | + |
| 35 | +}); |
| 36 | +var isLight = true; |
| 37 | +function darkMode() { |
| 38 | + |
| 39 | + if (isLight) { |
| 40 | + document |
| 41 | + .getElementById("DarkModeTogglerId") |
| 42 | + .setAttribute("class", "dark-mode"); |
| 43 | + isLight = false; |
| 44 | + } else { |
| 45 | + document |
| 46 | + .getElementById("DarkModeTogglerId") |
| 47 | + .setAttribute("class", ""); |
| 48 | + isLight = true; |
| 49 | + } |
| 50 | +} |
| 51 | + |
| 52 | + |
| 53 | +$(document).on('click', '.member-1', function () { |
| 54 | + $('.detail-box-1').toggleClass('show-details-1') |
| 55 | + $('.detail-box-2').removeClass('show-details-2') |
| 56 | + $('.detail-box-3').removeClass('show-details-3') |
| 57 | + $('.detail-box-4').removeClass('show-details-4') |
| 58 | + $('.detail-box-5').removeClass('show-details-5') |
| 59 | + $('.detail-box-6').removeClass('show-details-6') |
| 60 | +}); |
| 61 | +/*-2-----------------------------------*/ |
| 62 | +$(document).on('click', '.member-2', function () { |
| 63 | + $('.detail-box-2').toggleClass('show-details-2') |
| 64 | + $('.detail-box-1').removeClass('show-details-1') |
| 65 | + $('.detail-box-3').removeClass('show-details-3') |
| 66 | + $('.detail-box-4').removeClass('show-details-4') |
| 67 | + $('.detail-box-5').removeClass('show-details-5') |
| 68 | + $('.detail-box-6').removeClass('show-details-6') |
| 69 | +}); |
| 70 | +/*-3-----------------------------------*/ |
| 71 | +$(document).on('click', '.member-3', function () { |
| 72 | + $('.detail-box-3').toggleClass('show-details-3') |
| 73 | + $('.detail-box-2').removeClass('show-details-2') |
| 74 | + $('.detail-box-1').removeClass('show-details-1') |
| 75 | + $('.detail-box-4').removeClass('show-details-4') |
| 76 | + $('.detail-box-5').removeClass('show-details-5') |
| 77 | + $('.detail-box-6').removeClass('show-details-6') |
| 78 | +}); |
| 79 | +/*-4-----------------------------------*/ |
| 80 | +$(document).on('click', '.member-4', function () { |
| 81 | + $('.detail-box-4').toggleClass('show-details-4') |
| 82 | + $('.detail-box-2').removeClass('show-details-2') |
| 83 | + $('.detail-box-3').removeClass('show-details-3') |
| 84 | + $('.detail-box-1').removeClass('show-details-1') |
| 85 | + $('.detail-box-5').removeClass('show-details-5') |
| 86 | + $('.detail-box-6').removeClass('show-details-6') |
| 87 | +}); |
| 88 | +/*-5-----------------------------------*/ |
| 89 | +$(document).on('click', '.member-5', function () { |
| 90 | + $('.detail-box-5').toggleClass('show-details-5') |
| 91 | + $('.detail-box-2').removeClass('show-details-2') |
| 92 | + $('.detail-box-3').removeClass('show-details-3') |
| 93 | + $('.detail-box-4').removeClass('show-details-4') |
| 94 | + $('.detail-box-1').removeClass('show-details-1') |
| 95 | + $('.detail-box-6').removeClass('show-details-6') |
| 96 | +}); |
| 97 | +/*-6-----------------------------------*/ |
| 98 | +$(document).on('click', '.member-6', function () { |
| 99 | + $('.detail-box-6').toggleClass('show-details-6') |
| 100 | + $('.detail-box-2').removeClass('show-details-2') |
| 101 | + $('.detail-box-3').removeClass('show-details-3') |
| 102 | + $('.detail-box-4').removeClass('show-details-4') |
| 103 | + $('.detail-box-5').removeClass('show-details-5') |
| 104 | + $('.detail-box-1').removeClass('show-details-1') |
| 105 | +}); |
| 106 | + |
| 107 | +/*-cancel------------------*/ |
| 108 | +$(document).on('click', '.cancel', function () { |
| 109 | + $('.detail-box-1').removeClass('show-details-1') |
| 110 | + $('.detail-box-2').removeClass('show-details-2') |
| 111 | + $('.detail-box-3').removeClass('show-details-3') |
| 112 | + $('.detail-box-4').removeClass('show-details-4') |
| 113 | + $('.detail-box-5').removeClass('show-details-5') |
| 114 | + $('.detail-box-6').removeClass('show-details-6') |
| 115 | +}); |
| 116 | + |
| 117 | + |
| 118 | +var slideIndex = 1; |
| 119 | +showSlides(slideIndex); |
| 120 | + |
| 121 | +function plusSlides(n) { |
| 122 | + showSlides(slideIndex += n); |
| 123 | +} |
| 124 | + |
| 125 | +function currentSlide(n) { |
| 126 | + showSlides(slideIndex = n); |
| 127 | +} |
| 128 | + |
| 129 | +function showSlides(n) { |
| 130 | + var i; |
| 131 | + var slides = document.getElementsByClassName("mySlides"); |
| 132 | + var dots = document.getElementsByClassName("dot"); |
| 133 | + if (n > slides.length) { slideIndex = 1 } |
| 134 | + if (n < 1) { slideIndex = slides.length } |
| 135 | + for (i = 0; i < slides.length; i++) { |
| 136 | + slides[i].style.display = "none"; |
| 137 | + } |
| 138 | + for (i = 0; i < dots.length; i++) { |
| 139 | + dots[i].className = dots[i].className.replace(" active", ""); |
| 140 | + } |
| 141 | + slides[slideIndex - 1].style.display = "block"; |
| 142 | + dots[slideIndex - 1].className += " active"; |
| 143 | +} |
| 144 | + |
| 145 | + |
| 146 | +$(document).ready(function () { |
| 147 | + //Preloader |
| 148 | + preloaderFadeOutTime = 600; |
| 149 | + function hidePreloader() { |
| 150 | + var preloader = $('.spinner-wrapper'); |
| 151 | + preloader.fadeOut(preloaderFadeOutTime); |
| 152 | + } |
| 153 | + hidePreloader(); |
| 154 | +}); |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | +$(document).ready(function () { |
| 160 | + $('.1').click(function () { |
| 161 | + $('#page1').removeClass("hide"); |
| 162 | + $('#page2').addClass("hide"); |
| 163 | + $('#page3').addClass("hide"); |
| 164 | + $('#page4').addClass("hide"); |
| 165 | + }); |
| 166 | +}); |
| 167 | + $(document).ready(function () { |
| 168 | + $('.2').click(function () { |
| 169 | + $('#page2').removeClass("hide"); |
| 170 | + $('#page1').addClass("hide"); |
| 171 | + $('#page3').addClass("hide"); |
| 172 | + $('#page4').addClass("hide"); |
| 173 | + |
| 174 | + }); |
| 175 | + }); |
| 176 | + |
| 177 | + $(document).ready(function () { |
| 178 | + $('.3').click(function () { |
| 179 | + $('#page3').removeClass("hide"); |
| 180 | + $('#page1').addClass("hide"); |
| 181 | + $('#page2').addClass("hide"); |
| 182 | + $('#page4').addClass("hide"); |
| 183 | + }); |
| 184 | + }); |
| 185 | + $(document).ready(function () { |
| 186 | + $('.4').click(function () { |
| 187 | + $('#page4').removeClass("hide"); |
| 188 | + $('#page1').addClass("hide"); |
| 189 | + $('#page2').addClass("hide"); |
| 190 | + $('#page3').addClass("hide"); |
| 191 | + }); |
| 192 | + }); |
0 commit comments