1 2// Initiate LAZY 3$(function() { 4 if($.lazy){ 5 $('.lazy').lazy(); 6 }else{ 7 lazifyInt=setInterval(function(){if($.lazy){$('.lazy').lazy();clearInterval(lazifyInt)}},800); 8 } 9}); 10 11 12//Navbar Mobile Menu Toggler 13$('.NToggle').on('click', function() { 14 $(this).toggleClass("NToggled"); 15 $('.navMobile').toggleClass('NMopen'); 16 $('html').toggleClass('NMActive'); 17 $('.nmsfon').removeClass('nmsfon'); 18}); 19$('.NMSFLINK').on('click', function(e) { 20 e.preventDefault(); 21 $('.navMobile').addClass('nmsfon'); 22}); 23$('.nmsf-back').on('click',function() { 24 $('.navMobile').removeClass('nmsfon'); 25}); 26$('.nthighlight').on('click',function(e) { 27 e.preventDefault(); 28 if ($('.ndsf').hasClass('ndsfon')) { 29 $('.ndsf').removeClass('ndsfon'); 30 } else { 31 $('.ndsf').addClass('ndsfon'); 32 } 33}); 34$('.ndsfclose').on('click', function() { 35 $('.ndsf').removeClass('ndsfon'); 36}); 37 38 39//DesktopSearch function 40$('.beginsearch').on('click', function() { 41 if ($('.searchbar').hasClass('searchOpen')) { 42 $('.searchbar').removeClass('searchOpen'); 43 } else { 44 $('.searchbar').addClass('searchOpen'); 45 } 46}); 47 48 49// BRACKETS ANIMATION 50var bracketController = new ScrollMagic.Controller(); 51$('.initBracket').each(function() { 52 var bracketTween = new TimelineMax(); 53 bracketTween.fromTo($(this).find('.bracket1'), 0.25,{y:-25}, {y:25},"bracketSync") 54 .fromTo($(this).find('.bracket2'), 0.25, {y:25}, {y:-25},"bracketSync"); 55 56 var bracketScene = new ScrollMagic.Scene({ 57 triggerElement:this, 58 duration:"125%", 59 triggerHook:0.6, 60 }) 61 .setTween(bracketTween) 62 //.addIndicators() 63 .addTo(bracketController); 64}); 65 66 67// SPLIT YELLOW/WHITE SECTION ANIMATION 68var splitYWController = new ScrollMagic.Controller(); 69$('.splityw').each(function() { 70 var imgTween = new TimelineMax(); 71 imgTween.fromTo($(this).find('.syw-l').find('img'), 0.25, {y:-25}, {y:25},"splitSync") 72 .fromTo($(this).find('.syw-r').find('img'), 0.25, {y:25}, {y:-25},"splitSync"); 73 74 var splitYWScene = new ScrollMagic.Scene({ 75 triggerElement:this, 76 duration:"125%", 77 triggerHook:0.6, 78 }) 79 .setTween(imgTween) 80 // .addIndicators() 81 .addTo(splitYWController); 82}); 83 84 85 86// GRADIENT SECTION ANIMATION 87var gradientController = new ScrollMagic.Controller(); 88$('.bgCG').each(function() { 89 var gradientTween = new TimelineMax(); 90 gradientTween.to($(this).find('.bgCG-color'), 0.25, {backgroundColor:"#91acce"}); 91 92 var gradientScene = new ScrollMagic.Scene({ 93 triggerElement:this, 94 duration:"150%", 95 triggerHook:0.2, 96 }) 97 .setTween(gradientTween) 98 //.addIndicators() 99 .addTo(gradientController); 100}); 101 102//DOT BACKGROUND 103function makeDots(i) { 104 var index = i; 105 106 var $mainCont, cv, ctx, osCv, osCtx, osDotCv, osDotCtx, center, windowSize; 107 var angleDeg, angleRad, angleDeltaXDeg, angleDeltaYDeg; 108 var startX, startY; 109 110 var DOT_GAP = 30; 111 var DOT_RADIUS = 1; 112 var CIRCLE_RADIUS = 15; 113 var WAVES = 10; 114 var SPEED = 0.75; 115 var BG_COLOR = '#fff'; 116 var DOT_COLOR = '#707070'; 117 118 function init() { 119 //initDatGui(); 120 createOffScreenCanvas(); 121 122 $mainCont = $( '.HHead' )[i]; 123 cv = $( '.HHCanvas' )[i]; 124 //console.log(cv); 125 ctx = cv.getContext( '2d' ); 126 127 setBgColor(); 128 129 angleDeg = 0; 130 angleRad = 0; 131 132 window.onresize = resize; 133 134 resize(); 135 draw(); 136 } 137 function createOffScreenCanvas() { 138 osCv = document.createElement( 'canvas' ); 139 osCtx = osCv.getContext( '2d' ); 140 141 osDotCv = document.createElement( 'canvas' ); 142 osDotCtx = osDotCv.getContext( '2d' ); 143 144 drawDot(); 145 } 146 function drawDot() { 147 osDotCv.width = DOT_RADIUS * 2; 148 osDotCv.height = DOT_RADIUS * 2; 149 150 osDotCtx.clearRect( 0, 0, DOT_RADIUS * 2, DOT_RADIUS * 2 ); 151 osDotCtx.beginPath(); 152 osDotCtx.fillStyle = DOT_COLOR; 153 osDotCtx.arc( DOT_RADIUS, DOT_RADIUS, DOT_RADIUS, 0, Math.PI * 2 ); 154 osDotCtx.fill(); 155 } 156 function resize() { 157 windowSize = { 158 w: window.innerWidth, 159 h: window.innerHeight 160 }; 161 162 center = { 163 x: Math.round( windowSize.w / 2 ), 164 y: Math.round( windowSize.h / 2 ) 165 }; 166 167 cv.width = windowSize.w; 168 cv.height = windowSize.h; 169 osCv.width = windowSize.w; 170 osCv.height = windowSize.h; 171 172 setStartPosition(); 173 } 174 function setStartPosition() { 175 for ( var i = center.x; i > 0; i = i - DOT_GAP ) 176 startX = i - DOT_RADIUS - DOT_GAP; 177 178 for ( i = center.y; i > 0; i = i - DOT_GAP ) 179 startY = i - DOT_RADIUS - DOT_GAP; 180 } 181 function draw() { 182 requestAnimationFrame( draw ); 183 render(); 184 } 185 function render() { 186 ctx.clearRect( 0, 0, cv.width, cv.height ); 187 osCtx.clearRect( 0, 0, osCv.width, osCv.height ); 188 189 angleDeg = angleDeg + SPEED < 360 ? angleDeg + SPEED : angleDeg + SPEED - 360; 190 angleDeltaXDeg = 0; 191 angleDeltaYDeg = 0; 192 193 for ( var j = startY; j < windowSize.h + DOT_GAP; j += DOT_GAP ) { 194 angleDeltaYDeg += WAVES; 195 angleDeltaXDeg = angleDeltaYDeg; 196 197 for ( var i = startX; i < windowSize.w + DOT_GAP; i += DOT_GAP ) { 198 angleDeltaXDeg += WAVES; 199 angleRad = ( angleDeg + angleDeltaXDeg ) * Math.PI / 180; 200 201 var x = Math.cos( angleRad ) * CIRCLE_RADIUS + i; 202 var y = Math.sin( angleRad ) * CIRCLE_RADIUS + j; 203 204 osCtx.drawImage( osDotCv, 0, 0, DOT_RADIUS * 2, DOT_RADIUS * 2, x, y, DOT_RADIUS * 2, DOT_RADIUS * 2 ); 205 } 206 } 207 208 ctx.drawImage( osCv, 0, 0, windowSize.w, windowSize.h, 0, 0, windowSize.w, windowSize.h ); 209 } 210 function setBgColor() { 211 //$mainCont.style.backgroundColor = BG_COLOR; 212 } 213 init(index); 214} 215$(document).ready(function() { 216 var i = 0; 217 $('.HHBG').each(function() { 218 makeDots(i); 219 i++; 220 }).promise().done(function() { 221 $('.HHCanvas').each(function() { 222 var thisH = $(this).height(); 223 $(this).attr('height', thisH); 224 }); 225 }); 226}); 227 228 229// Testimonial Carousel
230 231$(document).ready(function(){ 232 $(".testimonialSlider").owlCarousel({ 233 items:1, 234 loop:true, 235 autoplay:true, 236 autoplaySpeed:1000, 237 autoplayTimeout:10000 238 }); 239//move PGC children elements that don't have PGCi class to new div to prevent owl gallery from messing with them 240 $('.PGC-container').first().append($('.PGC .modal')); 241 n=$('.PGC').children().length; //added 20220713 - don't repeat items if fewer than 4 (desktop) or whatever number would otherwise appear on other screen sizes 242 $('.PGC').owlCarousel({ 243 responsive:{ 244 0:{ 245 items:Math.min(n,2) 246 }, 247 768:{ 248 items:Math.min(n,3) 249 }, 250 992:{ 251 items:Math.min(n,4) 252 } 253 }, 254 margin:15, 255 loop:true, 256 nav:true, 257 navText:['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'], 258 dots:false, 259 }); 260}); 261 262 263 264$(document).on('click', '[data-toggle="lightbox"]', function(event) { 265 event.preventDefault(); 266 $(this).ekkoLightbox(); 267}); 268 269 270// Newsletter Checkboxes 271$(document).ready(function () { 272 $('.fsubsubmit').click(function() { 273 checked = $("footer input[type=checkbox]:checked").length; 274 275 if(!checked) { 276 alert("You must check at least one checkbox."); 277 return false; 278 } 279 280 }); 281 282 var hash = window.location.hash; 283 if (hash == "#nsub") { 284 $('#footernewsmodal').modal('show'); 285 } 286 287 //open linked drop-downs and the like: 288 anchorelem=$(hash); 289 if(anchorelem.length==1){ //exists, and is unique 290 anchorelem[0].classList.remove("collapse"); 291 //anchorelem[0].scrollIntoView(); 292 window.scrollTo({ 293 behavior:'smooth', 294 top:anchorelem[0].getBoundingClientRect().top - document.body.getBoundingClientRect().top - 200 295 }) 296 } 297}); 298 299 300 301 var optionLinks = document.querySelectorAll('.option-item'); 302 if(optionLinks.length>0){ 303 var optionLinksTab = optionLinks[0].getAttribute('data-tab'); 304 var optionSection = document.querySelectorAll('.option-tab-content'); 305 var optionSectionTab = optionSection[0].getAttribute('data-tab'); 306 var optionLinksText = document.querySelectorAll('.option-item.active'); 307 optionSectionTab = optionSectionTab.replace(/\D/g, ''); 308 var programOverviewPosition = document.querySelector('.program-overview-section').offsetTop; 309 var hash = window.location.hash; 310 311 //check url on load 312 313 //Click on first tab by default if no hash is present 314 window.onload = function() { 315 var hash = window.location.hash; 316 if (hash == "") { 317 defaultOption(); 318 optionLinks[0].classList.add('active'); 319 window.location.hash = optionLinks[0].innerHTML; 320 console.log('changed to first tab due to empty hash'); 321 } else { 322 hash = hash.replace('#', ''); 323 // loop through optionLinks and check if hash is the same as optionLinksText 324 optionLinks.forEach(function(link) { 325 if (link.innerHTML == hash) { 326 link.click(); 327 } 328 else { 329 link.classList.remove('active'); 330 } 331 }); 332 } 333 }; 334 335 //check url change on 336 window.onhashchange = function() { 337 var hash = window.location.hash; 338 339 if (hash == "") { 340 defaultOption(); 341 optionLinks[0].classList.add('active'); 342 window.location.hash = optionLinks[0].innerHTML; 343 console.log('changed to first tab due to empty hash'); 344 scrollToProgramOverview(); 345 } else { 346 hash = hash.replace('#', ''); 347 console.log('hash is ' + hash); 348 // loop through optionLinks and check if hash is the same as optionLinksText 349 optionLinks.forEach(function(link) { 350 if (link.innerHTML == hash) { 351 link.click(); 352 } else { 353 link.classList.remove('active'); 354 } 355 }); 356 scrollToProgramOverview(); 357 } 358 } 359 360 361 // Scroll to program overview section 362 function scrollOnClick() { 363 optionLinks.forEach(function(link) { 364 link.addEventListener('click', function() { 365 optionLinks.forEach(function(link) { 366 link.classList.remove('active'); 367 }); 368 this.classList.add('active'); 369 }); 370 }); 371 } 372 scrollOnClick(); 373 374 375 //get optionLinksText innerHTML 376 optionLinks.forEach(function(link) { 377 link.addEventListener('click', function() { 378 optionLinksText = this.innerHTML; 379 }); 380 }); 381 382 //get optionLinksTab data-tab 383 function clickDataTabOption() {} 384 optionLinks.forEach(function(link) { 385 link.addEventListener('click', function() { 386 optionLinksTab = this.getAttribute('data-tab'); 387 window.location.hash = optionLinksText; 388 }); 389 }); 390 clickDataTabOption(); 391 392 393 394 //Scroll to program overview section 395 function scrollToProgramOverview() { 396 optionLinks.forEach(function(link) { 397 link.addEventListener('click', function() { 398 window.scrollTo({ 399 top: programOverviewPosition, 400 behavior: 'smooth' 401 }); 402 }); 403 }); 404 } 405 406 //Show the first tab content by default 407 function defaultOption() { 408 optionSection.forEach(function(section) { 409 optionSectionTab = section.getAttribute('data-tab'); 410 optionSectionTab = optionSectionTab.replace(/\D/g, '');
411 if (optionLinksTab == optionSectionTab) { 412 section.classList.remove('d-none'); 413 } else { 414 section.classList.add('d-none'); 415 } 416 }); 417 } 418 419 420 //Show the tab content on click 421 function clickOption() { 422 optionLinks.forEach(function(link) { 423 link.addEventListener('click', function() { 424 optionLinksTab = this.getAttribute('data-tab'); 425 optionSection.forEach(function(section) { 426 optionSectionTab = section.getAttribute('data-tab'); 427 optionSectionTab = optionSectionTab.replace(/\D/g, ''); 428 if (optionLinksTab == optionSectionTab) { 429 section.classList.remove('d-none'); 430 } else { 431 section.classList.add('d-none'); 432 } 433 }); 434 }); 435 }); 436 } 437 clickOption(); 438 } 439 440 441 442function formSwap() { 443 var fnameInput = document.querySelector('.fnameinput'); 444 var lnameInput = document.querySelector('.lnameinput'); 445 var femailInput = document.querySelector('.femailinput'); 446 447 var ctFormFnameInput = document.querySelector('#ctform input[placeholder="First Name"]'); 448 var ctFormLnameInput = document.querySelector('#ctform input[placeholder="Last Name"]'); 449 var ctFormEmailInput = document.querySelector('#ctform input[placeholder="[email protected]"]'); 450 451 ctFormFnameInput.value = fnameInput.value; 452 ctFormLnameInput.value = lnameInput.value; 453 ctFormEmailInput.value = femailInput.value; 454} 455 456//var nextBtn = document.querySelector('.square-btn'); //on degree pages 457//if(nextBtn){ 458 $(document).ready({}) 459 .on('click', '.square-btn', formSwap); 460//}
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.