1function headerButtonClicked(button) { 2 if($(button).hasClass('self')){ 3 var win = window.open($(button).attr("href"), "_self"); 4 }else{ 5 var win = window.open($(button).attr("href"), "_blank"); 6 } 7 win.focus(); 8} 9 10var i = 0; 11var images = []; 12var headerVideos = []; 13var headerTitles = []; 14var headerSubtitles = []; 15var headerLinks = []; 16var headerWebsite = []; 17var headerWebsiteText = []; 18var headerFacebook = []; 19var headerFacebookText = []; 20var headerKinofinden = []; 21var headerKinofindenText = []; 22var headerlink1intern = []; 23var headerlink2intern = []; 24var headerlink3intern = []; 25var videoStatus; 26var heroTitleSize = []; 27var heroSubtitleSize = []; 28var result; 29var heroTitleImages = []; 30var heroTitleSizeMobile = []; 31var heroSubtitleSizeMobile = []; 32var headerKinofindenActivate = []; 33var headerFacebookActivate = []; 34var headerWebsiteActivate = []; 35 36 37 38$(document).ready(function() { 39 40 $.ajax({ 41 type: 'GET', 42 url: API_URL + "/corp/startpage" + preview , 43 async: false, 44 jsonpCallback: 'start', 45 contentType: "application/json", 46 dataType: 'jsonp', 47 success: function(json) { 48 result = json; 49 50 $.each( json.heros, function( key, val ) { 51 images = val.hero_mobile; 52 headerVideos.push(media_url + val.hero_file); 53 headerTitles.push(val.hero_title); 54 headerSubtitles.push(val.hero_subtitle); 55 headerLinks.push(val.alias); 56 headerWebsiteText.push(val.hero_link1_title); 57 headerWebsite.push(val.hero_link1); 58 headerWebsiteActivate.push(val.hero_link1_activate); 59 60 headerFacebook.push(val.hero_link2); 61 headerFacebookText.push(val.hero_link2_title); 62 headerFacebookActivate.push(val.hero_link2_activate); 63 64 headerKinofinden.push(val.hero_link3); 65 headerKinofindenText.push(val.hero_link3_title); 66 headerKinofindenActivate.push(val.hero_link3_activate); 67 68 headerlink1intern.push(val.hero_link1_intern); 69 headerlink2intern.push(val.hero_link2_intern); 70 headerlink3intern.push(val.hero_link3_intern); 71 72 heroTitleSize.push(val.ce_micro_info_title_size); 73 heroSubtitleSize.push(val.ce_micro_info_subtitle_size); 74 heroTitleImages.push(val.hero_title_logo); 75 heroTitleSizeMobile.push(val.ce_micro_info_title_size_mobile); 76 heroSubtitleSizeMobile.push(val.ce_micro_info_subtitle_size_mobile); 77 78 i++; 79 80 $("#header-images-container").append("<div><img u='image' src='" + media_url + val.hero_mobile + "'/></div"); 81 }); 82 83 if(json.startsocial){ 84 console.log(json.startsocial); 85 86 var title = json.startsocial["title"]; 87 var link = json.startsocial["link"]; 88 var height = json.startsocial["height"]; 89 var fb_deactivate = json.startsocial["fb"]; 90 var archive_deactivate = json.startsocial["archive"]; 91 92 $("#startsocial-content iframe").attr("src", link); 93 if(height.length){ 94 $("#startsocial-content iframe").css({'height':height}); 95 } 96 $("#startsocial .container-title a span").text(title); 97 $("#startsocial").show(); 98 if(fb_deactivate !== '1'){ 99 $("#facebook").css({'height':'auto'}); 100 } 101 if(archive_deactivate !== '1'){ 102 $("#archive").css({'height':'auto'}); 103 } 104 105 } 106 107 108 initHeader(); 109 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 1, {delay:1, alpha:1}); 110 console.log('DATALAYER: -------------------------->>>>>', dataLayer); 111 }, 112 error: function(e) { 113 console.log(e.message); 114 } 115 116 }); 117}); 118 119var isDesktop = true; 120 121var width = 1920; 122var height = 1080; 123var movieHeight = 500; 124var fitHeader = true; 125var currentVideo = 0; 126var headerVideo; 127var slider; 128 129var headerVideoPlaying = false;
130var infosTimeline; 131var mouseOverInfos = false; 132 133var sliderindexAsy = 0; 134function initHeader() { 135 136 //////////////////////////////////////////////////////////////////////////////////// 137 // Setup Animation ///////////////////////////////////////////////////////////////// 138 /* $("#header-infos").css({'display':'block'}); 139 $("#header-left").css({'display':'block'}); 140 $("#header-right").css({'display':'block'}); 141 infosTimeline = new TimelineMax({paused:true}); 142 infosTimeline.from(["#header-infos", "#header-left", "#header-right"], 2, {alpha:0}); 143 //infosTimeline.to(["#header-infos", "#header-left", "#header-right"], 2, {delay:1, alpha:0}, "=+4"); 144 */ 145 146 //////////////////////////////////////////////////////////////////////////////////// 147 // Header Mouseover/Movement /////////////////////////////////////////////////////// 148 /*$("#header").mouseover(function() { 149 150 // Show infos if animation ended 151 if(infosTimeline.progress() == 1) { 152 153 mouseOverInfos = true; 154 155 infosTimeline.seek(0); 156 infosTimeline.play(); 157 } 158 }); 159 160 $("#header").mousemove(function() { 161 162 // Show infos if animation ended 163 if(infosTimeline.progress() == 1) { 164 165 infosTimeline.seek(0); 166 infosTimeline.play(); 167 } 168 }); 169 */ 170 171 //////////////////////////////////////////////////////////////////////////////////// 172 // Setup Images //////////////////////////////////////////////////////////////////// 173 /* 174 var _SlideshowTransitions = [{ 175 $Duration: 600, 176 $Delay: 0, 177 $FlyDirection: 5, 178 $Formation: 179 $JssorSlideshowFormations$.$FormationZigZag, 180 //$Easing: { $Left: $JssorEasing$.$EaseInCubic, $Top: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseOutQuad }, 181 $Opacity: 2 182 }]; 183 var options = { 184 $DragOrientation: 3, 185 $AutoPlay: false, 186 //$SlideDuration: 1500, 187 $AutoPlayInterval: 4500, 188 $SlideshowOptions: { //Options which specifies enable slideshow or not 189 //$Class: $JssorSlideshowRunner$, //Class to create instance of slideshow 190 $Transitions: _SlideshowTransitions, //Transitions to play slide, see jssor slideshow transition builder 191 $TransitionsOrder: 1, //The way to choose transition to play slide, 1 Sequence, 0 Random 192 $ShowLink: 2, //0 After Slideshow, 2 Always 193 $ContentMode: false //Whether to trait content as slide, otherwise trait an image as slide 194 } 195 }; 196*/ 197 /* 198 var jssor_1_SlideshowTransitions = [ 199 {$Duration:1200,$Opacity:2} 200 ]; 201 var options = { 202 $AutoPlay: 1, 203 $SlideshowOptions: { 204 $Class: $JssorSlideshowRunner$, 205 $Transitions: jssor_1_SlideshowTransitions, 206 $TransitionsOrder: 1 207 }, 208 $ArrowNavigatorOptions: { 209 $Class: $JssorArrowNavigator$ 210 }, 211 $BulletNavigatorOptions: { 212 $Class: $JssorBulletNavigator$ 213 } 214 }; 215 */ 216 /* 217 var jssor_1_SlideshowTransitions = [ 218 //{$Duration:500,$Opacity:2} 219 {$Duration:500,x:-0.3,$During:{$Left:[0.3,0.7]},$Easing:{$Left:$Jease$.$InCubic,$Opacity:$Jease$.$Linear},$Opacity:2} 220 ]; 221 var options = { 222 $FillMode: 2, 223 $AutoPlay: false, 224 $AutoPlayInterval: 4000, 225 $PauseOnHover: 1, 226 $SlideshowOptions: { 227 $Class: $JssorSlideshowRunner$, 228 $Transitions: jssor_1_SlideshowTransitions, 229 $TransitionsOrder: 1 230 } 231 }; 232*/ 233 var jssor_1_SlideshowTransitions = [ 234 {$Duration:500,$Fade: true,$Opacity:2} 235 ]; 236 237 var options = { 238 $AutoPlay: 1, 239 $FillMode: 2, 240 $DragOrientation: 0, 241 $ArrowKeyNavigation: 0, 242 $AutoPlayInterval: 4000, 243 $SlideshowOptions: { $Class: $JssorSlideshowRunner$, $Transitions: [{ $Duration: 0, $Fade: true, $Opacity: 1 }] } 244 /*$SlideshowOptions: { 245 $Class: $JssorSlideshowRunner$, 246 $Transitions: jssor_1_SlideshowTransitions, 247 $TransitionsOrder: 1 248 }*/ 249 }; 250 slider = new $JssorSlider$("header-images", options); 251 252 //slider.$On($JssorSlider$.$EVT_STATE_CHANGE, function(slideIndex, fromIndex, progress, progressBeg
252in, idleBegin, idleEnd, progressEnd) { 253 slider.$On($JssorSlider$.$EVT_PARK, function(slideIndex, fromIndex) { 254 console.log('-------------'); 255 console.log('slideIndex: ' + slideIndex); 256 console.log('fromIndex: ' + fromIndex); 257 console.log('-------------'); 258 259 if(slideIndex != fromIndex){ 260 setHeaderInfosAsych(slideIndex, function() { 261 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 262 infosTimeline = new TimelineMax({paused:true}); 263 infosTimeline.from(["#header-infos", "#header-left", "#header-right"], 0, {alpha:0}); 264 TweenMax.to(["#header-images"], 0, {delay:0, alpha:1}); 265 infosTimeline.play(); 266 console.log('Finished Header Info. SLIDER'); 267 }); 268 269 } 270 271 }); 272 273 // TweenMax.to(["#header-infos", "#header-left", "#header-right"], 1, {delay:0, alpha:1}); 274 275 276 /* 277 slider.$On($JssorSlider$.$EVT_STATE_CHANGE, function(slideIndex, fromIndex, progress, progressBegin, idleBegin, idleEnd, progressEnd) { 278 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 279 console.log('slideIndex: ' + slideIndex); 280 console.log('fromIndex: ' + fromIndex); 281 console.log('ausgeführt'); 282 //setHeaderInfosAsych(slideIndex); 283 if(slideIndex != fromIndex){ 284 // setHeaderInfosAsych(slideIndex); 285 } 286 console.log('progressBegin' + progressBegin); 287 if(progressBegin == 0){ 288 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 289 setHeaderInfosAsych(slideIndex); 290 } 291 }); 292 */ 293 /* 294 slider.$On($JssorSlider$.$EVT_STATE_CHANGE, function(slideIndex, fromIndex, progress, progressBegin, idleBegin, idleEnd, progressEnd) { 295 console.log('slideIndex: ' + slideIndex); 296 console.log('fromIndex: ' + fromIndex); 297 console.log('ausgeführt'); 298 if(slideIndex != fromIndex){ 299 setHeaderInfos(slideIndex); 300 //TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 301 /* 302 console.log('progress' + progress); 303 console.log('progressBegin' + progressBegin); 304 console.log('idleBegin' + idleBegin); 305 console.log('idleEnd' + idleEnd); 306 console.log('progressEnd' + progressEnd); 307 308 if(progressBegin == 0){ 309 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 310 setHeaderInfos(slideIndex); 311 } 312 if(typeof progressEnd == 'undefined'){ 313 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:1}); 314 } 315 316 } 317 }); 318 */ 319 //////////////////////////////////////////////////////////////////////////////////// 320 // Setup Video Paginator /////////////////////////////////////////////////////////// 321 for(var i = 0; i < headerVideos.length; i++) { 322 323 $("#header-video-paginator").append("<li><p>●</p></li>"); 324 } 325 326 $("#header-video-paginator > li").mouseover(function(e){ 327 328 if($(this).index() != currentVideo) 329 TweenMax.to($(this).find("p"), 0.5, {alpha:1}); 330 }); 331 332 $("#header-video-paginator > li").mouseout(function(e){ 333 334 if($(this).index() != currentVideo) 335 TweenMax.to($(this).find("p"), 0.5, {alpha:0.5}); 336 }); 337 338 $("#header-video-paginator > li").click(function(e){ 339 340 if($(this).index() != currentVideo) { 341 342 // Hide iPad play button 343 $("#tablet-play-button").css("display", "none"); 344 345 currentVideo = $(this).index(); 346 loadSource(currentVideo); 347 } 348 }); 349 350 //////////////////////////////////////////////////////////////////////////////////// 351 // Setup Video ///////////////////////////////////////////////////////////////////// 352 headerVideo = document.getElementById("header-video"); 353 headerVideo.muted = true; 354 headerVideo.onplay = function(e) { 355 videoStatus = true; 356 $("#tablet-play-button").css("display", "none"); 357 } 358 headerVideo.onended = function(e) { 359 if(videoStatus){ 360 headerVideo.play(); 361 } 362 else{ 363 headerVideo.pause(); 364 } 365 currentVideo++; 366 367 if (currentVideo > headerVideos.length - 1) 368 currentVideo = 0 369 370 loadSource(currentVideo); 371 }; 372
373 //////////////////////////////////////////////////////////////////////////////////// 374 // Initial start /////////////////////////////////////////////////////////////////// 375 checkIsDesktop(); 376 scaleImages(); 377 resizeHeader(); 378 379 loadSource(currentVideo); 380 381 $(window).resize(function () { 382 383 // Check if desktop size 384 checkIsDesktop(); 385 386 scaleImages(); 387 resizeHeader(); 388 }); 389 390 $(window).scroll(function () { 391 /* 392 var yPos = window.pageYOffset || document.body.scrollTop; 393 if((yPos + 200) >= $("#header-video").height() && !headerVideo.paused) { 394 395 console.log("pause"); 396 headerVideo.pause(); 397 } 398 else if (headerVideo.paused) { 399 400 headerVideo.play(); 401 } 402 */ 403 TweenMax.to(["#header-images"], 0, {delay:0, alpha:1}); 404 }); 405 406 //////////////////////////////////////////////////////////////////////////////////// 407 // Add Tablet Play Button ////////////////////////////////////////////////////////// 408 if(isTablet()) { 409 410 $("#tablet-play-button").css("display", "block"); 411 } 412 413 //////////////////////////////////////////////////////////////////////////////////// 414 // Arrows ////////////////////////////////////////////////////////////////////////// 415 $("#header-left").click(function(e) { 416 417 currentVideo--; 418 if(currentVideo < 0) 419 currentVideo = headerVideos.length - 1; 420 421 loadSource(currentVideo); 422 }); 423 424 $("#header-right").click(function(e) { 425 426 currentVideo++; 427 if(currentVideo > headerVideos.length - 1) 428 currentVideo = 0; 429 430 loadSource(currentVideo); 431 }); 432} 433 434function startHeaderVideo(item) { 435 436 $(item).css("display", "none"); 437 loadSource(0); 438} 439 440function resizeHeader() { 441 442 // If desktop resize Video 443 if(isDesktop) { 444 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 1, {delay:0, alpha:1}); 445 $("#header-video").width("100%"); 446 $("#header-video").height(height/width * $("#header-video").innerWidth()); 447 448 if(fitHeader && $("#header-video").innerHeight() < $(window).height()) { 449 450 $("#header-content").height($("#header-video").innerHeight()); 451 } 452 else if(fitHeader) { 453 454 $("#header-content").height($(window).height()); 455 } 456 457 } 458 // else set mobile header height 459 else { 460 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:1}); 461 //$("#header-content").height(mobileHeight); 462 $("#header-content").height($("#header-images").height()); 463 } 464}; 465 466function scaleImages() { 467 468 var bodyWidth = document.body.clientWidth; 469 if (bodyWidth) 470 slider.$ScaleWidth(Math.min(bodyWidth, 1920)); 471 else 472 window.setTimeout(scaleImages, 30); 473} 474 475function checkIsDesktop() { 476 477 if ($(window).width() <= 768) 478 isDesktop = false; 479 else 480 isDesktop = true; 481 482 // Play Video if is desktop else stop 483 if(isDesktop) { 484 485 slider.$Pause(); 486 headerVideo.play(); 487 //setHeaderInfosAsych(currentVideo); 488 setHeaderInfosAsych(currentVideo, function() { 489 //TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:1}); 490 491 //infosTimeline = new TimelineMax({paused:true}); 492 //infosTimeline.from(["#header-infos", "#header-left", "#header-right"], 0, {alpha:0}); 493 494 //infosTimeline.play(); 495 console.log('Finished Header Info. Desktop'); 496 }); 497 } 498 else { 499 500 slider.$Play(); 501 headerVideo.pause(); 502 //setHeaderInfosAsych(slider.$CurrentIndex); 503 setHeaderInfosAsych(slider.$CurrentIndex, function() { 504 //TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:1}); 505 506 //infosTimeline = new TimelineMax({paused:true}); 507 //infosTimeline.from(["#header-infos", "#header-left", "#header-right"], 0, {alpha:0}); 508 509 //infosTimeline.play(); 510 console.log('Finished Header Info. MOBIL'); 511 }); 512 } 513} 514 515function loadSource(nr) { 516 headerVideo.pause(); 517 518 TweenMax.to($("#header-video-paginator").children().find("p"), 0.5, {scale:0.8, alpha:0.5}); 519 TweenMax.to($("#header-video-paginator").children().eq(nr).find("p"), 0.5, {scale:1, alpha:1}); 520 521 //setHeaderInfosAsych(nr); 522 setHeaderInfosAsych(nr, function() { 523 //TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 524 525 //infosTimeline = new TimelineMax({paused:true}); 526 //infosTimeline.from(["#header-infos", "#header-left", "#header-right"], 0, {alpha:0}); 527 528 //infosTimeline.play(); 529 console.log('Finished Header Info. loadsource'); 530 }); 531 532 // HD 533 var source = document.createElement("source"); 534 $(source).attr("type", "video/mp4"); 535 536 // LOW if Android 537 if(navigator.userAgent.match("Android")) 538 $(source).attr("src", headerVideos[nr].replace(".mp4", "_low.mp4")); 539 else 540 $(source).attr("src", headerVideos[nr]); 541 542 $("#header-video").empty(); 543 $("#header-video").append(source); 544 headerVideo.load(); 545 headerVideo.play(); 546 547 // Don't play if is mobile 548 if (!isDesktop) 549 headerVideo.pause(); 550} 551 552function showInfo(nr) { 553 554 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 555 setHeaderInfos(nr); 556 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:1}); 557 558 infosTimeline = new TimelineMax({paused:true}); 559 infosTimeline.from(["#header-infos", "#header-left", "#header-right"], 0, {alpha:0}); 560 //infosTimeline.to(["#header-infos", "#header-left", "#header-right"], 2, {delay:1, alpha:0}, "=+4"); 561 562 // infosTimeline.seek(0); 563 infosTimeline.play(); 564 565} 566 567function setHeaderInfosAsych(nr, callback) { 568 console.log('NR: ' + nr); 569 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0, alpha:0}); 570 TweenMax.to(["#header-images"], 0, {delay:0, alpha:0}); 571 try { 572 /*console.log('______heroTitleImages___________'); 573 console.log(heroTitleImages); 574 console.log('_________________'); 575 console.log('headerTitles'); 576 console.log(headerTitles); 577 console.log('_________________>>> heroTitleImages with NR' + heroTitleImages[nr]); 578 console.log('_________________'); 579 console.log('_________________>>> heroTitle with NR' + headerTitles[nr]); 580 */ 581 if(heroTitleImages[nr].length > 0){ 582 $("#header-video-title").hide(); 583 setupTitleImage(heroTitleImages[nr]); 584 $("#header-title-logo").show(); 585 }else{ 586 $("#header-title-logo").hide(); 587 $("#header-video-title").html(headerTitles[nr]); 588 $("#header-video-title").show(); 589 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0.5, alpha:1}); 590 } 591 $("#header-video-subtitle").html(headerSubtitles[nr]); 592 593 $("#header-text-link").attr("href", headerLinks[nr]); 594 $("#header-link").attr("href", base_url + headerLinks[nr] + preview_add); 595 //console.log('headerlink3intern: ' + headerlink3intern[nr].length); 596 if(headerlink3intern[nr].length > 0) { 597 $("#header-ticket-button").addClass('self'); 598 $("#header-ticket-button").removeClass('blank'); 599 } 600 else{ 601 $("#header-ticket-button").addClass('blank'); 602 $("#header-ticket-button").removeClass('self'); 603 } 604 //console.log('headerlink2intern: ' + headerlink2intern[nr].length); 605 if(headerlink2intern[nr].length > 0) { 606 $("#header-facebook-button").addClass('self'); 607 $("#header-facebook-button").removeClass('blank'); 608 } 609 else{ 610 $("#header-facebook-button").addClass('blank'); 611 $("#header-facebook-button").removeClass('self'); 612 } 613 //console.log('headerlink1intern: ' + headerlink1intern[nr].length); 614 if(headerlink1intern[nr].length > 0) { 615 $("#header-website-button").addClass('self'); 616 $("#header-website-button").removeClass('blank'); 617 } 618 else{ 619 $("#header-website-button").addClass('blank'); 620 $("#header-website-button").removeClass('self'); 621 622 } 623 //console.log('headerWebsite: ' + headerWebsite[nr]); 624 if(headerWebsiteActivate[nr] == 1) { 625 $("#header-website-button").html(headerWebsiteText[nr]); 626 $("#header-website-button").attr("href", headerWebsite[nr]); 627 $("#header-website-button").parent().show(); 628 } else{ 629 $("#header-website-button").parent().hide(); 630 } 631 //console.log('headerFacebook: ' + headerFacebook[nr]); 632 if(headerFacebookActivate[nr] == 1) { 633 $("#header-facebook-button").attr("href", headerFacebook[nr]); 634 $("#header-facebook-button").parent().show(); 635 } else{ 636 $("#header-facebook-button").parent().hide(); 637 } 638 639 //console.log('headerKinofinden: ' + headerKinofinden[nr]); 640 if(headerKinofindenActivate[nr] == 1) { 641 $("#header-ticket-button").attr("href", headerKinofinden[nr]); 642 $("#header-ticket-button").html(headerKinofindenText[nr]); 643 $("#header-ticket-button").parent().show(); 644 } else{ 645 $("#header-ticket-button").parent().hide(); 646 } 647 //console.log(heroTitleSize[nr]); 648 if ($(window).width() <= 768){ 649 //console.log(heroTitleSizeMobile[nr]); 650 //console.log(heroSubtitleSizeMobile[nr]); 651 652 if(heroTitleSizeMobile[nr].length > 0){ 653 $("#header-video-title").css({'font-size':heroTitleSizeMobile[nr] + 'px'}); 654 } 655 else{ 656 $("#header-video-title").css({'font-size':'35px'}); 657 } 658 //console.log(heroSubtitleSize[nr]); 659 if(heroSubtitleSizeMobile[nr].length > 0){ 660 $("#header-video-subtitle").css({'font-size':heroSubtitleSizeMobile[nr] + 'px'}); 661 }else{ 662 $("#header-video-subtitle").css({'font-size':'22px'}); 663 } 664 }else{ 665 //console.log(heroTitleSize[nr]); 666 //console.log(heroSubtitleSize[nr]); 667 if(heroTitleSize[nr].length > 0){ 668 $("#header-video-title").css({'font-size':heroTitleSize[nr] + 'px'}); 669 } 670 else{ 671 $("#header-video-title").css({'font-size':'70px'}); 672 } 673 //console.log(heroSubtitleSize[nr]); 674 if(heroSubtitleSize[nr].length > 0){ 675 $("#header-video-subtitle").css({'font-size':heroSubtitleSize[nr] + 'px'}); 676 }else{ 677 $("#header-video-subtitle").css({'font-size':'30px'}); 678 } 679 } 680 } 681 catch(e) { 682 console.log('error'); 683 } 684 685 if (callback && typeof(callback) === "function") { 686 callback(); 687 } 688} 689 690function setHeaderInfos(nr) { 691 //console.log('nr: ' + nr); 692 try { 693 if(heroTitleImages[nr].length > 0){ 694 $("#header-video-title").hide(); 695 setupTitleImage(heroTitleImages[nr]); 696 $("#header-title-logo").show(); 697 }else{ 698 $("#header-title-logo").hide(); 699 $("#header-video-title").html(headerTitles[nr]); 700 $("#header-video-title").show(); 701 } 702 $("#header-video-subtitle").html(headerSubtitles[nr]); 703 704 $("#header-text-link").attr("href", headerLinks[nr]); 705 $("#header-link").attr("href", base_url + headerLinks[nr] + preview_add); 706 //console.log('headerlink3intern: ' + headerlink3intern[nr].length); 707 if(headerlink3intern[nr].length > 0) { 708 $("#header-ticket-button").addClass('self'); 709 $("#header-ticket-button").removeClass('blank'); 710 } 711 else{ 712 $("#header-ticket-button").addClass('blank'); 713 $("#header-ticket-button").removeClass('self'); 714 } 715 //console.log('headerlink2intern: ' + headerlink2intern[nr].length); 716 if(headerlink2intern[nr].length > 0) { 717 $("#header-facebook-button").addClass('self'); 718 $("#header-facebook-button").removeClass('blank'); 719 } 720 else{ 721 $("#header-facebook-button").addClass('blank'); 722 $("#header-facebook-button").removeClass('self'); 723 } 724 //console.log('headerlink1intern: ' + headerlink1intern[nr].length); 725 if(headerlink1intern[nr].length > 0) { 726 $("#header-website-button").addClass('self'); 727 $("#header-website-button").removeClass('blank'); 728 } 729 else{ 730 $("#header-website-button").addClass('blank'); 731 $("#header-website-button").removeClass('self'); 732 733 } 734 //console.log('headerWebsite: ' + headerWebsite[nr]); 735 if(headerWebsite[nr].length > 0) { 736 $("#header-website-button").html(headerWebsiteText[nr]); 737 $("#header-website-button").attr("href", headerWebsite[nr]); 738 $("#header-website-button").parent().show(); 739 } else{ 740 $("#header-website-button").parent().hide(); 741 } 742 //console.log('headerFacebook: ' + headerFacebook[nr]); 743 if(headerFacebook[nr].length > 0) { 744 $("#header-facebook-button").attr("href", headerFacebook[nr]); 745 $("#header-facebook-button").parent().show(); 746 } else{ 747 $("#header-facebook-button").parent().hide(); 748 } 749 750 //console.log('headerKinofinden: ' + headerKinofinden[nr]); 751 if(headerKinofinden[nr].length > 0) { 752 $("#header-ticket-button").attr("href", headerKinofinden[nr]); 753 $("#header-ticket-button").html(headerKinofindenText[nr]); 754 $("#header-ticket-button").parent().show(); 755 } else{ 756 $("#header-ticket-button").parent().hide(); 757 } 758 //console.log(heroTitleSize[nr]); 759 if ($(window).width() <= 768){ 760 //console.log(heroTitleSizeMobile[nr]); 761 //console.log(heroSubtitleSizeMobile[nr]); 762 763 if(heroTitleSizeMobile[nr].length > 0){ 764 $("#header-video-title").css({'font-size':heroTitleSizeMobile[nr] + 'px'}); 765 } 766 else{ 767 $("#header-video-title").css({'font-size':'35px'}); 768 } 769 //console.log(heroSubtitleSize[nr]); 770 if(heroSubtitleSizeMobile[nr].length > 0){ 771 $("#header-video-subtitle").css({'font-size':heroSubtitleSizeMobile[nr] + 'px'}); 772 }else{ 773 $("#header-video-subtitle").css({'font-size':'22px'}); 774 } 775 }else{ 776 //console.log(heroTitleSize[nr]); 777 //console.log(heroSubtitleSize[nr]); 778 if(heroTitleSize[nr].length > 0){ 779 $("#header-video-title").css({'font-size':heroTitleSize[nr] + 'px'}); 780 } 781 else{ 782 $("#header-video-title").css({'font-size':'70px'}); 783 } 784 //console.log(heroSubtitleSize[nr]); 785 if(heroSubtitleSize[nr].length > 0){ 786 $("#header-video-subtitle").css({'font-size':heroSubtitleSize[nr] + 'px'}); 787 }else{ 788 $("#header-video-subtitle").css({'font-size':'30px'}); 789 } 790 } 791 792 793 794 795 } 796 catch(e) {} 797} 798 799function setupTitleImage(title_image_url) { 800 801 var imgURL = "../" + title_image_url; 802 if(imgURL != null) { 803 804 var image = new Image(); 805 image.onload = function() { 806 807 $("#header-video-title").hide(); 808 $("#header-title-logo").show(); 809 810 $("#header-title-logo img").attr("src", imgURL); 811 $("#header-title-logo").css("max-width", this.width/2); 812 813 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0.5, alpha:1}); 814 }; 815 image.onerror = function() { 816 817 $("#header-video-title").show(); 818 $("#header-title-logo").hide(); 819 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:0.5, alpha:1}); 820
820 }; 821 image.src = imgURL; 822 } 823 else { 824 $("#header-video-title").show(); 825 $("#header-title-logo").hide(); 826 TweenMax.to(["#header-infos", "#header-left", "#header-right"], 0, {delay:2, alpha:1}); 827 } 828} 829 830function soundClicked() { 831 832 if(headerVideo.muted) { 833 destroyYoutubeVideo(); 834 if(currentFacebookVideo != null) 835 deactivateFacebookVideo(); 836 837 headerVideo.muted = false; 838 soundIcon(true); 839 } 840 else { 841 842 headerVideo.muted = true; 843 soundIcon(false); 844 } 845} 846 847 848function soundIcon(active) { 849 850 var positions = ["-68px -25px", "-68px -48px"]; 851 852 if(!active) 853 $("#header-video-sound").css("background-position", positions[0]); 854 else 855 $("#header-video-sound").css("background-position", positions[1]); 856} 857 858 859function playIcon(active) { 860 861 var positions = ["-34px -2px", "-52px -1px"]; 862 863 if(!active) 864 $("#header-video-playPause").css("background-position", positions[0]); 865 else 866 $("#header-video-playPause").css("background-position", positions[1]); 867} 868 869function playClicked() { 870 871 if(videoStatus) { 872 headerVideo.pause(); 873 playIcon(false); 874 videoStatus = false; 875 } 876 else { 877 videoStatus = true; 878 headerVideo.play(); 879 playIcon(true); 880 destroyYoutubeVideo(); 881 } 882}
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.