1(function ($) { 2 $(document).ready(function () { 3 function updateMenuAndText() { 4 const currentHash = window.location.hash; 5 const $menuItems = $('.admission-training-menu-item'); 6 const $textParagraph = $('p.text'); 7 8 let activeItemFound = false; 9 $menuItems.each(function () { 10 const $this = $(this); 11 if ($this.attr('href').includes(currentHash) && currentHash !== '') { 12 $menuItems.removeClass('active'); 13 $this.addClass('active'); 14 $textParagraph.text($this.find('p').text().trim()); 15 activeItemFound = true; 16 } 17 }); 18 } 19 20 function showModal() { 21 const videoModal = $('#videoModal'); 22 const videoElement = videoModal.find('video')[0]; 23 const sourceElement = videoModal.find('source'); 24 const videoSrc = sourceElement.attr('src'); 25 sourceElement.attr('src', ''); 26 videoModal.on('show.bs.modal', function (e) { 27 sourceElement.attr('src', videoSrc); 28 videoElement.load(); 29 videoElement.play(); 30 }); 31 32 videoModal.on('hide.bs.modal', function (e) { 33 videoElement.pause(); 34 videoElement.currentTime = 0; 35 sourceElement.attr('src', ''); 36 videoElement.load(); 37 }); 38 }; 39 40 $('.banner-slider').owlCarousel({ 41 loop: true, 42 margin: 0, 43 nav: false, 44 dots: true, 45 autoplay: true, 46 autoplayTimeout: 5000, 47 responsive: { 48 0: { 49 items: 1 50 }, 51 600: { 52 items: 1 53 }, 54 1000: { 55 items: 1 56 } 57 } 58 }); 59 $('.about-us-6-slider').owlCarousel({ 60 loop: true, 61 margin: 0, 62 nav: false, 63 dots: false, 64 autoplay: true, 65 autoplayTimeout: 5000, 66 autoplayHoverPause: false, 67 responsive: { 68 0: { 69 items: 1 70 }, 71 600: { 72 items: 1 73 }, 74 1000: { 75 items: 1 76 } 77 } 78 }); 79 $('.life-slider').owlCarousel({ 80 loop: true, 81 margin: 0, 82 nav: false, 83 dots: true, 84 autoplay: true, 85 autoplayTimeout: 5000, 86 autoplayHoverPause: false, 87 responsive: { 88 0: { 89 items: 1 90 }, 91 600: { 92 items: 1 93 }, 94 1000: { 95 items: 1 96 } 97 } 98 }); 99 100 $('.partner-slider').owlCarousel({ 101 loop: true, 102 margin: 64, 103 nav: false, 104 autoplay: true, 105 autoplayTimeout: 5000, 106 autoplayHoverPause: false, 107 dots: false, 108 responsive: { 109 0: { 110 items: 2, 111 margin: 20 112 }, 113 600: { 114 items: 3, 115 margin: 20 116 }, 117 1000: { 118 items: 4 119 }, 120 1320: { 121 items: 6 122 } 123 } 124 }); 125 $('.admission-notification-slider').owlCarousel({ 126 loop: true, 127 margin: 30, 128 nav: true, 129 navText: [`<img src="/en/sites/all/themes/cassiopeia_theme/img/Icons/btn-prev.svg" width="40" height="40" alt="" class="home-box-4-bottom-action-icon">`, `<img src="/en/sites/all/themes/cassiopeia_theme/img/Icons/btn-next.svg" width="40" height="40" alt="" class="home-box-4-bottom-action-icon">`], 130 dots: false, 131 autoplay: false, 132 autoplayTimeout: 5000, 133 autoplayHoverPause: false, 134 responsive: { 135 0: { 136 items: 1, 137 margin: 10, 138 autoplay: true, 139 }, 140 600: { 141 items: 2, 142 margin: 20, 143 autoplay: true, 144 }, 145 1000: { 146 items: 3, 147 autoplay: false, 148 } 149 } 150 }); 151 152 $('.home-box-2-slider').owlCarousel({ 153 loop: true, 154 margin: 80, 155 dots: false, 156 autoplay: false, 157 autoplayTimeout: 5000, 158 autoplayHoverPause: false, 159 mouseDrag: false, 160 responsive: { 161 0: { 162 items: 2, 163 margin: 30, 164 mouseDrag: true, 165 }, 166 600: { 167 items: 3, 168 margin: 40, 169 mouseDrag: true, 170 }, 171 1000: { 172 items: 4 173 } 174 } 175 }); 176 177 $('.about-us-4-second-slider').owlCarousel({ 178 loop: true, 179 margin: 16, 180 nav: false, 181 dots: false, 182 autoplay: false, 183 autoplayTimeout: 5000, 184 autoplayHoverPause: false, 185 responsive: { 186 0: { 187 items: 2, 188 margin: 10, 189 autoplay: true, 190 mouseDrag: true, 191 }, 192 600: { 193 items: 3, 194 margin: 20, 195 autoplay: true, 196 mouseDrag: true, 197 }, 198 1200: { 199 items: 4, 200 autoplay: false, 201 mouseDrag: false, 202 } 203 } 204 }); 205 206 $('.about-us-3-img-slider').owlCarousel({ 207 loop: true, 208 margin: 0, 209 nav: false, 210 dots: false, 211 mouseDrag: false, 212 items: 1, 213 }); 214 $('.about-us-3-text-slider').owlCarousel({ 215 loop: true, 216 margin: 30, 217 nav: false, 218 dots: false, 219 mouseDrag: false, 220 items: 1, 221 }); 222 223 $('.related-news-slider').owlCarousel({ 224 loop: true, 225 margin: 30, 226 nav: false, 227 dots: false, 228 autoplay: true, 229 autoplayTimeout: 5000, 230 autoplayHoverPause: false, 231 responsive: { 232 0: { 233 items: 2, 234 margin: 10 235 }, 236 600: { 237 items: 2, 238 margin: 20 239 }, 240 1000: { 241 items: 3 242 } 243 } 244 }); 245 246 $('.professors-slider').owlCarousel({ 247 loop: true, 248 margin: 30, 249 nav: true, 250 navText: [`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> 251 <path d="M22 12H2M2 12L7.49951 6M2 12L7.49951 18" stroke="white" stroke-width="2"/> 252</svg>`, `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> 253 <path d="M2 12H22M22 12L16.5005 6M22 12L16.5005 18" stroke="white" stroke-width="2"/> 254</svg>`], 255 dots: false, 256 autoplay: true, 257 autoplayTimeout: 5000, 258 autoplayHoverPause: false, 259 responsive: { 260 0: { 261 items: 2, 262 margin: 10 263 }, 264 600: { 265 items: 3, 266 margin: 20 267 }, 268 1200: { 269 items: 4 270 } 271 } 272 }); 273 274 $('.life-at-tdu-slider').owlCarousel({ 275 loop: true, 276 margin: 0, 277 nav: true, 278 navText: [`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> 279 <path d="M22 12H2M2 12L7.49951 6M2 12L7.49951 18" stroke="white" stroke-width="2"/> 280</svg>`, `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> 281 <path d="M2 12H22M22 12L16.5005 6M22 12L16.5005 18" stroke="white" stroke-width="2"/> 282</svg>`], 283 dots: true, 284 autoplay: true, 285 autoplayTimeout: 5000, 286 autoplayHoverPause: false, 287 items: 1, 288 }); 289 290 const owl = $('.events-slider'); 291 292 owl.owlCarousel({ 293 loop: true, 294 margin: 30, 295 nav: true, 296 navText: [`<img src="/en/sites/all/themes/cassiopeia_theme/img/Icons/btn-prev.svg" width="40" height="40" alt="" class="home-box-4-bottom-action-icon">`, `<img src="/en/sites/all/themes/cassiopeia_theme/img/Icons/btn-next.svg" width="40" height="40" alt="" class="home-box-4-bottom-action-icon">`], 297 dots: false, 298 autoplay: true, 299 autoplayTimeout: 5000, 300 autoplayHoverPause: false, 301 responsive: { 302 0: { 303 items: 2, 304 margin: 10, 305 autoplay: true, 306 }, 307 600: { 308 items: 2, 309 margin: 20, 310 autoplay: true, 311 }, 312 1000: { 313 items: 3, 314 autoplay: false, 315 } 316 } 317 }); 318 319 $('.header-language-header').on('click', function () { 320 $('.header-language-list').toggleClass('active'); 321 }) 322 323 $('.header-language-item').on('click', function () { 324 const selectedLanguage = $(this).text(); 325 $('.header-language-header img').attr('src', $(this).find('img').attr('src')); 326 $('.header-language-header .header-language-text').text(selectedLanguage); 327 $('.header-language-list').removeClass('active'); 328 }); 329 330 $('.about-us-5-item-header').on('click', function () { 331 const $this = $(this); 332 $('.about-us-5-item').removeClass('active'); 333 $this.parent().addClass('active'); 334 }); 335 336 $('.about-us-3-prev').on('click', function () { 337 $('.about-us-3-img-slider').trigger('prev.owl.carousel'); 338 $('.about-us-3-text-slider').trigger('prev.owl.carousel'); 339 }); 340 $('.about-us-3-next').on('click', function () { 341 $('.about-us-3-img-slider').trigger('next.owl.carousel'); 342 $('.about-us-3-text-slider').trigger('next.owl.carousel'); 343 }); 344 345 $('.filter-list-item-header').on('click', function () { 346 $(this).parent().toggleClass('active'); 347 }); 348 349 updateMenuAndText(); 350 351 $(window).on('hashchange', updateMenuAndText); 352 353 $('.admission-training-menu-item').on('click', function () { 354 setTimeout(updateMenuAndText, 0); 355 }); 356 357 $('.life-at-tdu-menu').on('click', function () { 358 const box = $(this).attr('data-box'); 359 $('.life-at-tdu-menu').removeClass('active'); 360 $(this).addClass('active'); 361 $('html, body').animate({ 362 scrollTop: $('#' + box).offset().top 363 }, 800); 364 }); 365 366 $('.faqs-menu-item').on('click', function () { 367 const box = $(this).attr('id'); 368 $('.faqs-menu-item').removeClass('active'); 369 $(this).addClass('active'); 370 $('html, body').animate({
371 scrollTop: $(`.faqs-list-item#${box}`).offset().top - 50 372 }, 800); 373 }); 374 375 $('.scholarship-menu-item').on('click', function () { 376 const dataLevel = $(this).attr('data-level'); 377 $('.scholarship-menu-item').removeClass('active'); 378 $(this).addClass('active'); 379 $('html, body').animate({ 380 scrollTop: $(`.scholarship-content-item[data-level="${dataLevel}"]`).offset().top - 32 381 }, 800); 382 }); 383 384 $('.faqs-item-header').on('click', function () { 385 const $this = $(this); 386 $this.parent().toggleClass('active'); 387 }); 388 389 $('.home-box-2-item-content-count').each(function () { 390 var $self = $(this); 391 var endValue = parseInt($self.attr('value'), 10); 392 var startValue = 0; 393 var duration = 2000; 394 395 $({ countNum: startValue }).animate({ 396 countNum: endValue 397 }, { 398 duration: duration, 399 easing: 'swing', 400 step: function () { 401 let currentText = Math.floor(this.countNum); 402 if ($self.attr('data-type') !== 'plus') { 403 $self.text(currentText); 404 } else { 405 $self.text(currentText + '+'); 406 } 407 }, 408 complete: function () { 409 let finalText = endValue; 410 if ($self.attr('data-type') !== 'plus') { 411 $self.text(finalText); 412 } else { 413 $self.text(finalText + '+'); 414 } 415 } 416 }); 417 }); 418 419 $('.header-language').on('click', function () { 420 $(this).toggleClass('vn'); 421 }); 422 423 showModal(); 424 425 const $menuItems = $('.home-box-3-menu-item'); 426 const totalItems = $menuItems.length; 427 let autoSwitchInterval; 428 429 function switchToNextItem() { 430 const $currentItem = $menuItems.filter('.active'); 431 const currentIndex = $menuItems.index($currentItem);
432 const nextIndex = (currentIndex + 1) % totalItems; 433 434 $currentItem.removeClass('active'); 435 $menuItems.eq(nextIndex).addClass('active'); 436 let id = $menuItems.eq(nextIndex).attr('id'); 437 if ($('.home-box-3-item.active').attr('id') === id && $('.home-box-3-img-item.active').attr('id') === id) { 438 return; 439 } 440 $('.home-box-3-item').removeClass('active'); 441 $(`.home-box-3-item#${id}`).addClass('active'); 442 $('.home-box-3-img-item').removeClass('active'); 443 $(`.home-box-3-img-item#${id}`).addClass('active'); 444 } 445 446 function startAutoSwitch() { 447 clearInterval(autoSwitchInterval); 448 autoSwitchInterval = setInterval(switchToNextItem, 5000); // 5000ms = 5 giây 449 } 450 451 startAutoSwitch(); 452 453 $menuItems.on('click', function () { 454 $menuItems.removeClass('active'); 455 $(this).addClass('active'); 456 let id = $(this).attr('id'); 457 console.log(id); 458 if ($('.home-box-3-item.active').attr('id') === id && $('.home-box-3-img-item.active').attr('id') === id) { 459 return; 460 } 461 $('.home-box-3-item').removeClass('active'); 462 $(`.home-box-3-item#${id}`).addClass('active'); 463 $('.home-box-3-img-item').removeClass('active'); 464 $(`.home-box-3-img-item#${id}`).addClass('active'); 465 startAutoSwitch(); 466 }); 467 468 $('.header-search').on('click', function () { 469 $('.header-search-popup').toggleClass('active'); 470 }); 471 472 $(document).on('click', function (e) { 473 console.log(e.target); 474 if (!$(e.target).closest('.header-search').length) { 475 $('.header-search-popup').removeClass('active'); 476 } 477 }); 478 479 $('.header-mobile-menu').on('click', function () { 480 $('.overlay-header').addClass('active'); 481 $('.header-navigator').addClass('active'); 482 }); 483 484 $('.overlay-header').on('click', function () { 485 $(this).removeClass('active'); 486 $('.header-navigator').removeClass('active'); 487 }); 488 489 $('.btn-close-mobile').on('click', function () { 490 $('.overlay-header').removeClass('active'); 491 $('.header-navigator').removeClass('active'); 492 }); 493 494 $('.btn-filter-mobile').on('click', function () { 495 $('.overlay-filter').addClass('active'); 496 $('.news-event-filter').addClass('active'); 497 }); 498 499 $('.overlay-filter').on('click', function () { 500 $(this).removeClass('active'); 501 $('.news-event-filter').removeClass('active'); 502 }); 503 }); 504 505})(jQuery);
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.