1$( document ).ready(function() { 2 3 //counter js 4 $('.counter').counterUp({ 5 delay: 10, 6 time: 2000 7 }); 8 9 //testimonial slider js 10 $('.feature-slider-wrapper').slick({ 11 slidesToShow: 2, 12 slidesToScroll: 1, 13 dots: false, 14 arrows: true, 15 prevArrow:"<button type='button' class='slick-prev pull-left'></button>", 16 nextArrow:"<button type='button' class='slick-next pull-right'></button>", 17 responsive: [ 18 { 19 breakpoint: 992, 20 settings: { 21 slidesToShow: 1, 22 } 23 }, 24 { 25 breakpoint: 768, 26 settings: { 27 slidesToShow: 1, 28 } 29 }, 30 ] 31 }); 32 33 //client slider js 34 $('.client-testimonial-slider').slick({ 35 slidesToShow: 2, 36 slidesToScroll: 1, 37 dots: true, 38 arrows: false, 39 responsive: [ 40 { 41 breakpoint: 1025, 42 settings: { 43 slidesToShow: 1, 44 } 45 } 46 ] 47 }); 48 49 50 //search toggle js 51 $('.search-toggle').addClass('closed'); 52 $('.search-toggle .search-icon').click(function(e) { 53 if ($('.search-toggle').hasClass('closed')) { 54 $('.search-toggle').removeClass('closed').addClass('opened'); 55 $('.search-toggle, .search-container').addClass('opened'); 56 $('#search-terms').focus(); 57 } else { 58 $('.search-toggle').removeClass('opened').addClass('closed'); 59 $('.search-toggle, .search-container').removeClass('opened'); 60 } 61 }); 62}); 63 64//header scroll js 65// $(window).on('scroll', function () { 66// stickyHeader() 67// }); 68// function stickyHeader() { 69// var sticky = $('header'); 70// var scrollFromtop = $(window).scrollTop(); 71// var scrollLimit = $('header').height() + 10; 72 73// if (scrollFromtop < scrollLimit) { 74// sticky.removeClass('sticky-on'); 75// } else { 76// sticky.addClass('sticky-on'); 77// } 78// } 79 80//Animation of all elements js 81 82var controller = new ScrollMagic.Controller(); 83 84var featuremarket = new TimelineMax(); 85featuremarket.from('.feature-business-content .section-title', 0.4, {x: -50, opacity: 0}). 86from('.feature-business-lisiting ul li:nth-child(1)', 0.5, {x: -50, opacity: 0}). 87from('.feature-business-lisiting ul li:nth-child(2)', 0.5, {x: -50, opacity: 0}). 88from('.feature-business-lisiting ul li:nth-child(3)', 0.5, {x: -50, opacity: 0}). 89from('.banner-image', 0.5, {x: 50, opacity: 0}). 90from('.feature-tag-line', 0.5, {x: -50, opacity: 0}). 91from('.feature-business-lisiting .btn-blue-bg', 0.9, {x: -50, opacity: 0}); 92 93var featuremarkettrigger = new ScrollMagic.Scene({ 94 triggerElement: '.feature-business', 95 offset: -80, 96 reverse: false, 97}) 98.setTween(featuremarket) 99.addTo(controller); 100 101var whyreview = new TimelineMax(); 102whyreview.from('.why-us-section .section-title', 0.4, {y: 50, opacity: 0}). 103from('.why-us-section .section-sub-text', 0.4, {y: 50, opacity: 0}); 104 105var whyreviewtrigger = new ScrollMagic.Scene({ 106 triggerElement: '.why-us-section', 107 offset: -80, 108 reverse: false, 109}) 110.setTween(whyreview) 111.addTo(controller); 112 113var resourcegrid = new TimelineMax(); 114resourcegrid.from('.resources-grid-wrapper', 0.6, {y: 50, opacity: 0}); 115 116var resourcegridtrigger = new ScrollMagic.Scene({ 117 triggerElement: '.resources-grid-wrapper', 118 offset: -80, 119 reverse: false, 120}) 121.setTween(resourcegrid) 122.addTo(controller); 123 124var resourcegridwrap = new TimelineMax(); 125resourcegridwrap.from('.resources-grid-wrapper-section', 0.6, {y: 50, opacity: 0}); 126 127var resourcegridwraptrigger = new ScrollMagic.Scene({ 128 triggerElement: '.resources-grid-wrapper-section', 129 offset: -80, 130 reverse: false, 131}) 132.setTween(resourcegridwrap) 133.addTo(controller); 134 135var certificategrid = new TimelineMax(); 136certificategrid.from('.certification-wrapper .prep-badge', 0.5, {y: 50, opacity: 0}). 137from('.certification-wrapper .review-badge', 0.5, {y: 50, opacity: 0}). 138from('.certification-wrapper .information-badge', 0.5, {y: 50, opacity: 0}). 139from('.certification-description p', 0.5, {y: 50, opacity: 0}). 140from('.certification-description .banner-button-wrapper a:first-child', 0.5, {x: -50, opacity: 0}). 141from('.certification-description .banner-button-wrapper a:last-child', 0.5, {x: 50, opacity: 0}); 142 143var resourcegridtrigger = new ScrollMagic.Scene({ 144 triggerElement: '.certification-section', 145 offset: -80, 146 reverse: false, 147}) 148.setTween(certificategrid) 149.addTo(controller); 150 151var hardworksection = new TimelineMax(); 152hardworksection.from('.hard-work-image img', 0.5, {x: -50, opacity: 0}). 153from('.hard-work-content .section-title', 0.5, {x: 50, opacity: 0}). 154from('.hard-work-content .hard-work-tag-line', 0.5, {x: 50, opacity: 0}). 155from('.hard-work-content .review-grid:nth-child(3)', 0.5, {x: 50, opacity: 0}). 156from('.hard-work-content .review-grid:nth-child(4)', 0.5, {x: 50, opacity: 0}). 157from('.thank-reviews-section h4', 0.5, {x: 50, opacity: 0}). 158from('.thank-reviews-section .banner-button-wrapper .common-btn:first-child', 0.5, {x: 50, opacity: 0}). 159from('.thank-reviews-section .banner-button-wrapper .common-btn:last-child', 0.5, {x: 50, opacity: 0}); 160 161var hardworksectiontrigger = new ScrollMagic.Scene({ 162 triggerElement: '.hard-work-wrapper-section', 163 offset: -80, 164 reverse: false, 165}) 166.setTween(hardworksection) 167.addTo(controller); 168 169 170var featurejourney = new TimelineMax(); 171featurejourney.from('.feature-preparation-wrapper .section-title', 0.5, {y: 50, opacity: 0}). 172from('.feature-slider-main', 0.5, {y: 50, opacity: 0}).
173from('.slider-explore-button .common-btn', 0.5, {y: 50, opacity: 0}); 174 175var featurejourneytrigger = new ScrollMagic.Scene({ 176 triggerElement: '.feature-preparation-journey', 177 offset: -80, 178 reverse: false, 179}) 180.setTween(featurejourney) 181.addTo(controller); 182 183var certification = new TimelineMax(); 184certification.from('.certification-top-section .common-listng .section-title', 0.3, {x: 50, opacity: 0}). 185from('.certification-top-section ul li:nth-child(1)', 0.3, {x: 50, opacity: 0}). 186from('.certification-top-section ul li:nth-child(2)', 0.3, {x: 50, opacity: 0}). 187from('.certification-top-section ul li:nth-child(3)', 0.3, {x: 50, opacity: 0}). 188from('.certification-top-section .certification-image img', 0.3, {x: -50, opacity: 0}). 189from('.certification-top-section ul li:nth-child(4)', 0.3, {x: 50, opacity: 0}). 190from('.certification-top-section ul li:nth-child(5)', 0.3, {x: 50, opacity: 0}). 191from('.certification-top-section ul li:nth-child(6)', 0.3, {x: 50, opacity: 0}). 192from('.certification-top-section ul li:nth-child(7)', 0.3, {x: 50, opacity: 0}); 193 194var certificationtrigger = new ScrollMagic.Scene({ 195 triggerElement: '.certification-list-wrapper', 196 offset: -80, 197 reverse: false, 198}) 199.setTween(certification) 200.addTo(controller); 201 202var certificationpractice = new TimelineMax(); 203certificationpractice.from('.certification-bottom-section .common-listng .section-title', 0.4, {x: -50, opacity: 0}). 204from('.certification-bottom-section .certification-image img', 0.5, {x: 50, opacity: 0}). 205from('.certification-bottom-section .common-specification-courses', 0.5, {x: -50, opacity: 0}). 206from('.certification-bottom-section .career-journey-tag-line', 0.5, {x: -50, opacity: 0}). 207from('.certification-bottom-section .banner-button-wrapper a:nth-child(1)', 0.5, {x: -50, opacity: 0}); 208 209var certificationpracticetrigger = new ScrollMagic.Scene({ 210 triggerElement: '.certification-bottom-section', 211 offset: -80, 212 reverse: false, 213}) 214.setTween(certificationpractice) 215.addTo(controller); 216 217var reviewspecifications = new TimelineMax(); 218reviewspecifications.from('.free-resume-builder .review-specification-image img', 0.4, {x: -50, opacity: 0}). 219from('.free-resume-builder .common-listng .section-title', 0.5, {x: 50, opacity: 0}). 220from('.free-resume-builder .common-specification-courses', 0.5, {x: 50, opacity: 0}). 221from('.free-resume-builder .certification-tag-line', 0.5, {x: 50, opacity: 0}). 222from('.free-resume-builder .banner-button-wrapper .common-btn', 0.5, {x: 50, opacity: 0}). 223from('.free-personal-signature .review-specification-image img', 0.4, {x: 50, opacity: 0}). 224from('.free-personal-signature .common-listng .section-title', 0.5, {x: -50, opacity: 0}). 225from('.free-personal-signature .common-specification-courses', 0.5, {x: -50, opacity: 0}). 226from('.free-personal-signature .banner-button-wrapper .common-btn', 0.5, {x: -50, opacity: 0}). 227from('.free-flashcards-sections .review-specification-image img', 0.4, {x: -50, opacity: 0}). 228from('.free-flashcards-sections .common-listng .section-title', 0.5, {x: 50, opacity: 0}). 229from('.free-flashcards-sections .common-specification-courses', 0.5, {x: 50, opacity: 0}). 230from('.free-flashcards-sections .banner-button-wrapper .common-btn', 0.5, {x: 50, opacity: 0}); 231 232var reviewspecificationstrigger = new ScrollMagic.Scene({ 233 triggerElement: '.review-specifications', 234 offset: -80, 235 reverse: false, 236}) 237.setTween(reviewspecifications) 238.addTo(controller); 239 240var blogsection = new TimelineMax(); 241blogsection.from('.blog-section .section-title', 0.5, {y: 50, opacity: 0}). 242from('.blog-section .row .col-md-4:first-child', 0.5, {y: 50, opacity: 0}). 243from('.blog-section .row .col-md-4:nth-child(2)', 0.5, {y: 50, opacity: 0}). 244from('.blog-section .row .col-md-4:nth-child(3)', 0.5, {y: 50, opacity: 0}); 245 246var blogsectiontrigger = new ScrollMagic.Scene({ 247 triggerElement: '.blog-section', 248 offset: -80, 249 reverse: false, 250}) 251.setTween(blogsection) 252.addTo(controller); 253 254var contactsection = new TimelineMax(); 255contactsection.from('.contact-img-vector', 0.4, {x: -50, opacity: 0}). 256from('.contact-form-section', 0.4, {x: 50, opacity: 0}); 257 258var contactsectiontrigger = new ScrollMagic.Scene({ 259 triggerElement: '.contact-form', 260 offset: -80, 261 reverse: false, 262}) 263.setTween(contactsection) 264.addTo(controller); 265 266var footersection = new TimelineMax(); 267footersection.from('.footer .row .col-lg-3:first-child', 0.4, {x: -50, opacity: 0}). 268from('.footer .row .col-lg-3:nth-child(2)', 0.4, {x: -50, opacity: 0}). 269from('.footer .row .col-lg-3:nth-child(3)', 0.4, {x: -50, opacity: 0}). 270from('.footer .row .col-lg-3:nth-child(4)', 0.4, {x: -50, opacity: 0}). 271from('.copyright-section .copyright-text', 0.4, {x: -50, opacity: 0}). 272from('.copyright-section .footer-links', 0.4, {x: 50, opacity: 0}); 273 274var footersectiontrigger = new ScrollMagic.Scene({ 275 triggerElement: '.footer', 276 offset: -80, 277 reverse: false, 278})
279.setTween(footersection) 280.addTo(controller); 281 282 283 284document.addEventListener('DOMContentLoaded', function() { 285 if ($("#start_datetime").length > 0) { 286 var sd = $("#start_datetime").val().split(" "); 287 var sDate = sd[0].split("-"); 288 var stime = sd[1].split(":"); 289 var ed = $("#end_datetime").val().split(" "); 290 var eDate = ed[0].split("-"); 291 var etime = ed[1].split(":"); 292 293 var CurrentDate = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''); 294 var cd = CurrentDate.split(" "); 295 var cDate = cd[0].split("-"); 296 var ctime = cd[1].split(":"); 297 298 299 // var FinalCurrentDate = cDate[0], cDate[1], cDate[2], ctime[0], ctime[1], ctime[2]; 300 // var FinalStartDate = sDate[0], sDate[1], sDate[2], stime[0], stime[1], stime[2]; 301 // var FinalEndDate = eDate[0], eDate[1], eDate[2], etime[0], etime[1], etime[2]; 302 303 var today = new Date(CurrentDate); 304 // console.log('today', today); 305 var dateStart = new Date($("#start_datetime").val()); 306 // console.log('dateStart', dateStart); 307 var dateEnd = new Date($("#end_datetime").val()); 308 // console.log('dateEnd', dateEnd); 309 310 if ((Date.parse(today) >= Date.parse(dateStart)) && (Date.parse(today) <= Date.parse(dateEnd))) { 311 // console.log('show'); 312 $(".top-header-notification-bar").removeClass('d-none'); //show 313 } else { 314 // console.log('hide'); 315 $(".main-menu-1x").css('top', '0'); 316 $(".main-menu-1x, .top-header-notification-bar").removeClass('sticky-menu'); 317 $(".top-header-notification-bar").remove(); 318 } 319 320 var timer3 = new PsgTimer('#thirdTimer', { 321 currentDateTime: today.getTime(),// Date.UTC(cDate[0], cDate[1], cDate[2], ctime[0], ctime[1], ctime[2]), 322 endDateTime: dateEnd.getTime(),// Date.UTC(eDate[0], eDate[1], eDate[2], etime[0], etime[1], etime[2]), 323 labels: {} 324 }); 325 } 326 }); 327 328 (function() { 329 var callbacks = { 330 onInit: function() {}, 331 onStart: function() {}, 332 onStop: function() {}, 333 onEnd: function() {}, 334 onChangeStart: function() {}, 335 onChangeEnd: function() {} 336 }; 337 338 var base = { 339 stopped: true, 340 timezone: 0, 341 diff: null, 342 isEnd: false 343 }; 344 345 var PsgTimer = function(selector, options) { 346 var timer = this; 347 if (selector.nodeType === Node.ELEMENT_NODE) { 348 timer.container = $(selector); 349 } else if (typeof selector === 'string') { 350 timer.selector = selector; 351 timer.container = $(timer.selector); 352 } else if (typeof selector === 'object') { 353 options = selector; 354 timer.selector = options.selector; 355 timer.container = $(timer.selector); 356 } 357 358 timer.options = $.extend({}, { 359 selector: '#psgTimer', 360 animation: false, 361 multipleBlocks: false, 362 endDateTime: undefined, 363 // currentDateTime: window.serverTime['U'] * 1000 || Date.now(), 364 currentDateTime: Date.now(), 365 labels: { 366 days: timer.container.attr('data-label-days') ? timer.container.attr('data-label-days') : false, 367 hours: timer.container.attr('data-label-hours') ? timer.container.attr('data-label-hours') : false, 368 minutes: timer.container.attr('data-label-minutes') ? timer.container.attr('data-label-minutes') : false, 369 seconds: timer.container.attr('data-label-seconds') ? timer.container.attr('data-label-seconds') : false 370 } 371 }, options); 372 373 timer.callbacks = timer.options.callbacks = $.extend({}, callbacks, timer.options.callbacks); 374 timer.base = $.extend({}, base); 375 376 if (typeof timer.options.endDateTime === 'string') { 377 timer.options.endDateTime = setTimerEndFromString(timer, timer.options.endDateTime); 378 } 379 380 timer.container.length ? timer.init() : console.log('No timer element on this page'); 381 }; 382 383 PsgTimer.prototype.init = function() { 384 var timer = this, 385 options = this.options; 386 387 var timerEnd = timer.container.attr('data-timer-end'); 388 389 if (timerEnd !== undefined) { 390 options.endDateTime = setTimerEndFromString(timer, timerEnd); 391 } 392 393 // options.endDateTime = options.endDateTime + (timer.base.timezone * 1000 * 60 * 60); 394 395 timer.countdown = transformCountToArray(getCurrentCountDown(timer), options.multilpeBlocks); 396 397 timer.container.addClass('psgTimer').append(createMarkup(timer)); 398 if (options.animation) { 399 timer.container.addClass('psgTimer_' + options.animation); 400 } 401 402 timer.query = setQueries(timer); 403 timer.callbacks.onInit(); 404 405 if (!timer.base.isEnd) { 406 timer.start(); 407 } 408 }; 409 410 PsgTimer.prototype.start = function() { 411 var timer = this; 412 413 if (timer.base.stopped) { 414 timer.base.stopped = false; 415 416 timer.intervalId = setInterval(function() { 417 updateCounter(timer); 418 }, 1000); 419 420 timer.callbacks.onStart(); 421 } 422 }; 423 424 PsgTimer.prototype.restart = function() { 425 var timer = this; 426 timer.options.currentDateTime = Date.now(); 427 timer.start(); 428 }; 429 430 PsgTimer.prototype.stop = function() { 431 var timer = this; 432 timer.base.stopped = true; 433 clearTimeout(timer.intervalId); 434 435 timer.callbacks.onStop(); 436 }; 437 438 439 var getCurrentCountDown = function(timer) { 440 var options = timer.options; 441 var base = timer.base; 442 443 444 // console.log("options.endDateTime - " + options.endDateTime); 445 446 options.currentDateTime = options.currentDateTime + 1001; 447 base.diff = options.endDateTime - options.currentDateTime; 448 449 450 // console.log("base.diff - " + base.diff); 451 452 var seconds = 0; 453 var minutes = 0; 454 var hours = 0; 455 var days = 0; 456 457 if (base.diff > 0) { 458 var total = parseFloat(((((base.diff / 1000.0) / 60.0) / 60.0) / 24.0)); 459 days = parseInt(total); 460 total -= days; 461 total *= 24.0; 462 hours = parseInt(total); 463 total -= hours; 464 total *= 60.0; 465 minutes = parseInt(total); 466 total -= minutes; 467 total *= 60; 468 seconds = parseInt(total); 469 } else { 470 timer.callbacks.onEnd(); 471 timer.stop(); 472 timer.base.isEnd = true; 473 } 474 475 // console.log("days - " + days); 476 477 return { 478 days: { 479 amount: days, 480 max: Infinity, 481 className: 'days' 482 }, 483 hours: { 484 amount: hours, 485 max: 24, 486 className: 'hours' 487 }, 488 minutes: { 489 amount: minutes, 490 max: 60, 491 className: 'minutes' 492 }, 493 seconds: { 494 amount: seconds, 495 max: 60, 496 className: 'seconds' 497 } 498 } 499 }; 500 501 var transformCountToArray = function(count, multilpeBlocks) { 502 if (typeof count === 'object') { 503 for (var unit in count) { 504 if (count.hasOwnProperty(unit)) { 505 count[unit].amount = count[unit].amount.toString(); 506 507 if (count[unit].amount.length < 2) { 508 count[unit].amount = '0' + count[unit].amount; 509 } 510 511 if (multilpeBlocks) { 512 count[unit].amount = count[unit].amount.split(''); 513 } else { 514 count[unit].amount = [count[unit].amount]; 515 } 516 } 517 } 518 } 519 520 return count; 521 }; 522 523 var getTimeZone = function(string) { 524 var hours, minutes; 525 var number = string.replace(/\D/g, ''); 526 var digit = string.replace(/[^+-]/g, ''); 527 var multiplier = digit === '-' ? (-1) : 1; 528 529 if (number.length >= 3) { 530 hours = Number(number.substr(0, number.length - 2)); 531 minutes = Number(number.substr(number.length - 2, 2)); 532 } else { 533 hours = Number(number); 534 minutes = 0; 535 } 536 537 return (hours + minutes / 60) * multiplier; 538 }; 539 540 var setTimerEndFromString = function(timer, endTimeString) { 541 var timerDate = {}; 542 var timerEnd = endTimeString.split(' '); 543 var endTime; 544 545 var timeExp = /^([0-1]\d|2[0-3])(:[0-5]\d){1,2}$/; 546 var dateExp = /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/; 547 var zoneExp = /(UTC|GMT)[+-](\d{1,2}([:,.]?\d{2})?)/; 548 549 for (var i = 0; i < timerEnd.length; i++) { 550 if (timerEnd[i].match(timeExp)) { 551 timerDate.time = timerEnd[i].split(':'); 552 } else if (timerEnd[i].match(dateExp)) { 553 timerDate.date = timerEnd[i].split('.'); 554 } else if (timerEnd[i].match(zoneExp)) { 555 timer.base.timezone = getTimeZone(timerEnd[i]); 556 } else { 557 console.log('Wrong end time.'); 558 } 559 } 560 561 timerDate.year = parseInt(timerDate.date[2]) || 0; 562 timerDate.month = parseInt(timerDate.date[1]) - 1 || 0; 563 timerDate.day = parseInt(timerDate.date[0]) || 0; 564 timerDate.hours = parseInt(timerDate.time[0]) || 0; 565 timerDate.minutes = parseInt(timerDate.time[1]) || 0; 566 timerDate.seconds = parseInt(timerDate.time[2]) || 0; 567 timerDate.miliseconds = parseInt(timerDate.time[3]) || 0; 568 569 endTime = Date.UTC(timerDate.year, timerDate.month, timerDate.day, timerDate.hours, timerDate.minutes, timerDate.seconds, timerDate.miliseconds); 570 571 return endTime; 572 }; 573 574 var createMarkup = function(timer) { 575 var countdown = timer.countdown; 576 var markup = {}; 577 578 for (var unit in countdown) { 579 if (countdown.hasOwnProperty(unit)) { 580 var numberBlocks = ''; 581 countdown[unit].amount.forEach(function(num) { 582 numberBlocks += numberContainer(timer, num); 583 }); 584
585 markup.unit += '<div class="' + countdown[unit].className + ' psgTimer_unit">' + numberBlocks + '</div>'; 586 } 587 } 588 589 markup.numbers = '<div class="psgTimer_numbers">' + markup.unit + '</div>'; 590 markup.full = markup.numbers; 591 592 if ( 593 timer.options.labels && 594 timer.options.labels.days && 595 timer.options.labels.hours && 596 timer.options.labels.minutes && 597 timer.options.labels.seconds 598 ) { 599 var labels = timer.options.labels; 600 markup.labels = '<div class="psgTimer_labels">' + 601 '<div class="days">' + labels.days + '</div>' + 602 '<div class="hours">' + labels.hours + '</div>' + 603 '<div class="minutes">' + labels.minutes + '</div>' + 604 '<div class="seconds">' + labels.seconds + '</div>' + 605 '</div>'; 606 markup.full = markup.numbers + markup.labels; 607 } else { 608 609 markup.full = markup.numbers; 610 } 611 612 return markup.full; 613 }; 614 615 var numberContainer = function(timer, num) { 616 var markup = '', 617 data = 'data-number="' + num + '"'; 618 619 var numberBlock = '<div class="number" ' + data + '>' + num + '</div>'; 620 621 if (timer.options.animation === 'fade') { 622 markup = '<div>' + numberBlock + '</div>'; 623 } else { 624 markup = numberBlock; 625 } 626 627 return markup; 628 }; 629 630 var setQueries = function(timer) { 631 var countdown = timer.countdown, 632 query = {}; 633 634 for (var unit in countdown) { 635 if (countdown.hasOwnProperty(unit)) { 636 query[unit] = timer.container.find(numberSelector(timer, countdown[unit].className)); 637 } 638 } 639 640 return query; 641 }; 642 643 var numberSelector = function(timer, className) { 644 var selector = ''; 645 646 if (timer.options.animation === 'fade') { 647 selector = '.' + className + ' .number'; 648 } else { 649 selector = '.' + className + ' .number'; 650 } 651 652 return selector; 653 }; 654 655 var updateCounter = function(timer) { 656 timer.callbacks.onChangeStart(); 657 658 timer.countdown = transformCountToArray(getCurrentCountDown(timer), timer.options.multilpeBlocks); 659 660 for (var unit in timer.countdown) { 661 if (timer.countdown.hasOwnProperty(unit)) { 662 timer.countdown[unit].amount.forEach(function(number, index) { 663 if (timer.query[unit][index].getAttribute('data-number') !== number) { 664 aminate(timer.query[unit][index], number, timer.options.animation); 665 } 666 }); 667 } 668 } 669 670 timer.callbacks.onChangeEnd(); 671 }; 672 673 var aminate = function(el, value, animationType) { 674 var $el = $(el); 675 $el.attr('data-number', value); 676 677 if (animationType === 'fade') { 678 animation.fade($el, value); 679 } else { 680 $el.html(value); 681 } 682 }; 683 684 var animation = { 685 fade: function($el, value) { 686 var animDuration = 350; 687 688 $el.css({ 689 'transition': 'opacity ' + animDuration + 'ms', 690 'opacity': '0' 691 }); 692 693 setTimeout(function() { 694 $el.html(value).css('opacity', 1); 695 }, animDuration + 10); 696 } 697 }; 698 699 window.PsgTimer = PsgTimer; 700 })();
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.