https://mediumturquoise-mantis-384828.hostingersite.com/wp-content/themes/leven/js/main.js?ver=1.8.4
1/* 2* Template Name: Leven - Responsive vCard WordPress Theme 3* Author: lmpixels 4* Author URL: http://themeforest.net/user/lmpixels 5* Version: 1.8.4 6*/ 7 8(function($) { 9"use strict"; 10 var body = $('body'); 11 12 function imageCarousel() { 13 $('.portfolio-page-carousel').each(function() { 14 $(this).imagesLoaded(function () { 15 $('.portfolio-page-carousel').owlCarousel({ 16 smartSpeed:1200, 17 items: 1, 18 loop: true, 19 dots: true, 20 nav: true, 21 navText: false, 22 autoHeight: true, 23 autoplay: true, 24 margin: 10 25 }); 26 }); 27 }); 28 } 29 30 function contentSlider() { 31 $('.lm-content-slider').each(function() { 32 var slider = $(this), 33 mobile_mode_items = $(this).attr('data-mobile-items'), 34 tablet_mode_items = $(this).attr('data-tablet-items'), 35 items = $(this).attr('data-items'), 36 loop = false, 37 windowWidth = $(window).width(), 38 autoplayTablet = '', 39 autoplayValue = '', 40 autoplayTime = ''; 41 if (slider.hasClass('autoplay-on')) { 42 autoplayValue = true; 43 autoplayTime = slider.attr('data-autotime'); 44 if (slider.hasClass('autoplay-mobile')) { 45 if (windowWidth > 768) { 46 autoplayValue = false; 47 } else { 48 autoplayValue = true; 49 } 50 } 51 } else { 52 autoplayValue = false; 53 } 54 55 if (slider.hasClass('loop-on')) { 56 loop = true; 57 } else { 58 loop = false; 59 } 60 61 slider.imagesLoaded(function () { 62 63 slider.owlCarousel({ 64 nav: true, 65 dots: true, 66 items: 1, 67 loop: loop, 68 navText: false, 69 autoHeight: true, 70 autoplay: autoplayValue, 71 autoplayTimeout: autoplayTime, 72 margin: 10, 73 responsive : { 74 0 : { 75 items: mobile_mode_items, 76 }, 77 768 : { 78 items: tablet_mode_items, 79 }, 80 1200 : { 81 items: items, 82 } 83 } 84 }); 85 86 87 }); 88 }); 89 } 90 91 // Ajax Pages loader 92 function ajaxLoader() { 93 var ajaxLoadedContent = $('#page-ajax-loaded'); 94 function showContent() { 95 ajaxLoadedContent.removeClass('fadeOutLeft closed'); 96 ajaxLoadedContent.show(); 97 $('body').addClass('ajax-page-visible'); 98 } 99 function hideContent() { 100 $('#page-ajax-loaded').addClass('fadeOutLeft closed'); 101 $('body').removeClass('ajax-page-visible'); 102 setTimeout(function(){ 103 $('#page-ajax-loaded.closed').html(''); 104 ajaxLoadedContent.hide(); 105 $('#page-ajax-loaded').append('<div class="preloader-portfolio"><div class="preloader-animation"><div class="preloader-spinner"></div></div></div></div>'); 106 }, 500); 107 } 108 109 $(document) 110 .on("click",".site-auto-menu, #portfolio-page-close-button", function (e) { 111 e.preventDefault(); 112 hideContent(); 113 }) 114 .on("click",".ajax-page-load", function () { 115 var toLoad = $(this).attr('href') + '?ajax=true'; 116 showContent(); 117 ajaxLoadedContent.load(toLoad, function() { 118 imageCarousel(); 119 120 contentSlider(); 121 122 var $gallery_container = $("#portfolio-gallery-grid"); 123 $gallery_container.imagesLoaded(function () { 124 $gallery_container.masonry(); 125 }); 126
127 $('.portfolio-page-wrapper .portfolio-grid').each(function() { 128 $(this).magnificPopup({ 129 delegate: 'a.gallery-lightbox', 130 type: 'image', 131 gallery: { 132 enabled:true 133 } 134 }); 135 }); 136 137 lazyVideo(); 138 }); 139 140 return false; 141 }); 142 } 143 // /Ajax Pages loader 144 145 // Lazy Video Loading 146 function lazyVideo() { 147 var youtube = $('.embed-youtube-video'), 148 vimeo = $('.embed-vimeo-video'); 149 150 youtube.each(function() { 151 var video_wrap = $(this), 152 id = $(this).attr('data-embed'), 153 id = id.split('youtube.com/embed/')[1]; 154 155 var thumb_url = "//img.youtube.com/vi/"+id+"/0.jpg"; 156 $('<img width="100%" src="'+thumb_url+'" />').appendTo($(this)); 157 158 $(this).on("click", "div.play-button", function (e) { 159 var $video_iframe = $('<iframe class="embed-responsive-item" src="//www.youtube.com/embed/' + id + '?rel=0&showinfo=0&autoplay=1&output=embed" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'); 160 $video_iframe.appendTo(video_wrap); 161 $(this).hide(); 162 }); 163 }); 164 165 vimeo.each(function() { 166 var video_wrap = $(this), 167 id = $(this).attr('data-embed'), 168 id = id.split('vimeo.com/video/')[1]; 169 170 $('<img class="vimeo-thumb" width="100%" src="" />').appendTo($(this)); 171 172 $.getJSON('https://www.vimeo.com/api/v2/video/' + id + '.json?callback=?', {format: "json"}, function(data) { 173 video_wrap.children(".vimeo-thumb").attr('src', data[0].thumbnail_large); 174 }); 175 176 $(this).on("click", "div.play-button", function (e) { 177 var $video_iframe = $('<iframe class="embed-responsive-item" src="//player.vimeo.com/video/' + id + '?autoplay=1&loop=1&autopause=0" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'); 178 $video_iframe.appendTo(video_wrap); 179 $(this).hide(); 180 }); 181 }); 182 } 183 // /Lazy Video Loading 184 185 // Contact form validator 186 $(function () { 187 $( '.contact-form' ).each( function() { 188 var contact_form_id = $(this).attr('id'), 189 contact_form = $('#' + contact_form_id + '.contact-form'); 190 191 contact_form.validator(); 192 193 contact_form.on('submit', function (e) { 194 if (!e.isDefaultPrevented()) { 195 196 $.ajax({
197 type: "POST", 198 url: ajaxurl, 199 data: $(this).serialize()+'&action=leven_contact_action', 200 success: function (data) 201 { 202 var result = JSON.parse(data); 203 var messageAlert = 'alert-' + result.type; 204 var messageText = result.message; 205 206 var alertBox = '<div class="alert ' + messageAlert + ' alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' + messageText + '</div>'; 207 if (messageAlert && messageText) { 208 contact_form.find('.messages').html(alertBox); 209 if (messageAlert == "alert-success") { 210 $('.contact-form')[0].reset(); 211 } 212 } 213 }, 214 }); 215 return false; 216 } 217 218 }); 219 }); 220 }); 221 // /Contact form validator 222 223 // Portfolio subpage filters 224 function portfolio_init() { 225 $( '.portfolio-content' ).each( function() { 226 var portfolio_grid_container = $(this), 227 portfolio_grid_container_id = $(this).attr('id'), 228 portfolio_grid = $('#' + portfolio_grid_container_id + ' .portfolio-grid'), 229 portfolio_filter = $('#' + portfolio_grid_container_id + ' .portfolio-filters'), 230 portfolio_filter_item = $('#' + portfolio_grid_container_id + ' .portfolio-filters .filter'); 231 232 if (portfolio_grid) { 233 234 portfolio_grid.shuffle({ 235 speed: 450, 236 itemSelector: 'figure' 237 }); 238 239 $('.site-auto-menu').on("click", "a", function (e) { 240 portfolio_grid.shuffle('update'); 241 }); 242 243 portfolio_filter.on("click", ".filter", function (e) { 244 portfolio_grid.shuffle('update'); 245 e.preventDefault(); 246 portfolio_filter_item.parent().removeClass('active'); 247 $(this).parent().addClass('active'); 248 portfolio_grid.shuffle('shuffle', $(this).attr('data-group') ); 249 }); 250 251 } 252 }) 253 } 254 // /Portfolio subpage filters 255 256 // Animate layout 257 function animateLayout() { 258 var windowWidth = $(window).width(), 259 animatedContainer = '', 260 blogSidebar = $(".blog-sidebar"), 261 animateType = $('#page_container').attr('data-animation') 262 263 if (windowWidth > 991) { 264 animatedContainer = $(".page-container"); 265 } else { 266 animatedContainer = $(".site-main"); 267 } 268 269 animatedContainer.addClass("animated " + animateType); 270 $('.page-scroll').addClass('add-prespective'); 271 animatedContainer.addClass('transform3d'); 272 setTimeout(function() { 273 blogSidebar.removeClass("hidden-sidebar"); 274 $('.page-scroll').removeClass('add-prespective'); 275 animatedContainer.removeClass('transform3d'); 276 }, 1000); 277 } 278 // /Animate layout 279 280 function scrollTop() { 281 if ($(body).scrollTop() > 150) { 282 $('.lmpixels-scroll-to-top').removeClass('hidden-btn'); 283 } else { 284 $('.lmpixels-scroll-to-top').addClass('hidden-btn'); 285 } 286 } 287 288 //On Window load & Resize 289 $(window) 290 .on('load', function() { //Load 291 // Animation on Page Loading 292 $(".preloader").fadeOut( 800, "linear" ); 293 animateLayout(); 294 }); 295 296 297 // On Document Load 298 $(document).on('ready', function() { 299 var movementStrength = 15; 300 var height = movementStrength / $(document).height(); 301 var width = movementStrength / $(document).width(); 302 $("body").on('mousemove', function(e){
303 var pageX = e.pageX - ($(document).width() / 2), 304 pageY = e.pageY - ($(document).height() / 2), 305 newvalueX = width * pageX * -1, 306 newvalueY = height * pageY * -1; 307 if ($('.page-container').hasClass('bg-move-effect')) { 308 var elements = $('.home-photo .hp-inner:not(.without-move), .lm-animated-bg'); 309 } else { 310 var elements = $('.home-photo .hp-inner:not(.without-move)'); 311 } 312 elements.addClass('transition'); 313 elements.css({ 314 "background-position": "calc( 50% + " + newvalueX + "px ) calc( 50% + " + newvalueY + "px )", 315 }); 316 317 setTimeout(function() { 318 elements.removeClass('transition'); 319 }, 300); 320 }) 321 .scroll(function () { 322 scrollTop(); 323 }); 324 325 // Initialize Portfolio grid 326 var $portfolio_container = $(".portfolio-grid"), 327 $gallery_container = $("#portfolio-gallery-grid"); 328 329 $gallery_container.imagesLoaded(function () { 330 $gallery_container.masonry(); 331 }); 332 333 $portfolio_container.imagesLoaded(function () { 334 portfolio_init(this); 335 }); 336 337 imageCarousel(); 338 339 contentSlider(); 340 341 // Blog grid init 342 var $container = $(".blog-masonry"); 343 $container.imagesLoaded(function () { 344 $container.masonry({ 345 itemSelector: '.item', 346 resize: false 347 }); 348 }); 349 350 // Mobile menu 351 $('.menu-toggle').on("click", function () { 352 $('.site-nav').addClass('animate'); 353 $('.site-nav').toggleClass('mobile-menu-hide'); 354 }); 355 356 // Text rotation 357 setTimeout(function() { 358 $('.text-rotation').owlCarousel({ 359 loop: true, 360 dots: false, 361 nav: false, 362 margin: 10, 363 items: 1, 364 autoplay: true, 365 autoplayHoverPause: false, 366 autoplayTimeout: 3800, 367 animateOut: 'fadeOut', 368 animateIn: 'fadeIn' 369 }); 370 }, 300); 371 372 // Lightbox init 373 body.magnificPopup({ 374 fixedContentPos: false, 375 delegate: 'a.lightbox', 376 type: 'image', 377 removalDelay: 300, 378 379 // Class that is added to popup wrapper and background 380 // make it unique to apply your CSS animations just to this exact popup 381 mainClass: 'mfp-fade', 382 image: { 383 // options for image content type 384 titleSrc: 'title', 385 gallery: { 386 enabled: true 387 }, 388 }, 389 390 iframe: { 391 markup: '<div class="mfp-iframe-scaler">'+ 392 '<div class="mfp-close"></div>'+ 393 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ 394 '<div class="mfp-title mfp-bottom-iframe-title"></div>'+ 395 '</div>', // HTML markup of popup, `mfp-close` will be replaced by the close button 396 397 patterns: { 398 youtube: { 399 index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index). 400 401 id: null, // String that splits URL in a two parts, second part should be %id% 402 // Or null - full URL will be returned 403 // Or a function that should return %id%, for example: 404 // id: function(url) { return 'parsed id'; } 405 406 src: '%id%?autoplay=1' // URL that will be set as a source for iframe. 407 }, 408 vimeo: { 409 index: 'vimeo.com/', 410 id: '/', 411 src: '//player.vimeo.com/video/%id%?autoplay=1' 412 }, 413 gmaps: { 414 index: '//maps.google.', 415 src: '%id%&output=embed' 416 } 417 }, 418 419 srcAction: 'iframe_src', // Templating object key. First part defines CSS selector, second attribute. "iframe_src" means: find "iframe" and set attribute "src". 420 }, 421 422 callbacks: { 423 markupParse: function(template, values, item) { 424 values.title = item.el.attr('title'); 425 } 426 }, 427 }); 428 429 $('.ajax-page-load-link').magnificPopup({ 430 type: 'ajax', 431 removalDelay: 300, 432 mainClass: 'mfp-fade', 433 gallery: { 434 enabled: true 435 }, 436 }); 437
438 $('.portfolio-page-wrapper .portfolio-grid').each(function() { 439 $(this).magnificPopup({ 440 delegate: 'a.gallery-lightbox', 441 type: 'image', 442 gallery: { 443 enabled:true 444 } 445 }); 446 }); 447 448 $('.form-control').val(''); 449 450 $(".form-control").on("focusin", function(){ 451 $(this).parent('.form-group').addClass('form-group-focus'); 452 }); 453 454 $(".form-control").on("focusout", function(){ 455 if($(this).val().length === 0) { 456 $(this).parent('.form-group').removeClass('form-group-focus'); 457 } 458 }); 459 460 $('body').append('<div id="page-ajax-loaded" class="page-portfolio-loaded animated fadeInLeft" style="display: none"><div class="preloader-portfolio"><div class="preloader-animation"><div class="preloader-spinner"></div></div></div></div>'); 461 ajaxLoader(); 462 463 // Sidebar toggle 464 $('.sidebar-toggle').on("click", function () { 465 $('#blog-sidebar').toggleClass('open'); 466 $(this).toggleClass('open'); 467 }); 468 469 lazyVideo(); 470 471 $('.lmpixels-scroll-to-top').click(function () { 472 $('body,html').animate({ 473 scrollTop: 0 474 }, 400); 475 return false; 476 }); 477 478 scrollTop(); 479 480 481 }); 482 483})(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.