1// jQuery to collapse the navbar on scroll 2$(window).scroll(function() { 3 if ($(".navbar").offset().top > 50) { 4 $(".navbar-fixed-top").addClass("top-nav-collapse"); 5 $(".scroll-top").fadeIn('1000', "easeInOutExpo"); 6 } else { 7 $(".navbar-fixed-top").removeClass("top-nav-collapse"); 8 $(".scroll-top").fadeOut('1000', "easeInOutExpo"); 9 } 10}); 11 12// jQuery for page scrolling feature - requires jQuery Easing plugin 13$(function() { 14 $('.overlay-menu ul li a,.scroll-top a').bind('click', function(event) { 15 var $anchor = $(this); 16 $('html, body').stop().animate({ 17 scrollTop: $($anchor.attr('href')).offset().top 18 }, 1500, 'easeInOutExpo'); 19 event.preventDefault(); 20 }); 21}); 22 23 24// WOW.js initialise 25// WOW.js uses animate.css to animate/reveal elements. 26// Browse the list of animation effects available here-> https://daneden.github.io/animate.css/ 27$(function() { 28 wow = new WOW( 29 { 30 boxClass: 'wow', // default 31 animateClass: 'animated', // default 32 offset: 0, // default 33 mobile: true, // default 34 live: true // default 35 } 36 ) 37 wow.init(); 38}); 39 40 41// jQuery Parallax. More info here-> https://github.com/IanLunn/jQuery-Parallax 42$(function(){ 43 // apply parallax effect only when body has the ".parallax-page" class 44 if ($('body').hasClass('parallax-page')) { 45 //.parallax(xPosition, speedFactor, outerHeight) options: 46 //xPosition - Horizontal position of the element 47 //inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling 48 //outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport 49 50 $('#parallax-slide').parallax("50%", 0.1); 51 $('#products').parallax("50%", 0.1); 52 $('#portfolio').parallax("50%", 0.1); 53 $('#page-aboutus').parallax("50%", 0.1); 54 } 55}); 56 57 58// Closes the Responsive Menu on Menu Item Click 59$('.overlay-menu ul li a').click(function() { 60 $('.button_container:visible').click(); 61}); 62 63 64// jQuery for page scrolling feature - requires jQuery Easing plugin 65$(function() { 66 $('a.page-scroll').bind('click', function(event) { 67 var $anchor = $(this); 68 $('html, body').stop().animate({ 69 scrollTop: $($anchor.attr('href')).offset().top 70 }, 1500, 'easeInOutExpo'); 71 event.preventDefault(); 72 }); 73}); 74 75 76// Closes the Responsive Menu on Menu Item Click 77$('.navbar-collapse ul li a').click(function() { 78 $('.navbar-toggle:visible').click(); 79}); 80 81// Navigation show/hide 82$('.toggle').click(function() { 83 if ($('#overlay.open')) { 84 $(this).toggleClass('active'); 85 $('#overlay').toggleClass('open'); 86 } 87}); 88 89 90// Client testimonials 91$(function() { 92 93 var owl = $(".client-testimonials"); 94 95 owl.owlCarousel({ 96 navigation: false, // Show next and prev buttons 97 slideSpeed: 300, 98 paginationSpeed: 400, 99 singleItem: true 100 }); 101 102}); 103 104 105// Client Slider Carousel 106$(function() { 107 108 var owl = $(".client-slider"); 109 110 owl.owlCarousel({ 111 items: 4, //5 items above 1000px browser width 112 itemsDesktop: [1024, 4], //4 items between 1000px and 901px 113 itemsDesktopSmall: [900, 3], // betweem 900px and 601px 114 itemsTablet: [600, 2], //2 items between 600 and 480 115 itemsMobile: [479, 2], //1 item between 480 and 0 116 pagination: false, // Show pagination 117 navigation: false // Show navigation 118 }); 119 120}); 121 122 123// Recent Project Carousel 124$(function() { 125 126 var owl = $(".recent-project-carousel"); 127 128 owl.owlCarousel({ 129 items: 3, //5 items above 1000px browser width 130 itemsDesktop: [1024, 4], //4 items between 1000px and 901px 131 itemsDesktopSmall: [900, 2], // betweem 900px and 601px 132 itemsTablet: [600, 2], //2 items between 600 and 480 133 itemsMobile: [479, 1], //1 item between 480 and 0 134 pagination: true, // Show pagination 135 navigation: false // Show navigation 136 }); 137 138 139 // Custom Navigation Events 140 $(".btn-next").on('click', function() { 141 owl.trigger('owl.next'); 142 }) 143 $(".btn-prev").on('click', function() { 144 owl.trigger('owl.prev'); 145 }) 146 147}); 148 149 150 151// Counter 152$(function() { 153 154 $('.counter-section').on('inview', function(event, visible, visiblePartX, visiblePartY) { 155 if (visible) { 156 $(this).find('.timer').each(function() { 157 var $this = $(this); 158 $({ 159 Counter: 0 160 }).animate({ 161 Counter: $this.text() 162 }, { 163 duration: 2000,
164 easing: 'swing', 165 step: function() { 166 $this.text(Math.ceil(this.Counter)); 167 } 168 }); 169 }); 170 $(this).off('inview'); 171 } 172 }); 173 174}); 175 176 177// Carousel Slider 178$(function() { 179 interval: 8000 //changes the speed 180}); 181 182 183// YouTube Player 184$(function() { 185 $(".player").mb_YTPlayer(); 186 187 $('#video-play').click(function(event) { 188 event.preventDefault(); 189 if ($(this).hasClass('fa-play')) { 190 $('.player').playYTP(); 191 } else { 192 $('.player').pauseYTP(); 193 } 194 $(this).toggleClass('fa-play fa-pause'); 195 return false; 196 }); 197 198 $('#video-volume').click(function(event) { 199 event.preventDefault(); 200 $('.player').toggleVolume(); 201 $(this).toggleClass('fa-volume-off fa-volume-up'); 202 return false; 203 }); 204}); 205 206 207// HTML5 Player 208$(function() { 209 210 var vid = $("#html5-video").get(0); 211 212 $('#html5-video-play').click(function(event) { 213 event.preventDefault(); 214 if (vid.paused) { 215 vid.play(); 216 } else { 217 vid.pause(); 218 } 219 $(this).toggleClass('fa-play fa-pause'); 220 return false; 221 }); 222 223 $('#html5-video-volume').click(function(event) { 224 event.preventDefault(); 225 if (vid.muted) { 226 vid.muted = false; 227 } else { 228 vid.muted = true; 229 } 230 $(this).toggleClass('fa-volume-off fa-volume-up'); 231 return false; 232 }); 233}); 234 235 236 237// Google map API 238$(function() { 239 240 //set your google maps parameters 241 var latitude = 23.7974766, 242 longitude = 90.4066282, 243 map_zoom = 14; 244 245 //google map custom marker icon - .png fallback for IE11 246 var is_internetExplorer11 = navigator.userAgent.toLowerCase().indexOf('trident') > -1; 247 var marker_url = (is_internetExplorer11) ? 'assets/images/cd-icon-location.png' : 'assets/images/cd-icon-location.svg'; 248 249 //define the basic color of your map, plus a value for saturation and brightness 250 var main_color = '#2d313f', 251 saturation_value = -90, 252 brightness_value = 2; 253 254 //we define here the style of the map 255 var style = [{ 256 //set saturation for the labels on the map 257 elementType: "labels", 258 stylers: [{ 259 saturation: saturation_value 260 }] 261 }, { //poi stands for point of interest - don't show these lables on the map 262 featureType: "poi", 263 elementType: "labels", 264 stylers: [{ 265 visibility: "off" 266 }] 267 }, { 268 //don't show highways lables on the map 269 featureType: 'road.highway', 270 elementType: 'labels', 271 stylers: [{ 272 visibility: "off" 273 }] 274 }, { 275 //don't show local road lables on the map 276 featureType: "road.local", 277 elementType: "labels.icon", 278 stylers: [{ 279 visibility: "off" 280 }] 281 }, { 282 //don't show arterial road lables on the map 283 featureType: "road.arterial", 284 elementType: "labels.icon", 285 stylers: [{ 286 visibility: "off" 287 }] 288 }, { 289 //don't show road lables on the map 290 featureType: "road", 291 elementType: "geometry.stroke", 292 stylers: [{ 293 visibility: "off" 294 }] 295 }, 296 //style different elements on the map 297 { 298 featureType: "transit", 299 elementType: "geometry.fill", 300 stylers: [{ 301 hue: main_color 302 }, { 303 visibility: "on" 304 }, { 305 lightness: brightness_value 306 }, { 307 saturation: saturation_value 308 }] 309 }, { 310 featureType: "poi", 311 elementType: "geometry.fill", 312 stylers: [{ 313 hue: main_color 314 }, { 315 visibility: "on" 316 }, { 317 lightness: brightness_value 318 }, { 319 saturation: saturation_value 320 }] 321 }, { 322 featureType: "poi.government", 323 elementType: "geometry.fill", 324 stylers: [{ 325 hue: main_color 326 }, { 327 visibility: "on" 328 }, { 329 lightness: brightness_value 330 }, { 331 saturation: saturation_value 332 }] 333 }, { 334 featureType: "poi.sport_complex", 335 elementType: "geometry.fill", 336 stylers: [{ 337 hue: main_color 338 }, { 339 visibility: "on" 340 }, { 341 lightness: brightness_value 342 }, { 343 saturation: saturation_value 344 }] 345 }, { 346 featureType: "poi.attraction", 347 elementType: "geometry.fill", 348 stylers: [{ 349 hue: main_color 350 }, { 351 visibility: "on" 352 }, { 353 lightness: brightness_value 354 }, { 355 saturation: saturation_value 356 }] 357 }, { 358 featureType: "poi.business", 359 elementType: "geometry.fill", 360 stylers: [{ 361 hue: main_color 362 }, { 363 visibility: "on" 364 }, { 365 lightness: brightness_value 366 }, { 367 saturation: saturation_value 368 }] 369 }, { 370 featureType: "transit", 371 elementType: "geometry.fill", 372 stylers: [{ 373 hue: main_color 374 }, { 375 visibility: "on" 376 }, { 377 lightness: brightness_value 378 }, { 379 saturation: saturation_value 380 }] 381 }, { 382 featureType: "transit.station", 383 elementType: "geometry.fill", 384 stylers: [{ 385 hue: main_color 386 }, { 387 visibility: "on" 388 }, { 389 lightness: brightness_value 390 }, { 391 saturation: saturation_value 392 }] 393 }, { 394 featureType: "landscape", 395 stylers: [{ 396 hue: main_color 397 }, { 398 visibility: "on" 399 }, { 400 lightness: brightness_value 401 }, { 402 saturation: saturation_value 403 }] 404 405 }, { 406 featureType: "road", 407 elementType: "geometry.fill", 408 stylers: [{ 409 hue: main_color 410 }, { 411 visibility: "on" 412 }, { 413 lightness: brightness_value 414 }, { 415 saturation: saturation_value 416 }] 417 }, { 418 featureType: "road.highway", 419 elementType: "geometry.fill", 420 stylers: [{ 421 hue: main_color 422 }, { 423 visibility: "on" 424 }, { 425 lightness: brightness_value 426 }, { 427 saturation: saturation_value 428 }] 429 }, { 430 featureType: "water", 431 elementType: "geometry", 432 stylers: [{ 433 hue: main_color 434 }, { 435 visibility: "on" 436 }, { 437 lightness: brightness_value 438 }, { 439 saturation: saturation_value 440 }] 441 } 442 ]; 443 444 //set google map options 445 var map_options = { 446 center: new google.maps.LatLng(latitude, longitude), 447 zoom: map_zoom, 448 panControl: false, 449 zoomControl: false, 450 mapTypeControl: false, 451 streetViewControl: false, 452 mapTypeId: google.maps.MapTypeId.ROADMAP, 453 scrollwheel: false, 454 styles: style, 455 } 456 //inizialize the map 457 var map = new google.maps.Map(document.getElementById('google-container'), map_options); 458 //add a custom marker to the map 459 var marker = new google.maps.Marker({ 460 position: new google.maps.LatLng(latitude, longitude), 461 map: map, 462 visible: true, 463 icon: marker_url, 464 }); 465
466 //add custom buttons for the zoom-in/zoom-out on the map 467 function CustomZoomControl(controlDiv, map) { 468 //grap the zoom elements from the DOM and insert them in the map 469 var controlUIzoomIn = document.getElementById('cd-zoom-in'), 470 controlUIzoomOut = document.getElementById('cd-zoom-out'); 471 controlDiv.appendChild(controlUIzoomIn); 472 controlDiv.appendChild(controlUIzoomOut); 473 474 // Setup the click event listeners and zoom-in or out according to the clicked element 475 google.maps.event.addDomListener(controlUIzoomIn, 'click', function() { 476 map.setZoom(map.getZoom() + 1) 477 }); 478 google.maps.event.addDomListener(controlUIzoomOut, 'click', function() { 479 map.setZoom(map.getZoom() - 1) 480 }); 481 } 482 483 var zoomControlDiv = document.createElement('div'); 484 var zoomControl = new CustomZoomControl(zoomControlDiv, map); 485 486 //insert the zoom div on the top left of the map 487 map.controls[google.maps.ControlPosition.LEFT_TOP].push(zoomControlDiv); 488 489}); 490 491 492 493// Lightbox 494$(function() { 495 $('.popup-gallery').magnificPopup({ 496 delegate: '.full-project a', 497 type: 'image', 498 tLoading: 'Loading image #%curr%...', 499 mainClass: 'mfp-img-mobile', 500 gallery: { 501 enabled: true, 502 navigateByImgClick: true, 503 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 504 }, 505 image: { 506 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 507 titleSrc: function(item) { 508 return item.el.attr('title') + '<small>by Hallooou</small>'; 509 } 510 } 511 }); 512 513}); 514 515 516 517// Contact form 518$(function() { 519 // validate contact form on keyup and submit 520 $("#contactForm").validate({ 521 rules: { 522 name: { 523 required: true, 524 minlength: 2, 525 lettersonly: true 526 }, 527 email: { 528 required: true, 529 minlength: 6, 530 email: true 531 }, 532 phone: { 533 required: true, 534 digits: true, 535 minlength: 10, 536 maxlength: 15 537 }, 538 message: { 539 required: true, 540 minlength: 6 541 } 542 }, 543 messages: { 544 name: { 545 required: "Please enter your name", 546 minlength: "Minimum 2 characters", 547 lettersonly: "Only letters please!" 548 }, 549 email: { 550 required: "Please enter your email address", 551 minlength: "Minimum 6 characters", 552 email: "That's an invalid email" 553 }, 554 phone: { 555 required: "Please enter your phone number", 556 digits: "Only digits (no spaces)", 557 minlength: "Minimum 10 characters", 558 maxlength: "Maximum 15 characters" 559 }, 560 message: { 561 required: "Please enter your message", 562 minlength: "Minimum 6 characters" 563 } 564 }, 565 success: function(label) { 566 label.addClass("valid").text("Perfect!"); 567 }, 568 submitHandler: function(element) { 569 570 var ajaxform = $(element), 571 url = ajaxform.attr('action'), 572 type = ajaxform.attr('method'), 573 data = {}; 574 575 $(ajaxform).find('[name="submit"]').html('<i class="fa fa-circle-o-notch fa-spin fa-fw"></i> Sending...'); 576 577 578 ajaxform.find('[name]').each(function(index, value) { 579 var field = $(this), 580 name = field.attr('name'), 581 value = field.val(); 582 583 data[name] = value; 584 585 }); 586 587 $.ajax({ 588 url: url, 589 type: type, 590 data: data, 591 success: function(response) { 592 if (response.type == 'success') { 593 $("#contactForm").before("<div class='alert alert-success' role='alert'><a href='#' class='close' data-dismiss='alert'>×</a>" + response.text + "</div>"); 594 $(ajaxform).each(function() { 595 this.reset(); 596 $(this).find('[name="submit"]').html('<i class="fa fa-paper-plane fa-fw"></i> Send'); 597 }).find('.valid').each(function() { 598 $(this).remove('label.valid'); 599 }) 600 } else if (response.type == 'error') { 601 $("#contactForm").before("<div class='alert alert-danger' role='alert'><a href='#' class='close' data-dismiss='alert'>×</a>" + response.text + "</div>"); 602 $(ajaxform).find('[name="submit"]').html('<i class="fa fa-paper-plane fa-fw"></i> Send'); 603 } 604 } 605 }); 606 607 return false;
608 } 609 }); 610 611});
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.