$(document).ready(function() { var newsBoxAllowed = 1; // detect touch device if ("ontouchstart" in window || navigator.msMaxTouchPoints) { isTouch = true; } else { isTouch = false; } // blur function function blurElement(element, size, speed) { if(speed == undefined) { speed = '0.2'; } var filterVal = 'blur(' + size + 'px)'; $(element) .css('filter', filterVal) .css('webkitFilter', filterVal) .css('mozFilter', filterVal) .css('oFilter', filterVal) .css('msFilter', filterVal) .css('transition', 'all '+speed+'s ease-out') .css('-webkit-transition', 'all '+speed+'s ease-out') .css('-moz-transition', 'all '+speed+'s ease-out') .css('-o-transition', 'all '+speed+'s ease-out'); } // swipers var swProfil = new Swiper('#swiperProfil', { initialSlide:0, speed:400,spaceBetween:0,loop:false,autoHeight:true, pagination:'#pg1', nextButton:'#pg1bn', prevButton:'#pg1bb', paginationClickable:true }); var swLeistungen = new Swiper('#swiperLeistungen', { initialSlide:0, speed:400,spaceBetween:0,loop:false,autoHeight:true, pagination:'#pg6', nextButton:'#pg6bn', prevButton:'#pg6bb', paginationClickable:true }); // var swTransaktionen = new Swiper('#swiperTransaktionen', { speed:400,spaceBetween:0, loop:false, autoHeight:true, pagination:'#pg2', nextButton:'#pg2bn', prevButton:'#pg2bb', paginationClickable:true }); // var swFakten = new Swiper('#swiperFakten', {speed:400,spaceBetween:0,loop:false,autoHeight:true, pagination:'#pg3', nextButton:'#pg3bn', prevButton:'#pg3bb', paginationClickable:true }); var swTeam = new Swiper('#swiperTeam', {speed:400,spaceBetween:0,loop:false,autoHeight:true, pagination:'#pg4', nextButton:'#pg4bn', prevButton:'#pg4bb', paginationClickable:true }); // var swWerte = new Swiper('#moduleWerte', {speed:400,spaceBetween:0,loop:false,autoHeight:true, pagination:'#pg4', nextButton:'#pg4bn', prevButton:'#pg4bb', paginationClickable:true }); var swKontakt = new Swiper('#swiperKontakt', { speed:400,spaceBetween:0,loop:false,autoHeight:true, pagination:'#pg5', nextButton:'#pg5bn', prevButton:'#pg5bb', paginationClickable:true }); $('#profilButton1').click(function() { swProfil.slideTo(1, 400, true); return false; }); // Update transaktionen // window.setTimeout(function() { swTransaktionen.update(true); }, 400); // window.setTimeout(function() { swFakten.update(true); }, 1000); // swFakten.on('slideChangeEnd', function () { swFakten.update(true); }); // ================================================================================================================= // swiper button handling // ================================================================================================================= // syntax: Link // erster wert: ziel-slide, zweiter wert: ziel-tempo $('[class*=swiperTrigger]').click(function(index) { var classes=$(this).attr('class').split(" "); var myClass = ''; for(var i=0; i < classes.length; i++) { if(classes[i].indexOf("swiperTrigger") >= 0) { myClass = classes[i]; } } var myClass = myClass.replace('swiperTrigger-',''); var classArray = myClass.split("-"); var targetSlide = 0; var targetSpeed = 400; var targetSwiper = ""; if(classArray[0] != undefined) { targetSlide = parseInt(classArray[0]); } if(classArray[1] != undefined) { targetSpeed = parseInt(classArray[1]); } if(classArray[2] != undefined) { targetSwiper = classArray[2]; } // swiper herausfinden und sliden if(targetSwiper == '') { var mySwiper = $(this).closest('.swiper-container')[0].swiper; } if(targetSwiper != '') { var mySwiper = $('#'+targetSwiper)[0].swiper; } mySwiper.slideTo(targetSlide, targetSpeed, true); return false; }); // ================================================================================================================= // ================================================================================================================= // tweenmax scroll handling // syntax: scrollTrigger-[targetID]-[speed]-[offset] // ERFORDERT: TweenMax.min.js, ScrollToPlugin.min.js // ================================================================================================================= $('[class*=scrollTrigger]').click(function(index) { var classes=$(this).attr('class').split(" "); var myClass = ''; for(var i=0; i < classes.length; i++) { if(classes[i].indexOf("scrollTrigger") >= 0) { myClass = classes[i]; } } var myClass = myClass.replace('scrollTrigger-',''); var classArray = myClass.split("-"); var targetID = 0; var targetSpeed = 20/100; var targetOffset = 0; if(classArray[0] != undefined) { targetID = classArray[0]; } if(classArray[1] != undefined) { targetSpeed = parseInt(classArray[1])/100; } if(classArray[2] != undefined) { targetOffset = parseInt(classArray[2]); } TweenMax.to(window, targetSpeed, { scrollTo:{y:'#'+targetID, offsetY:targetOffset }}); return false; }); // ================================================================================================================= // ================================================================================================================= // ================================================================================================================= // fancybox handling // syntax: Link // =================================================================================================== $('[class*=fancyTrigger]').click(function(index) { var classes=$(this).attr('class').split(" "); var myClass = ''; for(var i=0; i < classes.length; i++) { if(classes[i].indexOf("fancyTrigger") >= 0) { myClass = classes[i]; } } var myClass = myClass.replace('fancyTrigger-',''); var classArray = myClass.split("-"); // init width and height swidth = $(window).width(); $('#swidth').text(swidth); sheight = $(window).height(); $('#sheight').text(sheight); // init values: 80% of screen width/height var targetW = $(window).width() * 0.8; var targetH = $(window).height() * 0.8; // get link var targetLink = $(this).attr('href'); // if(classArray[0] != undefined) { targetW = parseInt(classArray[0]); } // if(classArray[1] != undefined) { targetH = parseInt(classArray[1]); } // launch the fancybox $.fancybox({ 'width':targetW, 'height':targetH, 'padding':0,'overlayOpacity': 0.8,'overlayColor':'#000000', 'autoScale':false, 'transitionIn':'fade', 'transitionOut':'fade', 'type': 'iframe', 'href':targetLink, 'scrolling':'auto' }); // $.fancybox({ 'padding':0,'overlayOpacity': 0.8,'overlayColor':'#000000', 'autoScale':false, 'transitionIn':'fade', 'transitionOut':'fade', 'type': 'iframe', 'href':targetLink, 'scrolling':'no' }); return false; }); // =================================================================================================== // =============================================================================================== // =============================================================================================== // S T A R T R E S P O N S I V E H A N D L I N G // =============================================================================================== // =============================================================================================== // set swidth and sheight as global vars var swidth = $(window).width(); $('#swidth').text(swidth); var sheight = $(window).height(); $('#sheight').text(sheight); var aspect = (swidth/sheight).toFixed(2); $('#aspect').text(aspect); var scrollPos = $(window).scrollTop(); $('#scrollpos').text(scrollPos); // =================================================================================== // scroll top image // =================================================================================== /* $(window).bind("scroll", function(){ updateScroll(); }); function updateScroll() { scrollPos = $(window).scrollTop(); $('#scrollpos').text(scrollPos); if($(window).scrollTop() >= ($(window).height() - 80)) { // TweenMax.killTweensOf($('#menuStripDesktop')); TweenMax.to('#menuStripDesktop', 0.4, { 'top':'0px', delay:0 }); } else { // TweenMax.killTweensOf($('#menuStripDesktop')); TweenMax.to('#menuStripDesktop', 0.4, { 'top':'-80px', delay:0 }); } } */ // =================================================================================== // =================================================================================== function updateLayout() { swidth = $(window).width(); $('#swidth').text(swidth); sheight = $(window).height(); $('#sheight').text(sheight); aspect = (swidth/sheight).toFixed(2); $('#aspect').text(aspect); // ================================================================================ // ================================================================================ // ======================================= // set background size for all slices // ======================================= var slicewidth = (swidth / 12); var slicewidthXT = (swidth / 12) + 1; $('.slice').css({'width':slicewidthXT+'px'}); // set left margins var mleft = 0; $('.slicebg').each(function() { $(this).css({'left':mleft+'px'}); mleft = mleft - slicewidth; }); var mleft = 0; $('.slice').each(function() { $(this).css({'left':mleft+'px'}); mleft = mleft + slicewidth; }); // ======================================= // ======================================= // SET NEWSLOADER WIDTH TO NEWSBOX WIDTH var newxboxWidth = $('#newsbox').width(); $('#newsLoader').css({'width':newxboxWidth+'px'}); // SET STAGE TO PIXEL HEIGHT (BECAUSE HEIGHT:100% CAUSES TROUBLE WITH FANCYBOX3) $('#stage').css({'height':sheight+'px'}); // SET TRANSACTIONS VEGAS WIDTH TO HEIGHT $('[id^=investmentbox]').css({'height':'25vw'}); } // ENDE: UPDATE LAYOUT // initial call updateLayout(); // update vars/layout on screen resize $(window).resize(function() { updateLayout(); }); // update layout on screen resize // =============================================================================================== // =============================================================================================== // E N D R E S P O N S I V E H A N D L I N G // =============================================================================================== // =============================================================================================== // =============================================================================================== // =============================================================================================== // S T A R T I N V I E W H A N D L I N G // =============================================================================================== // =============================================================================================== tlClaim = new TimelineMax(); function resetClaim() { if(tlClaim) { tlClaim.pause().kill(); } TweenMax.set($('.claimModule'), { opacity:0.0 }); TweenMax.set($('#claim1'), { 'left':'-200%', 'top':'0%' }); TweenMax.set($('#claim2'), { 'left':'0%', 'top':'-100%' }); TweenMax.set($('#claim3'), { 'left':'100%', 'top':'0%' }); TweenMax.set($('#claim4'), { 'left':'0%', 'top':'100%' }); TweenMax.set($('#claim5'), { 'left':'0%', 'top':'-100%' }); TweenMax.set($('#claim6'), { 'left':'100%', 'top':'0%' }); TweenMax.set($('#claim7'), { 'left':'-200%', 'top':'0%' }); TweenMax.set($('#claim8'), { 'left':'0%', 'top':'100%' }); } function showClaim() { if(tlClaim) { tlClaim.pause().kill(); } tlClaim = new TimelineMax({paused:true, repeat:0, yoyo:false}); tlClaim.add('label0', 0); // label zum init bei 0sec tlClaim.set($('.claimModule'), { opacity:0.0 }, 'label0+=0.0'); tlClaim.to($('#claim1'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=1.5'); tlClaim.to($('#claim2'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=1.6'); tlClaim.to($('#claim3'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=1.7'); tlClaim.to($('#claim4'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=1.8'); tlClaim.to($('#claim5'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=1.9'); tlClaim.to($('#claim6'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=2.0'); tlClaim.to($('#claim7'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=2.1'); tlClaim.to($('#claim8'), 1.0, { opacity:1, 'left':'0%', 'top':'0%'}, 'label0+=2.2'); tlClaim.play(); } /* tlAward = new TimelineMax(); function showAward() { if(tlAward) { tlAward.pause().kill(); } tlAward = new TimelineMax({paused:true, repeat:0, yoyo:false}); tlAward.add('label0', 0); // label zum init bei 0sec tlAward.to($('#awardUpper1'), 1.0, { opacity:0.3, 'width':'100%'}, 'label0+=0.0'); tlAward.to($('#awardLower1'), 1.0, { opacity:0.3, 'width':'100%'}, 'label0+=0.0'); tlAward.to($('#awardUpper2'), 1.0, { opacity:1, 'width':'100%'}, 'label0+=1.0'); tlAward.to($('#awardLower2'), 1.0, { opacity:1, 'width':'100%'}, 'label0+=1.0'); tlAward.to($('#awardTextWrapper'), 0.8, { scale:1.0, opacity:1.0, ease:Elastic.easeOut.config(0.8, 0.5) }, 'label0+=1.8'); tlAward.play(); } function resetAward() { if(tlAward) { tlAward.pause().kill(); } TweenMax.set($('#awardUpper1'), { 'width':'0%', opacity:1 }); TweenMax.set($('#awardLower1'), { 'width':'0%', opacity:1 }); TweenMax.set($('#awardUpper2'), { 'width':'0%', opacity:0.3 }); TweenMax.set($('#awardLower2'), { 'width':'0%', opacity:0.3 }); TweenMax.set($('#awardTextWrapper'), { scale:0.7, opacity:0.0 }); } resetAward(); */ function rnd(min,max) { var number = Math.floor(Math.random() * (max - min + 1)) + min; return(number); } function resetTitlePosition() { // kill old tweens TweenMax.killTweensOf($('.logoElement')); TweenMax.killTweensOf($('.slice')); TweenMax.killTweensOf($('#launchButton')); TweenMax.killTweensOf($('#launchButtonSub')); // kill career box $('#careerBox').fadeOut(10); // hidePill(); resetClaim(); // resetAward(); // style2 $('#slice1').css({'opacity':'1','margin-top':rnd(130,200)+'px'}); $('#slice2').css({'opacity':'1','margin-top':rnd(130,200)+'px'}); $('#slice3').css({'opacity':'1','margin-top':rnd(130,200)+'px'}); $('#slice4').css({'opacity':'1','margin-top':rnd(130,200)+'px'}); $('#slice5').css({'opacity':'1','margin-top':rnd(130,200)+'px'}); $('#slice6').css({'opacity':'1','margin-top':rnd(130,200)+'px'}); $('#slice7').css({'opacity':'1','margin-top':rnd(-200,-130)+'px'}); $('#slice8').css({'opacity':'1','margin-top':rnd(-200,-130)+'px'}); $('#slice9').css({'opacity':'1','margin-top':rnd(-200,-130)+'px'}); $('#slice10').css({'opacity':'1','margin-top':rnd(-200,-130)+'px'}); $('#slice11').css({'opacity':'1','margin-top':rnd(-200,-130)+'px'}); $('#slice12').css({'opacity':'1','margin-top':rnd(-200,-130)+'px'}); // init der animierten linien $('#barT1').css({'left':'100%','opacity':'1'}); $('#barT2').css({'left':'50%','opacity':'1'}); $('#barB1').css({'right':'100%','opacity':'1'}); $('#barB2').css({'left':'100%','opacity':'1'}); $('#barL').css({'bottom':'100%','opacity':'1'}); $('#barR').css({'top':'100%','opacity':'1'}); $('#logo1').css({'opacity':'0'}); $('#logo2').css({'opacity':'0'}); $('#logooverlay').css({'opacity':'0'}); $('#launchButton,#launchButtonSub').css({'opacity':'0'}); // reset the award teaser TweenMax.set('#awardButtonWrapper', { opacity:0, scale:0, delay:0 }); TweenMax.set('#awardButton', { 'width':'32px', delay:0 }); TweenMax.set($('#awardButtonText'), { opacity:0, delay:0 }); } resetTitlePosition(); // first init function initTitle() { window.setTimeout(function() { $('#careerBox').fadeIn(500); tlcareerBlinky.play(); tlcareer.play(); }, 1000); window.setTimeout(function() { showClaim(); }, 500); // window.setTimeout(function() { showAward(); }, 3000); var speed = 1.5; var ease1 = 1.6; var ease2 = 0.8; TweenMax.to('#slice1', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0 }); TweenMax.to('#slice2', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.2 }); TweenMax.to('#slice3', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.3 }); TweenMax.to('#slice4', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.4 }); TweenMax.to('#slice5', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.5 }); TweenMax.to('#slice6', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.6 }); TweenMax.to('#slice7', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.55 }); TweenMax.to('#slice8', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.45 }); TweenMax.to('#slice9', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.35 }); TweenMax.to('#slice10', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.25 }); TweenMax.to('#slice11', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.2 }); TweenMax.to('#slice12', speed, { 'margin-top':'0px', ease:Elastic.easeOut.config(ease1, ease2), delay:0.15 }); var logoAnimInit = 1.2; TweenMax.to('#barT1', 0.5, { 'left':'70%', delay:logoAnimInit+0 }); TweenMax.to('#barT2', 0.4, { 'left':'0%', delay:logoAnimInit+0.1 }); TweenMax.to('#barB1', 0.5, { 'right':'60%', delay:logoAnimInit+0.2 }); TweenMax.to('#barB2', 0.6, { 'left':'50%', delay:logoAnimInit+0.3 }); TweenMax.to('#barL', 0.4, { 'bottom':'10px', delay:logoAnimInit+0.1 }); TweenMax.to('#barR', 0.6, { 'top':'10px', delay:logoAnimInit+0.2 }); TweenMax.to('#logo1', 1, { 'opacity':'1', delay:logoAnimInit+0 }); TweenMax.to('#logo2', 1, { 'opacity':'1', delay:logoAnimInit+0.5 }); TweenMax.to('#logooverlay', 2, { 'opacity':'1', delay:logoAnimInit+0 }); TweenMax.to('#launchButton', 1, { 'opacity':'0.9', delay:logoAnimInit+1.1 }); TweenMax.to('#launchButtonSub', 1, { 'opacity':'0.3', delay:logoAnimInit+1 }); // show navigation tlNavigation = new TimelineMax({paused:true, repeat:0, yoyo:false}); tlNavigation.add('label0', 1.4); // label zum init bei 0sec tlNavigation.to($('#menuStripDesktopTopBar'), 1.0, { 'width':'100%' }, 'label0+=0.0'); tlNavigation.to($('#menuStripDesktopBottomBar'), 1.0, { 'width':'100%' }, 'label0+=0.0'); tlNavigation.to($('#menuStripDesktopNavigation'), 0.5, { opacity:1 }, 'label0+=1.0'); tlNavigation.to($('#menuStripDesktopTopBar'), 0.5, { opacity:0.4 }, 'label0+=1.0'); tlNavigation.to($('#menuStripDesktopBottomBar'), 0.5, { opacity:0.4 }, 'label0+=1.0'); tlNavigation.to($('#menuStripDesktopPattern'), 0.5, { opacity:1.0 }, 'label0+=1.0'); tlNavigation.play(); // show award teaser tlAwardPill = new TimelineMax({paused:true, repeat:0, yoyo:false}); tlAwardPill.add('label0', 0); // label zum init bei 0sec tlAwardPill.set($('#awardButtonWrapper'), { opacity:0, scale:0 }, 'label0+=0.0'); tlAwardPill.to($('#awardButtonWrapper'), 0.3, { opacity:1, scale:1 }, 'label0+=1.7'); tlAwardPill.to($('#awardButton'), 0.7, { scale:1, 'width':($('#awardButtonTest').width()+36)+'px' }, 'label0+=2.1'); tlAwardPill.set($('#awardButtonText'), { 'display':'inline-block', opacity:0 }, 'label0+=3.0'); tlAwardPill.to($('#awardButtonText'), 0.7, { opacity:1 }, 'label0+=3.01'); tlAwardPill.play(); } // ENDE: init title // stage und menu bar var titleAnimAllowed = 0; $('#stage').bind('inview', function (event, visible) { if (visible == true && titleAnimAllowed==1) { initTitle(); } else { resetTitlePosition(); } }); var newsbox_first = 1; function showNewsBox() { var delay=0; if(newsbox_first == 1) { delay = 5; newsbox_first=0; } TweenMax.killTweensOf($('#newsbox')); tlnb = new TimelineMax(); tlnb.to('#newsbox', 0, { 'opacity':'0', delay:0 }); // tlnb.to('#newsbox', 0.3, { 'opacity':'1','right':'40px', delay:delay }); tlnb.to('#newsbox', 0.3, { 'opacity':'1', delay:delay }); } function hideNewsBox() { TweenMax.killTweensOf($('#newsbox')); tlnb = new TimelineMax(); // tlnb.to('#newsbox', 0.3, { 'right':'-380px','opacity':'0', delay:0 }); tlnb.to('#newsbox', 0.3, { 'opacity':'0', delay:0 }); } // bind chats to inview $('#fakten1').bind('inview', function (event, visible) { if (visible == true) { piePage1Anim(); } }); $('#circle10a').bind('inview', function (event, visible) { if (visible == true) { piePage2Anim(); } else { piePage2AnimReset(); } }); $('#circle20a').bind('inview', function (event, visible) { if (visible == true) { piePage3Anim(); } else { piePage3AnimReset(); } }); $('#moduleWerte').bind('inview', function (event, visible) { if (visible == true) { showWerte(); } else { hideWerte(); } }); // $('#barB1').bind('inview', function (event, visible) { if (visible == true && newsBoxAllowed==1) { showNewsBox(); } else { hideNewsBox(); } }); // ==================================== [ PIE CHARTS END] ==================================== // =============================================================================================== // =============================================================================================== // E N D I N V I E W H A N D L I N G // =============================================================================================== // =============================================================================================== // =============================================================================================== // =============================================================================================== // S T A R T S T A T I C H A N D L I N G // =============================================================================================== // =============================================================================================== // ajax-handling of newsbox /* $.post('ajax_news.php', { uid:0 }, function(data, status){ if(status == "success") { eval(data); } // alert("Data: " + data + "\nStatus: " + status); });*/ var firstnews = 1; var autoNews = 1; var newsUID = -1; var maxNews = 9; // create dots depending on maxnews for(var i=0; i < maxNews; i++) { $('#newsdotWrapper').append(' ' ); } function switchNews(uid) { newsUID = uid; $('#newsLoader').load('ajax_news.php?m=0&uid='+uid, function() { // wenn die news geladen sind, wird der inhalt kopiert var myHTML = $('#newsLoader').html(); var myHeight = $('#newsLoader').height() + 20; // +20 wg padding $(".newsbg").animate({'opacity':'0.001','height':myHeight+'px'}, 200); window.setTimeout(function() { $(".newsbg").html(myHTML); }, 400); window.setTimeout(function() { $(".newsbg").animate({'opacity':'1','height':myHeight+'px'}, 200); }, 410); // set the dot $('.newsdot').css({'background':'none'}); TweenMax.to($('#newsdot'+uid), 0, {'background-color':'rgba(255,255,255,0.0)'}); TweenMax.to($('#newsdot'+uid), 0.5, {'background-color':'rgba(255,255,255,1)'}); }); // END OF AJAX $('#newsLayerContent').load('ajax_news.php?m=1&uid='+uid); // fill shadowbox } // handling der newsdots $('.newsdot').click(function() { autoNews = 0; // disable switch var myID = $(this).attr('id'); myID = myID.replace("newsdot", ""); switchNews(myID); }); // hover handling $(".newsbg").hover(function(){ var myHTML = $('.newsbg').html(); var index = myHTML.indexOf('news_arrow.png'); if(index > 1) { $(this).css({'cursor':'pointer'}); } },function() { $(this).css({'cursor':''}); }); // click handling $(".newsbg").click(function(){ var myHTML = $('.newsbg').html(); var index = myHTML.indexOf('news_arrow.png'); if(index > 1) { hideNewsBox(); $('.newsLayerOuter').css({'display':'flex','opacity':'0'}).animate({'opacity':'1'}, 400); } }); $('.newsLayerOuter,#newsLayerButton').click(function() { showNewsBox(); $('.newsLayerOuter').animate({'opacity':'0'}, 400, function() { $(this).css({'display':'none'}); }); // re-init timeout if(autoNews == 1) { window.clearTimeout(newsTimeout); newsTimeout = window.setInterval(stepAutoNews, 7000); } return false; }); function stepAutoNews() { var rightPos = $('#newsbox').css('right'); var opacity = $('#newsbox').css('opacity'); var shadowOpen = $('.newsLayerOuter').css('display'); // if(autoNews == 1 && rightPos == "40px" && shadowOpen=="none") if(autoNews == 1 && opacity == 1 && shadowOpen=="none") { newsUID = newsUID + 1; if(newsUID > maxNews-1) { newsUID = 0; } switchNews(newsUID); } } // 5 sec warten, dann autoswitch starten window.setTimeout(function() { newsTimeout = window.setInterval(stepAutoNews, 7000); }, 5000); switchNews(0); // init first news on start // init first title function showLangSelect() { TweenMax.to('.langselectD,.langselectE', 1.0, { 'opacity':'1', delay:1.0 }); } window.setTimeout(function() { document.body.scrollTop = document.documentElement.scrollTop = 0; }, 100); // cross-browser scrolltop // UPDATE MAR-2019: SHOW ANIMATION WHEN *ALL* IMAGES ARE LOADED resetTitlePosition(); window.triggerWebsite = function() { if($.cookie('optIn') == "0" || $.cookie('optIn') == "1") { // normaler launch tllaunch = new TimelineMax({paused:true, repeat:0, yoyo:false}); tllaunch.add('label0', 0.0); // label zum init bei 0sec tllaunch.call(function() { initTitle(); showLangSelect(); }, null, null, 'label0+=0.1'); tllaunch.call(function() { titleAnimAllowed=1; }, null, null, 'label0+=0.5'); // tllaunch.call(function() { $('#careerBox').fadeIn(500); tlcareerBlinky.play(); tlcareer.play(); }, null, null, 'label0+=1.5'); tllaunch.play(); } else { var speed = 1.5; var ease1 = 1.6; var ease2 = 0.8; tllaunch = new TimelineMax({paused:true, repeat:0, yoyo:false}); tllaunch.add('label0', 0.0); // label zum init bei 0sec tllaunch.call(function() { blurElement('.blurworthy', 7, 0.5); }, null, null, 'label0+=0.1'); tllaunch.set('#cookieOverlay', { 'display':'flex', opacity:0 }, 'label0+=0.0' ); tllaunch.to('#cookieOverlay', 0.5, { opacity:1 }, 'label0+=0.0' ); tllaunch.to('#cookieOverlayInner', 1.0, { opacity:1 }, 'label0+=0.7' ); tllaunch.play(); } } // ENDE: trigger website // triggerWebsite(); // button $("#launchButton").hover(function(){ $('#launchButton,#launchButtonSub').css('cursor', 'pointer'); TweenMax.to('#launchButton', 0.6, { 'opacity':'1','rotation':'90', ease:Elastic.easeOut.config(1, 0.8), delay:0.0 }); TweenMax.to('#launchButtonSub', 0.6, { 'scale':'1.1', 'opacity':'0.3', ease:Elastic.easeOut.config(1, 0.8), delay:0 }); }, function(){ $('#launchButton,#launchButtonSub').css('cursor', ''); TweenMax.to('#launchButton', 0.6, { 'opacity':'0.9','rotation':'0', ease:Elastic.easeOut.config(1, 0.8), delay:0 }); TweenMax.to('#launchButtonSub', 0.6, { 'scale':'1.0', 'opacity':'0.3', ease:Elastic.easeOut.config(1, 0.8), delay:0 }); }); // launch button scroll $('#launchButton,#mobileArrowDown').click(function() { TweenMax.to(window, 0.2, { scrollTo:{y:"#swiperProfil", offsetY:80 }}); }); // fancypop normal $("a.picturepop").fancybox({ 'overlayShow':true, 'padding':0, 'speedIn':200, 'speedOut':200, 'overlayOpacity': 0.8, 'showNavArrows':true, 'cyclic':true, 'overlayColor':'#000000' }); // launch website after cookie function loadGAonConsent(){ window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-135747195-1', 'auto'); ga('set', 'anonymizeIp', true); ga('send', 'pageview'); var gascript = document.createElement("script"); gascript.async = true; gascript.src = "https://www.google-analytics.com/analytics.js"; document.getElementsByTagName("head")[0].appendChild(gascript, document.getElementsByTagName("head")[0]); } // cookie optin/decline $('#optInAccept').click(function() { $.cookie('optIn', '1'); tllaunch = new TimelineMax({paused:true, repeat:0, yoyo:false}); tllaunch.add('label0', 0.0); // label zum init bei 0sec tllaunch.call(function() { blurElement('.blurworthy', 0, 0.6); }, null, null, 'label0+=0.0'); tllaunch.to($('#cookieOverlay'), 0.6, { opacity:0 }, 'label0+=0.0'); tllaunch.set($('#cookieOverlay'), { 'display':'none' }, 'label0+=0.3'); tllaunch.call(function() { initTitle(); showLangSelect(); }, null, null, 'label0+=0.0'); tllaunch.call(function() { titleAnimAllowed=1; }, null, null, 'label0+=0.5'); tllaunch.play(); return false; }); $('#optInDecline').click(function() { // $.cookie('optIn', '0'); tllaunch = new TimelineMax({paused:true, repeat:0, yoyo:false}); tllaunch.add('label0', 0.0); // label zum init bei 0sec tllaunch.call(function() { blurElement('.blurworthy', 0, 0.6); }, null, null, 'label0+=0.0'); tllaunch.to($('#cookieOverlay'), 0.6, { opacity:0 }, 'label0+=0.0'); tllaunch.set($('#cookieOverlay'), { 'display':'none' }, 'label0+=0.3'); tllaunch.call(function() { initTitle(); showLangSelect(); }, null, null, 'label0+=0.0'); tllaunch.call(function() { titleAnimAllowed=1; }, null, null, 'label0+=0.5'); tllaunch.play(); return false; }); if($.cookie('optIn') == "1") { loadGAonConsent(); } // =============================================================================================== // =============================================================================================== // E N D S T A T I C H A N D L I N G // =============================================================================================== // =============================================================================================== }); // END: $(document).ready(function() [...]