1window.isSearchBot = false; 2 3(function( $ ){ 4 $isMobile=false; 5 /* isWidthLimited = $(window).width() <= 1024; */ 6 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 7 $isMobile=true; 8 } 9 if(/Bot/i.test(navigator.userAgent)) { 10 window.isSearchBot = true; 11 } 12 window.isMobile=$isMobile; 13 14 if($isMobile == true){ 15 var correctHeight = function(){ 16 /* covers */ 17 var coverCarries = document.body.querySelectorAll('.t-cover__carrier'), 18 viewPortHeight = $(window).height(), 19 factor = 0; 20 for(var i= 0, l = coverCarries.length, cc , ccStyle, newHeight, parent, opacityLayer, textBox; i < l; i++){ 21 cc = coverCarries[i]; 22 ccStyle = cc.style; 23 if(ccStyle.height.indexOf('vh') > -1){ 24 factor = parseInt(ccStyle.height) / 100; 25 newHeight = viewPortHeight + 'px'; 26 parent = $(cc).parent('.t-cover'); 27 if(parent && (parent = parent[0])){ 28 opacityLayer = parent.querySelector('.t-cover__filter'); 29 textBox = parent.querySelector('.t-cover__wrapper'); 30 if (opacityLayer) { 31 opacityLayer.style.height = newHeight; 32 } 33 if(textBox) { 34 textBox.style.height = newHeight; 35 } 36 ccStyle.height = parent.style.height = newHeight; 37 } 38 } 39 } 40 /* others */ 41 var elCarries = document.body.querySelectorAll('[data-height-correct-vh]'), 42 viewPortHeight = $(window).height(), 43 factor = 0; 44 for(var i= 0, l = elCarries.length, cc , ccStyle, newHeight, parent, opacityLayer, textBox; i < l; i++){ 45 cc = elCarries[i]; 46 ccStyle = cc.style; 47 if(ccStyle.height.indexOf('vh') > -1){ 48 factor = parseInt(ccStyle.height) / 100; 49 newHeight = viewPortHeight + 'px'; 50 parent = $(cc).parent('.t-cover'); 51 ccStyle.height = newHeight; 52 } 53 } 54 }; 55 $(document).ready(function(){ 56 correctHeight(); 57 }); 58 $(window).load(function(){ 59 correctHeight(); 60 }); 61 } 62 63 if($isMobile == true){ 64 if($(window).width() < 480){ 65 $(document).ready(function(){ 66 $("div[data-customstyle=yes]").each(function(index) { 67 if($(this).css('font-size').replace('px','')>26){ 68 $(this).css('font-size',''); 69 $(this).css('line-height',''); 70 } 71 }); 72 $("[field]").find("span").each(function(index) { 73 if($(this).css('font-size').replace('px','')>26){ 74 $(this).css('font-size',''); 75 } 76 }); 77 }); 78 $(window).load(function(){ 79 var window_width=$(window).width(); 80 $(".r").each(function(){ 81 var el=$(this); 82 $(this).find("div").not("[data-auto-correct-mobile-width=false], .tn-elem, .tn-atom").each(function(){ 83 var r_div_width=parseInt($(this).outerWidth(true)); 84 if((r_div_width)>window_width){ 85 console.log('Block not optimized for mobile width. Block width:'+r_div_width+' Block id:'+el.attr('id')); 86 console.log($(this)); 87 el.css("overflow","auto"); 88 if((r_div_width-3)>window_width){ 89 el.css("word-break","break-all"); 90 } 91 } 92 }); 93 }); 94 }); 95 }else if($(window).width() < 900){ 96 $(document).ready(function(){ 97 $("div[data-customstyle=yes]").each(function(index) { 98 if($(this).css('font-size').replace('px','')>30){ 99 $(this).css('font-size',''); 100 $(this).css('line-height',''); 101 } 102 }); 103 $("[field]").find("span").each(function(index) { 104 if($(this).css('font-size').replace('px','')>30){ 105 $(this).css('font-size',''); 106 } 107 }); 108 }); 109 } 110 } 111 112})( jQuery ); 113 114 115(function($){ 116 /** 117 * @constructor 118 */ 119 function VideoLoadProcessor(){ 120 this.setScrollListener(); 121 } 122 123 VideoLoadProcessor.prototype.videoTags = []; 124 VideoLoadProcessor.prototype.defaultConfig = { 125 isNeedStop : false 126 }; 127 VideoLoadProcessor.prototype.videoConfigs = []; 128 /** 129 * @param {HTMLVideoElement} video 130 * @param {{}
130 | Undefined} config 131 */ 132 VideoLoadProcessor.prototype.registerNewVideo = function(video, config){ 133 if(!(video instanceof HTMLVideoElement)){ 134 throw new Error("Wrong tag passed into registerNewVideo"); 135 } 136 if(this.videoTags.indexOf(video) == -1){ 137 this.videoTags.push(video); 138 this.videoConfigs.push(typeof config == "undefined" ? this.defaultConfig : config); 139 this.scrollCb(); 140 return true; 141 } 142 return false; 143 } 144 /** 145 * @param {HTMLVideoElement} video 146 */ 147 VideoLoadProcessor.prototype.unergisterVideo = function(video){ 148 if(!(video instanceof HTMLVideoElement)){ 149 throw new Error("Wrong tag passed into unregisterNewVideo"); 150 } 151 var index; 152 if((index = this.videoTags.indexOf(video)) > -1){ 153 if(typeof video.remove == "function"){ 154 video.remove(); 155 }else{ 156 if(video.parentNode){ 157 video.parentNode.removeChild(video); 158 } 159 } 160 this.pauseVideo(video, this.videoConfigs[index]); 161 this.videoTags.splice(index, 1); 162 this.videoConfigs.splice(index, 1); 163 return true; 164 } 165 return false; 166 } 167 168 VideoLoadProcessor.prototype.pauseVideo = function(video, config){ 169 if(!config){ 170 throw new Error("Wrong config type!"); 171 } 172 video.pause(); 173 if(config.isNeedStop){ 174 video.load(); 175 } 176 } 177 178 VideoLoadProcessor.prototype.setScrollListener = function(){ 179 $(window).scroll(jQuery.proxy(this.scrollCb, this)); 180 } 181 182 VideoLoadProcessor.prototype.scrollCb = function(){ 183 var windowHeight = $(window).height(), 184 _shift = 0, 185 _v = null; 186 for(var i= 0, l = this.videoTags.length; i < l; i++){ 187 _v = this.videoTags[i], _vrect = this.getVideoBoundingRect
187(_v, false); 188 /* set fade volume */ 189 if(Math.abs(_vrect.top) < windowHeight && Math.abs(_vrect.top) > windowHeight/2){ 190 var vol = 1 - (Math.abs(_vrect.top)-windowHeight/2)/(windowHeight/2) - 0.2; 191 if(vol>0 && vol<=1 && _v.volume!=0) { _v.volume=vol; } 192 } 193 /* then pause */ 194 if(Math.abs(_vrect.top) > windowHeight || _vrect.height == 0 /*display : none*/){ 195 this.pauseVideo(_v, this.videoConfigs[i]); 196 continue; 197 } 198 if(_v.paused){ 199 _v.play(); 200 } 201 } 202 }; 203 204 VideoLoadProcessor.prototype.getVideoObject = function(video){ 205 for(var i= 0, l = this.videoTags.length; i > l; i++){ 206 var vo = this.videoTags[i]; 207 if(vo.v === video) { 208 return vo; 209 } 210 } 211 return null; 212 } 213 214 VideoLoadProcessor.prototype.getVideoBoundingRect = function(video, isNeedParent){ 215 if(typeof isNeedParent == "undefined"){ 216 isNeedParent = true; 217 } 218 var parent = null; 219 if(isNeedParent){ 220 parent = $(video).parents('.r')[0]; 221 if(!parent){ 222 parent = video; 223 } 224 }else{ 225 parent = video; 226 } 227 return parent.getBoundingClientRect(); 228 } 229 window.videoLoadProcessor = new VideoLoadProcessor(); 230 231})( jQuery ); 232 233 234(function($){ 235 236 function SequenceController(){ 237 this.setScrollCb(); 238 this.itemHeight = screen.availHeight;/* document.documentElement.clientHeight || window.innerHeight || screen.availHeight;*/ 239 var itemTransitionItemRelation = 0.25; 240 this.itemTransitionTop = this.itemHeight * itemTransitionItemRelation; 241 this.activeItemIndex = null; 242 this.windowHeight = document.documentElement.clientHeight || window.innerHeight || screen.availHeight; 243 this.topOffsetShift = -150; 244 $(window).resize(jQuery.proxy(this.recalculateAllSequencesOffsets,this)); 245 this._resizeInterval = setInterval(jQuery.proxy(this.scrollCb,this),500); 246 } 247 248 SequenceController.prototype.defaultConfig = { 249 orientation : "vertical", 250 speedFactor : 1, 251 automated : false 252 }; 253 254 SequenceController.prototype.sequenceObjects = []; 255 /** 256 * @param {{}} sO 257 */ 258 259 SequenceController.prototype.recalculateAllSequencesOffsets = function(){ 260 if(this._resizeTimeout) { 261 clearTimeout(this._resizeTimeout); 262 } 263 264 if(this._resizeInterval){ 265 clearInterval(this._resizeInterval); 266 } 267 268 this._resizeTimeout = setTimeout(jQuery.proxy(function(){ 269 this.scrollCb(); 270 this._resizeInterval = setInterval(jQuery.proxy(this.scrollCb,this),500); 271 },this),10); 272 } 273 274 SequenceController.prototype.registerNewBlock = function(node){ 275 if(!(node instanceof HTMLElement)){ 276 throw new Error("Wrong node type in registerNewBlock"); 277 } 278 for(var i= 0, l = this.sequenceObjects.length; i < l; i++){ 279 if(this.sequenceObjects[i].sequenceBlock === node) { 280 return false; 281 } 282 } 283 var sequenceHolder = node.querySelector('[data-hook="sequence-holder"]'), 284 sequenceHeight = 0, 285 sequenceOffsetTop = this.getAbsoluteTopOffset(sequenceHolder), 286 items = (function(){ 287 var _items = Array.prototype.slice.call(node.querySelectorAll('[data-hook="sequence-item"]'), 0), __items = []; 288 _items.forEach(jQuery.proxy(function(el, i, array){ 289 var elHeight = this.getItemHeight(el), 290 backgroundHolder = el.querySelector('[data-hook="item-background"]'); 291 el.style.height = elHeight + 'px'; 292 backgroundHolder.style.height = this.itemHeight + 'px'; 293 if(i<array.length-1) { 294 sequenceHeight+=elHeight; 295 } 296 __items.push({ 297 node : el, 298 height : elHeight, 299 topOffset : this.getAbsoluteTopOffset(el.querySelector('.txt-holder')) - (i == array.length - 1 ? 0 : this.topOffsetShift), 300 backgroundHolder : backgroundHolder 301 }); 302 }, this)); 303 return __items; 304 }).call(this), 305 h = this.itemHeight, 306 sequenceObject = { 307 sequenceBlock : node, 308 sequenceHolder: sequenceHolder, 309 sequenceHolderTopOffset : sequenceOffsetTop, 310 sequenceHeight : sequenceHeight, 311 items : items, 312 started: false,
313 prevBackgroundColor : '' 314 }; 315 this.sequenceObjects.push(sequenceObject); 316 317 this.scrollCb(); 318 return true; 319 } 320 321 SequenceController.prototype.getItemHeight = function (el){ 322 var txtBlock = el.querySelector("[data-hook='item-text']"), 323 backgroundHolder = el.querySelector("[data-hook='item-background']"); 324 st = el.style; 325 var computedTop = parseFloat(getComputedStyle(txtBlock).top); 326 txtBlock.style.top = computedTop + 'px'; 327 var totalHeight = Math.max(txtBlock.clientHeight + computedTop, this.itemHeight); 328 return totalHeight; 329 } 330 331 SequenceController.prototype.fixTextBlocksPosition = function(node){ 332 txtBlocks = Array.prototype.slice.call(node.querySelectorAll('[data-hook="item-text"]'), 0); 333 txtBlocks.forEach(function(el, i , array){ 334 var backgroundSibling = el.parentNode.querySelector("[data-hook='item-background']"); 335 backgroundSibling.style.top = '-' + el.clientHeight + 'px'; 336 }); 337 } 338 339 SequenceController.prototype.unergisterBlock = function(node){ 340 for(var i= 0, l = this.sequenceObjects.length, index = null; i < l; i++){ 341 if(this.sequenceObjects[i].sequenceBlock === node){ 342 index = i; 343 break; 344 } 345 } 346 if(index !== null){ 347 this.sequenceObjects.splice(index, 1); 348 return true; 349 } 350 return false; 351 } 352 /** 353 * @param {HTMLElement} el 354 * @returns {Number|number} 355 */ 356 SequenceController.prototype.getAbsoluteTopOffset = function(el){ 357 var topOffset = el.offsetTop; 358 el = el.offsetParent; 359 while(el != null){ 360 topOffset+= el.offsetTop; 361 el = el.offsetParent; 362 } 363 return topOffset; 364 } 365 /** 366 * @param {Boolean} direction 367 * 1 - from top to bottom 368 * 0 - from bottom to top 369 */ 370 SequenceController.prototype.processSequence = function(sequenceObject){ 371 if(sequenceObject.started == false){ 372 sequenceObject.prevBackgroundColor = document.body.style.backgroundColor; 373 document.body.style.backgroundColor = 'rgb(0, 0, 0)'; 374 sequenceObject.started = true; 375 } 376 var sequenceBlock = sequenceObject.sequenceBlock, 377 sequenceHolder = sequenceObject.sequenceHolder, 378 sequenceItems = sequenceObject.items, 379 currentItemIndex = null, 380 node, backgroundHolder, backgroundHolderStyle, textBlock, opacity; 381 for(var i= 0, l = sequenceItems.length, nodeRect, txtBlockRect; i < l; i++){ 382 node = sequenceItems[i].node, 383 txtBlockRect = node.querySelector('.txt-holder') 384 nodeRect = node.getBoundingClientRect(); 385 if(nodeRect.top < this.itemTransitionTop && (nodeRect.bottom < nodeRect.height + this.itemTransitionTop) && nodeRect.bottom > this.itemTransitionTop){ 386 currentItemIndex = i; 387 break; 388 } 389 } 390 if(currentItemIndex == null){ 391 return; 392 } 393 opacity = nodeRect.top / this.itemTransitionTop; 394 if(opacity > 1){ 395 opacity = 1; 396 }else{ 397 if(opacity < 0){ 398 opacity = 0; 399 } 400 } 401 for(var i= 0, l = sequenceItems.length; i < l; i++){ 402 node = sequenceItems[i].node, 403 backgroundHolderStyle = sequenceItems[i].backgroundHolder.style; 404 if(backgroundHolderStyle.position != "fixed"){ 405 backgroundHolderStyle.position = "fixed"; 406 } 407 if(i == currentItemIndex){ /* transitted already */ 408 backgroundHolderStyle.opacity = 1 - opacity; 409 node.querySelector('.txt-holder').style.opacity = 1 - opacity; 410 } else { 411 if(i == currentItemIndex - 1){ 412 backgroundHolderStyle.opacity = opacity; 413 node.querySelector('.txt-holder').style.opacity = opacity; 414 }else{ 415 backgroundHolderStyle.opacity = 0; 416 node.querySelector('.txt-holder').style.opacity = 0; 417 } 418 } 419 } 420 } 421 422 SequenceController.prototype.stopSequence = function(sequenceObject){ 423 if(sequenceObject.started == false){ 424 return; 425 }
426 sequenceObject.items.forEach(function(el, i, array){ 427 el.backgroundHolder.style.position = 'relative'; 428 el.backgroundHolder.style.display = 'block'; 429 el.backgroundHolder.style.opacity = 1; 430 }); 431 document.body.style.backgroundColor = sequenceObject.prevBackgroundColor; 432 sequenceObject.started = false; 433 } 434 435 SequenceController.prototype.scrollCb = function(){ 436 var scrollTop = $(window).scrollTop(); 437 for(var i= 0, l = this.sequenceObjects.length, sO, top; i < l; i++){ 438 sO = this.sequenceObjects[i]; 439 var boundingRect = sO.sequenceHolder.getBoundingClientRect(); 440 if(boundingRect.top < 0 && boundingRect.bottom > 0 && boundingRect.bottom > boundingRect.height - sO.sequenceHeight - 100){ 441 this.processSequence(sO); 442 }else{ 443 this.stopSequence(sO); 444 } 445 } 446 } 447 448 SequenceController.prototype.setScrollCb = function(){ 449 this._scrollCb = jQuery.proxy(this.scrollCb, this);/*.bind(this);*/ 450 451 $(window).scroll(this._scrollCb); 452 } 453 454 window.sequenceController = new SequenceController(); 455 456 window.processVideo = function(v){ 457 mp4Src = $(v).attr('data-content-video-url-mp4'); 458 webmSrc = $(v).attr('data-content-video-url-webm'); 459 $(v).css("background-color", "transparent"); 460 $(v).css("background-image", ""); 461 var options = { 462 mp4: mp4Src, 463 webm: webmSrc, 464 /*poster: "",*/ 465 preload: "none", 466 autoplay : false, 467 loop: true, 468 scale:true, 469 zIndex:0, 470 width: "100%" 471 }; 472 /* Initializing the videos*/ 473 vid = $(v).videoBG(options);
474 videoLoadProcessor.registerNewVideo(vid, { 475 isNeedStop : false 476 }); 477 } 478 479 480 window.cover_init = function(id){ 481 482 $(document).ready(function(){ 483 var cover_carrier = document.body.querySelector('#coverCarry' + id); 484 var el = $(cover_carrier); 485 486 var backgroundurl=el.attr('data-content-cover-bg'); 487 var height=el.attr('data-content-cover-height'); 488 var parallax=el.attr('data-content-cover-parallax'); 489 var videomp4=el.attr('data-content-video-url-mp4'); 490 var videowebm=el.attr('data-content-video-url-webm'); 491 var youtubeid=el.attr('data-content-video-url-youtube'); 492 var noloop=el.attr('data-content-video-noloop'); 493 var nomute=el.attr('data-content-video-nomute'); 494 var bgbase64=el.attr('data-content-bg-base64'); 495 var video_nocover=el.attr('data-content-video-nocover'); 496 497 if(!backgroundurl){ backgroundurl="" }; 498 if(!height) { height=""; } 499 if(!parallax) { parallax=""; } 500 if(!videomp4) { videomp4=""; } 501 if(!videowebm) { videowebm=""; } 502 if(!youtubeid) { youtubeid=""; } 503 if(!noloop) { noloop=""; } 504 if(!nomute) { nomute=""; } 505 if(!youtubeid){ youtubeid=""; } 506 if(!bgbase64){ bgbase64=""; } 507 508 if(video_nocover && video_nocover=='yes') { 509 videomp4=""; 510 videowebm=""; 511 youtubeid=""; 512 } 513 514 if($isMobile && (videowebm!="" || videomp4!="" || youtubeid!="")){ 515 el.css('background-image', "url('" + backgroundurl + "')"); 516 } 517 518 /*fix content height*/ 519 var hcover=$("#rec" + id).find(".t-cover").height(); 520 var hcontent=$("#rec" + id).find("div[data-hook-content]").height(); 521 if(hcontent>300 && hcover<hcontent){ 522 var hcontent=hcontent+100; 523 $("#rec" + id).find(".t-cover").height(hcontent); 524 $("#rec" + id).find(".t-cover__filter").height(hcontent); 525 $("#rec" + id).find(".t-cover__carrier").height(hcontent); 526 $("#rec" + id).find(".t-cover__wrapper").height(hcontent); 527 } 528 529 /* if set video*/ 530 if (videomp4!=="" || videowebm!=="" || youtubeid!==""){ 531 if($isMobile==false){ 532 /* Initializing the videos */ 533 if (youtubeid == "" && (videomp4 != "" || videowebm != "")) 534 { 535 el.css("background-color", "#000000"); 536 el.css("background-image", "url('https://tilda.ws/img/spinner-white.gif')"); 537 el.css("background-size", "auto"); 538 if(noloop!=""){var loop=false;}else{var loop=true;} 539 if(nomute!=""){var volume=1;}else{var volume='';} 540 541 var height_more_vh=""; 542 if(parallax=="fixed"){ 543 if(height.indexOf('vh') > -1){ 544 if( parseInt(height) > 100 ){ 545 el.css("height","100vh"); 546 height_more_vh="yes"; 547 } 548 } 549 if(height.indexOf('px') > -1){ 550 if( parseInt(height) > $(window).height() ){ 551 el.css("height","100vh"); 552 height_more_vh="yes"; 553 } 554 } 555 } 556 557 var cotimer; 558 var flagprocessed=""; 559 var wnd=$(window); 560 var prnt=el.parent(); 561 562 wnd.scroll(function() { 563 if(cotimer) { 564 window.clearTimeout(cotimer); 565 } 566 567 cotimer = window.setTimeout(function() { 568 if(!(flagprocessed>0)){ 569 var a,b,c,d,s; 570 571 a = el.offset().top; 572 b = el.height(); 573 574 c = wnd.scrollTop(); 575 d = wnd.height(); 576 577 if(((c+d) > a-500) && (c <= (a+b+500))){ 578 var vid = el.videoBG({ 579 mp4: videomp4, 580 webm: videowebm, 581 poster: '', 582 preload: 'none', 583 autoplay : false, 584 loop: loop, 585 volume:volume, 586 scale:true, 587 zIndex:0, 588 width: "100%" 589 });
590 videoLoadProcessor.registerNewVideo(vid); 591 flagprocessed=1; 592 } 593 } 594 }, 100); 595 596 if(parallax=="fixed" && height_more_vh=="yes"){ 597 var aa,bb,cc,dd,ss; 598 599 aa = prnt.offset().top; 600 bb = prnt.height(); 601 602 cc = wnd.scrollTop(); 603 dd = wnd.height(); 604 605 if(cc>=aa+bb-dd){ 606 el.css("position","absolute"); 607 el.css("bottom","0px"); 608 el.css("top","auto"); 609 /*el.css("vertical-align","bottom");*/ 610 } else { 611 if(cc>=aa){ 612 el.css("position","fixed"); 613 el.css("top","0px"); 614 } else { 615 if(cc<aa){ 616 el.css("position","relative"); 617 el.css("top","auto"); 618 } 619 } 620 } 621 } 622 623 }); 624 625 wnd.scroll(); 626 627 /* Initializing youtube video*/ 628 }else{ 629 if (youtubeid != ""){ 630 el.css("background-color", "#000000"); 631 el.css("background-image", ""); 632 var cotimer; 633 var flagprocessed=0; 634 var wnd=$(window); 635 636 wnd.scroll(function() { 637 if(cotimer) { 638 window.clearTimeout(cotimer); 639 } 640 641 cotimer = window.setTimeout(function() { 642 flagprocessed=el.find("iframe").length; 643 if(!(flagprocessed>0)){ 644 var a,b,c,d,s; 645 646 a = el.offset().top; 647 b = el.height(); 648 649 c = wnd.scrollTop(); 650 d = wnd.height(); 651 652 if(((c+d) > a-500) && (c <= (a+b+500))){ 653 processYoutubeVideo(cover_carrier, height); 654 /*flagprocessed=1;*/ 655 } 656 } 657 }, 100); 658 }); 659 660 wnd.scroll(); 661 662 } 663 } 664 } 665 } 666 667 if (parallax=="dynamic"){ 668 if($isMobile == false)el.parallax("50%",0.2,true); 669 } 670 671 if (bgbase64=="yes" && backgroundurl!="" && videomp4=="" && videowebm=="" && youtubeid==""){ 672 var bg_already=""; 673 $('<img/>').attr('src', backgroundurl).load(function() { 674 $(this).remove(); 675 el.css('background-image', "url('"+backgroundurl+"')"); 676 el.css("opacity","1"); 677 var bg_already="yes"; 678 }); 679 if(bg_already!="yes"){ 680 el.css('background-image',''); 681 el.css("opacity","0"); 682 el.css("transition","opacity 25ms"); 683 } 684 } 685 686 var coverarrow=$("#rec" + id).find(".t-cover__arrow-wrapper"); 687 if(coverarrow.length>0){ 688 coverarrow.click(function() { 689 /*var nextrec = $("#rec" + id).next();*/ 690 /*if(nextrec.length>0)$('html, body').animate({scrollTop:nextrec.offset().top}, 500);*/ 691 var recheight = $("#rec" + id).height(); 692 if(recheight>0){ $('html, body').animate({scrollTop:$("#rec" + id).offset().top + recheight}, 500); } 693 }); 694 } 695 696 }); 697 698 } 699 700 $(document).ready(function(){ 701 $(".t-cover__carrier").each(function() { 702 var id=$(this).attr('data-content-cover-id'); 703 if(id>0) { cover_init(id); } 704 }); 705 }); 706 707 function processSrc(src,nocover){ 708 if(src.indexOf('https://www.youtube.com/embed') == -1){ 709 src = "https://www.youtube.com/embed" + (src[0] == '/' ? src : '/' + src); 710 } 711 var extractVideoId = function(src){ 712 var parts = src.split('/'), neededPart = null; 713 for(var i=0, l = parts.length; i < l; i++){ 714 if(parts[i] == "embed"){ 715 neededPart = parts[i+1]; 716 } 717 } 718 return neededPart; 719 } 720 var currentLocation = location.protocol+'//'+location.host; 721 722 if(nocover!="yes"){ 723 src = (src[src.length-1] == '/' ? src : src) + '?autoplay=1&loop=1&enablejsapi=1&&playerapiid=featuredytplayer&controls=0&modestbranding=1&rel=0&showinfo=0&color=white&iv_load_policy=3&theme=light&wmode=transparent&origin='+currentLocation+'&playlist='+extractVideoId(src); 724 }else{ 725 src = (src[src.length-1] == '/' ? src : src) + '?autoplay=0&loop=0&enablejsapi=1&&playerapiid=featuredytplayer&controls=1&modestbranding=1&rel=0&showinfo=0&color=black&iv_load_policy=3&theme=dark&wmode=transparent&origin='+currentLocation; 726 } 727 return src; 728 } 729 730 function onYouTubePlayerReady_do(div,player,nomute){ 731 var timer; 732 var wnd = $(window); 733 var frame = $(div); 734 var timer_count=0; 735 736 wnd.scroll(function() { 737 if(timer) { 738 window.clearTimeout(timer); 739 if(timer_count>=15){ 740 timer_player_do(frame,wnd,player,nomute); 741 timer_count=0; 742 } 743 timer_count++; 744 } 745 746 timer = window.setTimeout(function() { 747 timer_player_do(frame,wnd,player,nomute); 748 timer_count=0; 749 }, 100); 750 }); 751 752 wnd.scroll(); 753 } 754 755 function timer_player_do(frame,wnd,player,nomute){ 756 var a,b,c,d,s; 757 758 a = frame.offset().top; 759 b = frame.height(); 760 761 c = wnd.scrollTop(); 762 d = wnd.height(); 763 764 s = player.getPlayerState(); 765 766 if(((c+d) > a) && (c <= (a+b))){ 767 if(s !== 1) { player.playVideo(); } 768 if(nomute=="yes"){ 769 if(c>a+b-100){ 770 player.setVolume(30); 771 }else{ 772 if(c>a+b-200){ 773 player.setVolume(70); 774 }else{ 775 if(c+d<a+200){ 776 player.setVolume(30); 777 }else{ 778 player.setVolume(100); 779 } 780 } 781 } 782 }else{ 783 console.log("no"); 784 } 785 }else{ 786 if((c+d) < a && (c+d) > (a-500)){ 787 if(s !== 2){ 788 player.playVideo(); 789 player.pauseVideo(); 790 } 791 }else{ 792 if(c > (a+b) && c < (a+b+500)){ 793 if(s !== 2){ 794 player.pauseVideo(); 795 } 796 }else{ 797 if(s !== 2){ 798 player.pauseVideo(); 799 } 800 } 801 } 802 } 803 } 804 805 var def = $.Deferred(); 806 807 window.processYoutubeVideo = function(div, height){ 808 var defFunc = function(){ 809 810 console.log("youtube iframe processed"); 811 var src = $(div).attr('data-content-video-url-youtube'); 812 var nomute = $(div).attr('data-content-video-nomute'); 813 var noloop = $(div).attr('data-content-video-noloop'); 814 var nocover = $(div).attr('data-content-video-nocover'); 815 816 var iframe = document.createElement('iframe'); 817 iframe.src = processSrc(src,nocover); 818 iframe.frameBorder = 0; 819 820 if(nocover!="yes"){ 821 if(!height){ 822 height = "100vh"; 823 } 824 if(height.indexOf('vh') > -1){ 825 var wh = window.innerHeight; 826 if(!wh) { 827 wh = $(window).height(); 828 } 829 var div_height = Math.floor((wh * (parseInt(height) / 100))); 830 }else{ 831 var div_height = parseInt(height); 832 } 833 var div_width = Math.floor (parseInt(window.innerWidth)); 834 if(!div_width) { 835 div_width = $(window).width(); 836 } 837 var video_width = div_width; 838 var video_height = video_width * 0.5625; 839 840 841 var vw2 = video_width; 842 var vh2 = video_height + 110 + 110; 843 var delta_coef=1; 844 845 if((video_height-220) < div_height){ 846 if(video_height<div_height){ 847 var delta_coef = ( div_height / video_height ) + 0.02; 848 }else{ 849 var delta_coef = (video_height / div_height ) + 0.02; 850 } 851 } 852 853 var zoom_video_width = Math.floor( vw2 * delta_coef ); 854 var zoom_video_height = Math.floor( vh2 * delta_coef ); 855 856 var heightDelta = zoom_video_height - div_height; 857 var widthDelta = zoom_video_width - div_width; 858 859 /*if (iframe.height) {*/ 860 iframe.height = zoom_video_height + 'px'; 861 iframe.width = zoom_video_width + 'px'; 862 /*} else {
863 // iframe.style.height = zoom_video_height + 'px'; 864 // iframe.style.width = zoom_video_width + 'px'; 865 //}*/ 866 867 if(heightDelta > 0){ 868 iframe.style.marginTop = - Math.floor(heightDelta / 2 ) + 'px'; 869 } 870 if(widthDelta > 0){ 871 iframe.style.marginLeft = - Math.floor(widthDelta / 2) + 'px'; 872 } 873 }else{ 874 var video_height; 875 if(!height){ 876 video_height = Math.floor ( $(div).width() * 0.5625 ); 877 } 878 if(height && height.indexOf('vh') > -1){ 879 video_height = Math.floor((window.innerHeight * (parseInt(height) / 100))); 880 }else{ 881 if(height){ 882 video_height = parseInt(height); 883 } 884 } 885 886 iframe.width="100%"; 887 iframe.height=video_height + 'px'; 888 } 889 890 var playtimer; 891 div.appendChild(iframe); 892 if($isMobile == false){ 893 var player = new YT.Player(iframe,{ 894 events:{ 895 'onReady': function(e){ 896 onYouTubePlayerReady_do(div,e.target,nomute); 897 if(e.target.setVolume && nomute!="yes"){ 898 e.target.setVolume(0); 899 } 900 e.target.setLoop(true); 901 }, 902 'onStateChange': function(e){ 903 if(e.target.setVolume && nomute!="yes"){ 904 e.target.setVolume(0); 905 } 906 907 if(e.data === -1){ 908 var sp=window.fix_scrolltop_beforestop_youtube; 909 if(sp>=0){ 910 $('html, body').scrollTop(sp); 911 delete window.fix_scrolltop_beforestop_youtube; 912 } 913 } 914 if(e.data === YT.PlayerState.PLAYING){ 915 playtimer = window.setInterval(function() { 916 var a=e.target.getCurrentTime(); 917 var b=e.target.getDuration(); 918 if(a+1>b && b!==0){ 919 e.target.seekTo(0); 920 if(noloop==="yes"){ 921 e.target.stopVideo(); 922 e.target.clearVideo(); 923 } 924 } 925 }, 1000); 926 }else{ 927 window.clearTimeout(playtimer); 928 } 929 } 930 } 931 }); 932 } 933 } 934 def.then(defFunc); 935 } 936 937 /*$(document).ready(function(){*/ 938 var tag = document.createElement('script'); 939 940 tag.src = "https://www.youtube.com/iframe_api"; 941 var firstScriptTag = document.getElementsByTagName('script')[0]; 942 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 943 /*});*/ 944 945 window.onYouTubeIframeAPIReady = function(){ 946 def.resolve(); 947 } 948 949})( jQuery ); 950 951 952(function($){ 953 /** 954 * Global object that implements the event model. 955     * The essence of it is that he is one and is global, it all podpisyvayutsya 956     * Amity and ask him the same way 957     * (Instead of each object was emitterom = /) 958     *constructor 959     *version 0.0.1 960 */ 961 function Observer(){ 962 this.callbacks = {}; 963 } 964 965 Observer.prototype.defaultConfig = { 966 single : false, 967 context : null 968 }; 969 970 Observer.prototype.addEventListener = function(name, callback, config){ 971 evtCallbacks = this._getEventCallbacks(name); 972 if(!evtCallbacks){ 973 evtCallbacks = this.callbacks[name] = []; 974 } 975 976 evtCallbacks.push({ 977 callback : callback, 978 config : (typeof config == "object" ? config : this.defaultConfig) 979 }); 980 } 981 982 Observer.prototype._getEventCallbacks = function(name){ 983 return this.callbacks[name]; 984 } 985 986 Observer.prototype.removeEventListener = function(name, callback){ 987 var cbs = this._getEventCallbacks(name); 988 if(!cbs){ 989 return false; 990 } 991 992 for(var i= 0, l = cbs.length, cbObj; i < l; i++){ 993 cbObj = cbs[i]; 994 if(callback === cbObj.callback){ 995 cbs.splice(i,1); 996 return true; 997 } 998 } 999 return false;
1000 } 1001 1002 Observer.prototype.emitEvent = function(name, data){ 1003 var cbs = []; 1004 extend(cbs,this._getEventCallbacks(name)); 1005 for(var i= 0, l = cbs.length, cbObj, cb, config; i < l; i++){ 1006 cbObj = cbs[i]; 1007 cb = cbObj.callback; 1008 config = cbObj.config; 1009 if(config.context){ 1010 cb.call(config.context, data); 1011 }else{ 1012 cb(data); 1013 } 1014 1015 if(config.single){ 1016 this.removeEventListener(name, cb); 1017 } 1018 } 1019 } 1020 1021 window.observer = new Observer(); 1022 1023})( jQuery ); 1024 1025 1026(function($){ 1027 $(document).ready(function(){ 1028 if($isMobile == false && $('#allrecords').attr('data-blocks-animationoff')!=='yes' && window.isSearchBot==false ){ 1029 $(".r").each(function(i) { 1030 if($(this).attr('style') && $(this).attr('style').indexOf('background-color') !== -1){ 1031 $(this).attr('data-animationappear','off'); 1032 } 1033 }); 1034 /*add animation*/ 1035 var tiles = $(".r").not('[data-animationappear=off], [data-screen-min], [data-screen-max]'), 1036 wnd = $(window); 1037 tiles.each(function(i) { 1038 a = $(this).offset().top; 1039 b = wnd.scrollTop() + wnd.height() + 300 ; 1040 if (a > 1000 && a > b ){ $(this).fadeTo(0,0); } 1041 }); 1042 function blocksfade(){ 1043 if(tiles.length){ 1044 for(var i = tiles.length - 1, tile, a, b; i >= 0; i--){ 1045 tile = $(tiles[i]); 1046 a = tile.offset().top; 1047 b = wnd.scrollTop() + wnd.height() - 100; 1048 if(a < b){ 1049 tile.fadeTo(500, 1, function() {}); 1050 tiles.splice(i, 1); 1051 } 1052 } 1053 }else{ 1054 wnd.unbind('scroll', blocksfade); 1055 } 1056 } 1057 wnd.scroll(blocksfade); 1058 blocksfade(); 1059 } 1060 if($("body").height() < $(window).height()-100){ $(".t-tildalabel").css("display","none"); } 1061 }); 1062})( jQuery ); 1063 1064 1065(function($){ 1066 function blocksdisplay(){ 1067 var window_width = $(window).width(); 1068 var recs = $('div.r[data-screen-max], div.r[data-screen-min]'); 1069 var max,min; 1070 var disp; 1071 recs.each(function(i) { 1072 disp = $(this).css("display"); 1073 max = $(this).attr("data-screen-max"); 1074 if( max === undefined) { max=10000; } 1075 max = parseInt(max); 1076 1077 min = $(this).attr("data-screen-min"); 1078 if( min === undefined) { min=0; } 1079 min = parseInt(min); 1080 console.log(min+"-"+max); 1081 if(min<=max){ 1082 if (window_width <= max && window_width > min) { 1083 if(disp!="block") { $(this).css("display","block"); } 1084 }else{ 1085 if(disp!="none"){ $(this).css("display","none"); } 1086 } 1087 } 1088 }); 1089 } 1090 1091 $(document).ready(function(){ 1092 blocksdisplay(); 1093 }); 1094 1095 $(window).resize(function() { 1096 blocksdisplay(); 1097 }); 1098 1099})( jQuery ); 1100 1101 1102 1103/** 1104 * @VideoBG function preserve Copyright 2011 Syd Lawrence ( www.sydlawrence.com ). Version: 0.2 1105 * Licensed under MIT and GPLv2. 1106 */ 1107 1108(function( $ ){ 1109 1110 $.fn.videoBG = function( selector, options ) { 1111 1112 var options = {}; 1113 if (typeof selector == "object") { 1114 options = $.extend({}, $.fn.videoBG.defaults, selector); 1115 } else { 1116 if (!selector) { 1117 options = $.fn.videoBG.defaults; 1118 } else { 1119 return $(selector).videoBG(options); 1120 } 1121 } 1122 1123 var container = $(this); 1124 1125 /* check if elements available otherwise it will cause issues*/ 1126 if (!container.length) { 1127 return; 1128 } 1129 1130 /* container to be at least relative*/ 1131 if (container.css('position') == 'static' || !container.css('position')) { 1132 container.css('position','relative'); 1133 } 1134 1135 /* we need a width*/ 1136 if (options.width == 0) { 1137 options.width = container.width(); 1138 } 1139 1140 /* we need a height*/ 1141 if (options.height == 0) { 1142 options.height = container.height(); 1143 } 1144 1145 /* get the wrapper*/ 1146 var wrap = $.fn.videoBG.wrapper(); 1147 wrap.height(options.height) 1148 .width(options.width); 1149 1150 /* if is a text replacement*/ 1151 if (options.textReplacement) { 1152 1153 /* force sizes*/ 1154 options.scale = true; 1155 1156 /* set sizes and forcing text out*/ 1157 container.width(options.width) 1158 .height(options.height) 1159 .css('text-indent','-9999px'); 1160 } else { 1161 1162 /* set the wrapper above the video*/ 1163 wrap.css('z-index',options.zIndex+1); 1164 } 1165 1166 /* move the contents into the wrapper 1167 // commented by n.o 1168 //wrap.html(container.clone(true));*/ 1169 1170 /* get the video*/ 1171 var video = $.fn.videoBG.video(options); 1172 1173 /* if we are forcing width / height */ 1174 if (options.scale) { 1175 1176 /* overlay wrapper*/ 1177 wrap.height(options.height) 1178 .width(options.width); 1179 1180 /* video*/ 1181 video.height(options.height) 1182 .width(options.width); 1183 } 1184 1185 /* add it all to the container*/ 1186 container.html(wrap); 1187 container.append(video); 1188 1189 return video.find("video")[0]; 1190 } 1191 1192 /* set to fullscreen*/
1193 $.fn.videoBG.setFullscreen = function($el) { 1194 var windowWidth = $(window).width(), 1195 windowHeight = $(window).height(); 1196 1197 $el.css('min-height',0).css('min-width',0); 1198 $el.parent().width(windowWidth).height(windowHeight); 1199 /* if by width */ 1200 if (windowWidth / windowHeight > $el.aspectRatio) { 1201 $el.width(windowWidth).height('auto'); 1202 /* shift the element up*/ 1203 var height = $el.height(); 1204 var shift = (height - windowHeight) / 2; 1205 if (shift < 0){ shift = 0; } 1206 $el.css("top",-shift); 1207 } else { 1208 $el.width('auto').height(windowHeight); 1209 /* shift the element left*/ 1210 var width = $el.width(); 1211 var shift = (width - windowWidth) / 2; 1212 if (shift < 0){ shift = 0;} 1213 $el.css("left",-shift); 1214 1215 /* this is a hack mainly due to the iphone*/ 1216 if (shift === 0) { 1217 var t = setTimeout(function() { 1218 $.fn.videoBG.setFullscreen($el); 1219 },500); 1220 } 1221 } 1222 1223 $('body > .videoBG_wrapper').width(windowWidth).height(windowHeight); 1224 1225 } 1226 1227 /* get the formatted video element*/ 1228 $.fn.videoBG.video = function(options) { 1229 1230 /*commented by n.o*/ 1231 /*$('html, body').scrollTop(-1);*/ 1232 1233 /* video container*/ 1234 var $div = $('<div/>'); 1235 $div.addClass('videoBG') 1236 .css('position',options.position) 1237 .css('z-index',options.zIndex) 1238 .css('top',0) 1239 .css('left',0) 1240 .css('height',options.height) 1241 .css('width',options.width) 1242 .css('opacity',options.opacity) 1243 .css('overflow','hidden'); 1244 1245 /* video element*/ 1246 var $video = $('<video/>'); 1247 $video.css('position','absolute') 1248 .css('z-index',options.zIndex) 1249 .attr('poster',options.poster) 1250 .css('top',0) 1251 .css('left',0) 1252 .css('min-width','100%') 1253 .css('min-height','100%'); 1254 1255 if (options.autoplay) { 1256 $video.attr('autoplay',options.autoplay); 1257 } 1258 1259 if(options.volume>0){ 1260 $video.prop("volume", options.volume); 1261 }else{ 1262 $video.prop("volume", 0); 1263 } 1264 1265 /* if fullscreen*/ 1266 if (options.fullscreen) { 1267 $video.bind('canplay',function() { 1268 /* set the aspect ratio*/ 1269 $video.aspectRatio = $video.width() / $video.height(); 1270 $.fn.videoBG.setFullscreen($video); 1271 }) 1272 1273 /* listen out for screenresize*/ 1274 var resizeTimeout; 1275 $(window).resize(function() { 1276 clearTimeout(resizeTimeout); 1277 resizeTimeout = setTimeout(function() { 1278 $.fn.videoBG.setFullscreen($video); 1279 },100); 1280 }); 1281 $.fn.videoBG.setFullscreen($video); 1282 } 1283 1284 1285 /* video standard element*/ 1286 var v = $video[0]; 1287 1288 /* if meant to loop*/ 1289 if (options.loop) { 1290 loops_left = options.loop; 1291 1292 /* cant use the loop attribute as firefox doesnt support it*/ 1293 $video.bind('ended', function(){ 1294 1295 /* if we have some loops to throw*/ 1296 if (loops_left) { 1297 /* replay that bad boy*/ 1298 v.play(); 1299 } 1300 1301 /* if not forever*/ 1302 if (loops_left !== true) { 1303 /* one less loop*/ 1304 loops_left--; 1305 } 1306 }); 1307 } 1308 1309 /* when can play, play*/ 1310 $video.bind('canplay', function(){ 1311 1312 if (options.autoplay) { 1313 /* replay that bad boy*/ 1314 v.play(); 1315 } 1316 1317 }); 1318 1319 1320 /* if supports video*/ 1321 if ($.fn.videoBG.supportsVideo()) { 1322 1323 /* supports webm*/ 1324 if ($.fn.videoBG.supportType('webm') && options.webm != ""){ 1325 1326 /* play webm*/ 1327 $video.attr('src',options.webm); 1328 } 1329 /* supports mp4*/ 1330 else { 1331 if ($.fn.videoBG.supportType('mp4') && options.mp4 != "") { 1332 1333 /* play mp4*/ 1334 $video.attr('src',options.mp4); 1335 1336 /* $video.html('<source src="'.options.mp4.'" />');*/ 1337 1338 } 1339 /* throw ogv at it then*/ 1340 else { 1341 1342 /* play ogv*/ 1343 $video.attr('src',options.ogv); 1344 } 1345 } 1346 1347 } 1348 1349 1350 1351 /* image for those that dont support the video */ 1352 var $img = $('<img/>'); 1353 $img.attr('src',options.poster) 1354 .css('position','absolute') 1355 .css('z-index',options.zIndex) 1356 .css('top',0) 1357 .css('left',0) 1358 .css('min-width','100%') 1359 .css('min-height','100%'); 1360 1361 /* add the image to the video*/ 1362 /* if suuports video*/
1363 if ($.fn.videoBG.supportsVideo()) { 1364 /* add the video to the wrapper*/ 1365 $div.html($video); 1366 } 1367 1368 /* nope - whoa old skool*/ 1369 else { 1370 1371 /* add the image instead*/ 1372 $div.html($img); 1373 } 1374 1375 /* if text replacement*/ 1376 if (options.textReplacement) { 1377 1378 /* force the heights and widths*/ 1379 $div.css('min-height',1).css('min-width',1); 1380 $video.css('min-height',1).css('min-width',1); 1381 $img.css('min-height',1).css('min-width',1); 1382 1383 $div.height(options.height).width(options.width); 1384 $video.height(options.height).width(options.width); 1385 $img.height(options.height).width(options.width); 1386 } 1387 1388 if ($.fn.videoBG.supportsVideo()) { 1389/* v.play();*/ 1390 } 1391 return $div; 1392 } 1393 1394 /* check if suuports video*/ 1395 $.fn.videoBG.supportsVideo = function() { 1396 return (document.createElement('video').canPlayType); 1397 } 1398 1399 /* check which type is supported*/ 1400 $.fn.videoBG.supportType = function(str) { 1401 1402 /* if not at all supported*/ 1403 if (!$.fn.videoBG.supportsVideo()) { 1404 return false; 1405 } 1406 1407 /* create video*/ 1408 var v = document.createElement('video'); 1409 1410 /* check which?*/ 1411 switch (str) { 1412 case 'webm' : 1413 return (v.canPlayType('video/webm; codecs="vp8, vorbis"')); 1414 break; 1415 case 'mp4' : 1416 return (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')); 1417 break; 1418 case 'ogv' : 1419 return (v.canPlayType('video/ogg; codecs="theora, vorbis"')); 1420 break; 1421 } 1422 /* nope*/ 1423 return false; 1424 } 1425 1426 /* get the overlay wrapper*/ 1427 $.fn.videoBG.wrapper = function() { 1428 var $wrap = $('<div/>'); 1429 $wrap.addClass('videoBG_wrapper') 1430 .css('position','absolute') 1431 .css('top',0) 1432 .css('left',0); 1433 return $wrap; 1434 } 1435 1436 /* these are the defaults*/ 1437 $.fn.videoBG.defaults = { 1438 mp4:'', 1439 ogv:'', 1440 webm:'', 1441 poster:'', 1442 autoplay:true, 1443 loop:true, 1444 scale:false, 1445 position:"absolute", 1446 opacity:1, 1447 textReplacement:false, 1448 zIndex:0, 1449 width:0, 1450 height:0, 1451 fullscreen:false, 1452 imgFallback:true 1453 } 1454 1455})( jQuery ); 1456 1457 1458 1459/** 1460 * Parallax function created by alex on 7/4/14. 1461 */ 1462 1463(function( $ ){ 1464 var $window = $(window); 1465 var windowHeight = $window.height(); 1466 1467 $window.resize(function () { 1468 windowHeight = $window.height(); 1469 }); 1470 1471 $.fn.parallax = function(xpos, speedFactor, outerHeight) { 1472 var $this = $(this); 1473 var getHeight; 1474 var firstTop; 1475 var paddingTop = 0; 1476 var isWebkitTransform = (typeof document.body.style['-webkit-transform'] == "undefined" ? false : true); 1477 if(isWebkitTransform){ 1478 $this.css('position', 'relative'); 1479 } 1480 1481 /*get the starting position of each element to have parallax applied to it*/ 1482 1483 window.correctFirstTop4Parallax = function(){ 1484 $this.each(function(){ 1485 firstTop = $this.offset().top; 1486 }); 1487 }; 1488 1489 window.correctFirstTop4Parallax(); 1490 1491 1492 if (outerHeight) { 1493 getHeight = function(jqo) { 1494 return jqo.outerHeight(true); 1495 }; 1496 } else { 1497 getHeight = function(jqo) { 1498 return jqo.height(); 1499 }; 1500 } 1501 1502 /* setup defaults if arguments aren't specified*/ 1503 if (arguments.length < 1 || xpos === null){ xpos = "50%"; } 1504 if (arguments.length < 2 || speedFactor === null){ speedFactor = 0.1; } 1505 if (arguments.length < 3 || outerHeight === null){ outerHeight = true; } 1506 /* function to be called whenever the window is scrolled or resized*/ 1507 function update(){ 1508 var pos = $window.scrollTop(); 1509 1510 $this.each(function(){ 1511 var $element = $(this); 1512 var top = $element.offset().top; 1513 var height = getHeight($element); 1514 var rect = this.getBoundingClientRect(); 1515/* var backgroundVerticalShift = -Math.abs(Math.round((firstTop - pos) * speedFactor));*/ 1516 /* Check if totally above or totally below viewport*/ 1517 if (top + height < pos || top > pos + windowHeight) { 1518 return; 1519 } 1520 var backgroundVerticalShift = -1 * Math.round(rect.top * speedFactor); 1521 if(isWebkitTransform){ 1522 this.style['-webkit-transform'] = "translateY(" + backgroundVerticalShift + "px)"; 1523 }else{ 1524 this.style['top'] = backgroundVerticalShift + "px"; 1525 } 1526 }); 1527 } 1528 $(window).resize(window.correctFirstTop4Parallax); 1529 $window.bind('scroll', update).resize(update); 1530 if(document.readyState !== "complete"){ 1531 window.addEventListener('load', function(){ 1532 update(); 1533 }); 1534 }else{ 1535 update(); 1536 } 1537 }; 1538})(jQuery); 1539 1540 1541(function( $ ){ 1542 function t_initZoom(){ 1543 if ( $('[data-zoomable="yes"]').length ) { 1544 $('[data-zoomable="yes"]').addClass("t-zoomable"); 1545 $("body").append('<div class="t-zoomer__wrapper">\ 1546 <div class="t-zoomer__container">\ 1547 </div>\ 1548 <div class="t-zoomer__bg"></div>\ 1549 <div class="t-zoomer__close">\ 1550 <div class="t-zoomer__close-line t-zoomer__close-line-first"></div>\ 1551 <div class="t-zoomer__close-line t-zoomer__close-line-second"></div>\ 1552 </div>\ 1553 </div>'); 1554 t_showZoom(); 1555 $(document).keydown(function(e) { 1556 if (e.keyCode == 27) { 1557 $('body').removeClass("t-zoomer__show"); 1558 $('body').removeClass("t-zoomer__show_fixed"); 1559 } 1560 }); 1561 $('.t-zoomer__close, .t-zoomer__bg').click(function(e){ 1562 $('body').removeClass("t-zoomer__show"); 1563 $('body').removeClass("t-zoomer__show_fixed"); 1564 }); 1565 } 1566 } 1567 1568 function t_showZoom(){ 1569 $('.t-zoomable').click(function(e){ 1570 $("body").addClass("t-zoomer__show"); 1571 $(".t-zoomer__container").html('<div id="t-carousel__zoomed" class="t-carousel slide" data-ride="carousel" data-interval="false">\ 1572 <div class="t-carousel__slides t-carousel__zoomer__slides">\ 1573 <div class="t-carousel__inner t-carousel__zoomer__inner">\ 1574 </div>\ 1575 <a class="left t-carousel__control t-carousel__zoomer__control" href="#t-carousel__zoomed" data-sli
1575de="prev">\ 1576 <div class="t-carousel__arrow__wrapper t-carousel__arrow__wrapper_left">\ 1577 <div class="t-carousel__arrow t-carousel__arrow_left t-carousel__arrow_small"></div>\ 1578 </div>\ 1579 </a>\ 1580 <a class="right t-carousel__control t-carousel__zoomer__control" href="#t-carousel__zoomed" data-slide="next">\ 1581 <div class="t-carousel__arrow__wrapper t-carousel__arrow__wrapper_right">\ 1582 <div class="t-carousel__arrow t-carousel__arrow_right t-carousel__arrow_small"></div>\ 1583 </div>\ 1584 </a>\ 1585 </div>\ 1586 </div>'); 1587 1588 var id = $(this).closest(".r").attr("id"); 1589 var images = $("#"+id+"").find(".t-zoomable"); 1590 images.each(function () { 1591 var images_urls = $(this).attr('data-img-zoom-url').split(','); 1592 if($(this).is("img")) { 1593 var imgdescr = $(this).attr('alt'); 1594 } else { 1595 if ($(this).is("div")) { 1596 var imgdescr = $(this).attr('title'); 1597 } 1598 } 1599 images_urls.forEach(function() { 1600 if (typeof imgdescr !== typeof undefined && imgdescr !== false) { 1601 $(".t-carousel__zoomer__inner").append("<div class=\"t-carousel__item t-carousel__zoomer__item item\"><div class=\"t-carousel__zoomer__wrapper\"><img class=\"t-carousel__zoomer__img\" src=\""+images_urls+"\"></div><div class=\"t-zoomer__comments\"><div class=\"t-zoomer__descr t-descr t-descr_xxs\">"+imgdescr+"</div></div></div>"); 1602 } else { 1603 $(".t-carousel__zoomer__inner").append("<div class=\"t-carousel__item t-carousel__zoomer__item item\"><div class=\"t-carousel__zoomer__wrapper\"><img class=\"t-carousel__zoomer__img\" src=\""+images_urls+"\"></div><div class=\"t-zoomer__comments\"></div></div>"); 1604 } 1605 }); 1606 }); 1607 1608 var image_descr = $(".t-carousel__zoomer__item"); 1609 image_descr.each(function () { 1610 $(this).css("display", "block"); 1611 var height = $(this).find(".t-zoomer__comments").height(); 1612 $(this).css("display", ""); 1613 var image_active = $(this).find(".t-carousel__zoomer__wrapper"); 1614 image_active.css("bottom", height); 1615 }); 1616 1617 var target_url = $(this).attr("data-img-zoom-url"), 1618 target_img = $(".t-carousel__zoomer__img[src=\""+target_url+"\"]"), 1619 target = target_img.closest(".t-carousel__zoomer__item"); 1620 target.addClass("active"); 1621 1622 var slides_count = $(".t-carousel__zoomer__item").size(); 1623 if (slides_count > 1) { 1624 $('body').addClass("t-zoomer__show_fixed"); 1625 } else { 1626 $(".t-carousel__zoomer__control").css("display", "none"); 1627 } 1628 1629 1630 $('.t-carousel__zoomer__img').click(function(e){ 1631 $('body').removeClass("t-zoomer__show"); 1632 $('body').removeClass("t-zoomer__show_fixed"); 1633 }); 1634 1635 var lastScrollTop = 0; 1636 $(window).scroll(function(event){ 1637 var st = $(this).scrollTop(); 1638 if (st > lastScrollTop){ 1639 $('body').removeClass("t-zoomer__show"); 1640 } 1641 lastScrollTop = st; 1642 }); 1643 }); 1644 } 1645 1646 $(document).ready(function(){ 1647 t_initZoom(); 1648 }); 1649 1650})(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.