PageSourceSearch

https://www.hannes-reichelt.com/website/static/js/init.js?v=1790000406

js hannes-reichelt.com collected 2026-09-25 07:01:05 UTC 17,879 bytes, 565 lines download raw bytes

1var init = {
2
3  xlScreen: $(window).width() >= 1590 ? true : false,
4  lgScreen: $(window).width() < 1590 ? true : false,
5  mdScreen: $(window).width() < 1200 ? true : false,
6  smScreen: $(window).width() < 992 ? true : false,
7  xsScreen: $(window).width() < 768 ? true : false,
8
9  init: function() {
10    
11    if (!editmode) {
12      init.externalLinks();
13      init.scrollToElement();
14
15      if (!init.xsScreen) 
16        init.sameHeigtResizer();
17      
18      init.linkEntireBox();
19      init.eventTracking();
20
21      if ($('.rev_slider').length > 0) 
22        init.sliderRevolution();
23
24      init.cookieNotice();
25      init.jQuerySwipebox();
26
27      // NAVIGATION
28      init.mobileNavigation();
29      if (home) init.scrollNavigation();
30
31      // BOOTSTRAP
32      init.bootstrapTooltip();
33
34      init.logoAnimation();
35      init.contentBlockAnimation();
36      init.socialStream();
37      init.interactiveMovement();
38
39      init.navigation();
40      init.hideHeaderOnScroll();
41    }
42  },
43
44  externalLinks: function() {
45    $('#content a').each(function() {
46      if ($(this).attr('target') == '_blank') {
47        if ($(this).attr('rel')) {
48          $(this).attr('rel', $(this).attr('rel')+' noopener');
49        } else {
50          $(this).attr('rel', 'noopener');
51        }
52      }
53    });
54  },
55
56  navigation: function() {
57    $(window).load(function() {
58      $('#scroll-navigation ul > li').each(function(i){
59        var item = $(this);
60        setTimeout(function() {
61          item.removeClass('invisible').addClass('visible animated zoomIn');
62        }, 300*i);
63      });
64    });
65
66    $('#open-navigation').click(function() {
67      $('#header').toggleClass('header-up');
68    });
69  },
70
71  hideHeaderOnScroll: function() {
72    if (init.xsScreen) {
73      $('#header').addClass('header-up');
74    } else {
75      $(window).scroll(function() {
76        if ($(this).scrollTop()>0) {
77          $('#header').addClass('header-up');
78        } else {
79          $('#header').removeClass('header-up');
80        }
81      });
82    }
83
84
85
86    // var didScroll;
87    // var lastScrollTop = 0;
88    // var delta = 5;
89    // var navbarHeight = $('#header').outerHeight();
90
91    // $(window).scroll(function(event){
92    //   didScroll = true;
93    // });
94
95    // setInterval(function() {
96    //   if (didScroll) {
97    //     hasScrolled();
98    //     didScroll = false;
99    //   }
100    // }, 250);
101
102    // function hasScrolled() {
103    //   var st = $(this).scrollTop();
104
105    //   if (Math.abs(lastScrollTop - st) <= delta)
106    //     return;
107
108    //   if (st > lastScrollTop && st > navbarHeight){
109    //     $('#header').removeClass('header-down').addClass('header-up');
110    //   } else {
111    //     if(st + $(window).height() < $(document).height()) {
112    //       $('#header').removeClass('header-up').addClass('header-down');
113    //     }
114    //   }
115      
116    //   if (st > 0 && !init.smScreen) {
117
118    //   } else {
119    //     $('#header').removeClass('header-down');
120    //   }
121
122    //   lastScrollTop = st;
123    // }
124  },
125
126  interactiveMovement: function() {
127    // http://psdblast.com/flat-color-abstract-city-background-psd
128    $(window).on('mousemove', function(e) {
129      var w = $(window).width();
130      var h = $(window).height();
131      var offsetX = 0.5 - e.pageX / w;
132      var offsetY = 0.5 - e.pageY / h;
133
134      $(".parallax").each(function(i, el) {
135        var offset = parseInt($(el).data('offset'));
136        var translate = "translate3d(" + Math.round(offsetX * offset) + "px," + Math.round(offsetY * offset) + "px, 0px)";
137
138        $(el).css({
139          '-webkit-transform': translate,
140          'transform': translate,
141          'moz-transform': translate
142        });
143      });
144    });
145  },
146
147  scrollToElement: function() {
148    $('a[href*="#"]:not([href="#"])').click(function() {
149      if (!$(this).hasClass('inline') && $(this).data('toggle') != 'collapse') {
150        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
151          var target = $(this.hash);
152          target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
153          if (target.length) {
154            $('html,body').animate({
155              scrollTop: target.offset().top
156            }, 1500);
157            return false;
158          }
159        }
160      }
161    });
162  },
163
164  contentBlockAnimation: function() {
165    $(document).ready(function() {
166      $('.content-block').each(function() {
167        if ($(this).data('animation') != 'none') {
168          $(this).addClass('invisible').viewportChecker({
169            classToAdd: 'visible animated '+$(this).data('animation'),
170            classToRemove: 'invisible',
171            offset: 100
172          });
173        }
174      });
175
176      $('#ueber-mich .pull-right, #about .pull-right, #tiroler-krebsforschungsinstitut .pull-right').addClass('invisible').viewportChecker({
177        classToAdd: 'visible animated fadeInRight',
178        offset: 400
179      });
180      $('#ueber-mich .content-image, #about .content-image, #tiroler-krebsforschungsinstitut .content-image').addClass('invisible').viewportChecker({
181        classToAdd: 'visible animated fadeInLeft',
182        offset: 100
183      });
184      $('#social-media h2, #partner h2, #partner .partner').addClass('invisible').viewportChecker({
185        classToAdd: 'visible animated zoomIn',
186        offset: 100
187      });
188    });
189  },
190
191  socialStream: function() {
192    // $('#social-stream').viewportChecker({
193    //   offset: 200,
194    //   callbackFunction: function() {
195        $('#social-stream').dcSocialStream({
196          feeds: {
197            // facebook: {
198            //   id: '119251758135298',
199            //   url: '/website/static/social-stream/facebook.php'
200            // },
201            instagram: {
202              accessToken: '361580672.c14c0bf.b016538205754a4bb2d6946993231ba0',
203              clientId: 'c14c0bfb649a49038edeeb48f3568960',
204              id: '!361580672'
205            },
206          },
207          rotate: {
208            delay: 0
209          },
210          control: false,
211          filter: false,
212          wall: true,
213          days: init.xsScreen ? 60 : 120,
214          // order: 'random',
215          iconPath: 'images/dcsns-dark/',
216          imagePath: 'images/dcsns-dark/',
217          style: {
218            layout: 'modern'
219          },
220          dates: 'Minute,Minuten,Stunde,Stunden,Tag,Tage,Woche,Wochen,Monat,Monate,Jahr,Jahre',
221        });
222    //   }
223    // });
224  },
225
226  bootstrapTooltip: function() {
227    $('[data-toggle="tooltip"]').tooltip();
228  },
229
230  logoAnimation: function() {
231    $(window).load(function() {
232      setTimeout(function() {
233        $('#logo .logo-icon').addClass('zoom').delay(2000).queue(function(next) {
234          $(this).removeClass('zoom');
235          next();
236        });
237      }, 3000);
238    });
239  },
240
241  jQuerySwipebox: function() {
242    $('.swipebox').swipebox({
243      useCSS : true, // false will force the use of jQuery for animations
244      useSVG : true, // false to force the use of png for buttons
245      initialIndexOnArray : 0, // which image index to init when a array is passed
246      hideCloseButtonOnMobile : false, // true will hide the close button on mobile devices
247      hideBarsDelay : 3000, // delay before hiding bars on desktop
248      videoMaxWidth : 1140, // videos max width
249      beforeOpen: function() {}, // called before opening
250      afterOpen: null, // called after opening
251      afterClose: function() {}, // called after closing
252      loopAtEnd: false, // true will return to the first image after the last image is
253      removeBarsOnMobile: false
254    });
255  },
256
257  sameHeigtResizer: function() {
258    var heightGroups = {},
259        s = {
260          sameHeightItems: '[data-height-group]',
261          heightGroup: 'height-group',
262          activeClass: 'has-fixed-height'
263        };
264
265    function initSameHeight() {
266      $(s.sameHeightItems).each(function () {
267        var groupName = $(this).data(s.heightGroup);
268        if (!heightGroups[groupName]) {
269          heightGroups[groupName] = $(['*[data-',s.heightGroup, '=',groupName ,']'].join(''));
270        }
271      });
272
273      for (var group in heightGroups) {
274        resizeGroupe(group);
275      }
276    }
277
278    function resizeGroupe(groupeName) {
279      var group = heightGroups[groupeName],
280        maxHeight = 0;
281      for (var i= 0, item; item = group[i]; i++) {
282        maxHeight = Math.max($(item).outerHeight(), maxHeight);
283      }
284      group.css('height', [maxHeight, 'px'].join(''));
285      group.addClass(s.activeClass);
286    }
287
288    $(window).load(function() {
289      initSameHeight();
290    });
291  },
292
293  linkEntireBox: function() {
294    $('.linked-box').click(function() {
295      var link = $(this).find('a').first(),
296          href = link.attr('href'),
297          target = link.attr('target');
298
299      if (target === '_blank') {
300        window.open(href);
301      } else {
302        window.location.href = href;
303      }
304    });
305  },
306
307  scrollNavigation: function() {
308    $(document).ready(function(){
309      /**
310       * This part handles the highlighting functionality.
311       * We use the scroll functionality again, some array creation and 
312       * manipulation, class adding and class removing, and conditional testing
313       */
314      var aChildren = $("#scroll-navigation li").children(); // find the a children of the list items
315      var aArray = []; // create the empty aArray
316      for (var i=0; i < aChildren.length; i++) {    
317        var aChild = aChildren[i];
318        var ahref = $(aChild).attr('href');
319
320        // ony the anchor
321        ahref = ahref.substring(ahref.indexOf('#') + 1);
322
323        aArray.push(ahref);
324      } // this for loop fills the aArray with attribute href values
325      
326      $(window).scroll(function(){
327        var windowPos = $(window).scrollTop(); // get the offset of the window from the top of page
328        var windowHeight = $(window).height(); // get the height of the window
329        var docHeight = $(document).height();
330        
331        for (var i=0; i < aArray.length; i++) {
332          var theID = aArray[i];
333          
334          if (theID && $(theID).length > 0) {
335            var divPos = $(theID).offset().top; // get the offset of the div from the top of page
336            var divHeight = $(theID).height(); // get the height of the div in question
337            if (windowPos >= divPos && windowPos < (divPos + divHeight)) {
338              $("a[href='" + theID + "']").addClass("active");
339            } else {
340              $("a[href='" + theID + "']").removeClass("active");
341            }
342          }
343        }
344        
345        if(windowPos + windowHeight == docHeight) {
346          if (!$("#scroll-navigation li:last-child a").hasClass("active")) {
347            var navActiveCurrent = $(".active").attr("href");
348            $("a[href='" + navActiveCurrent + "']").removeClass("active");
349            $("#scroll-navigation li:last-child a").addClass("active");
350          }
351        }
352      });
353    });
354  },
355
356  mobileNavigation: function() {
357
358    var body = $('body'),
359        mask = '<div class="mobile-mask" />',
360        closeNavigation = '<div id="close-mobile-navigation"><span class="icon-cross"></span></div>';
361
362    // open navigation
363    $('#open-mobile-navigation').on('click', function() {
364      body.addClass('menu-open');
365      body.append(mask);
366      body.append(closeNavigation);
367      activeNav = 'menu-open';
368    });
369
370    // close navigation
371    $(document).on('click', '.mobile-mask, #close-mobile-navigation', function() {
372      body.removeClass(activeNav);
373      activeNav = '';
374      $('.mobile-mask').remove();
375      $('#close-mobile-navigation').remove();
376    });
377
378    $(document).on('click', '#mobile-navigation li.has-childs > a', function(e) {
379      e.preventDefault();
380      if (!$(this).hasClass('back'))
381        $(this).closest('ul').addClass('inactive');
382
383      $(this).parent().find('.sub-navigation').first().addClass('active');
384    });
385
386    $(document).on('click', '.menu-item-back', function(e) {
387      e.preventDefault();
388      $(this).closest('.sub-navigation').parent().parent().removeClass('inactive');
389      $(this).closest('.sub-navigation').removeClass('active');
390    });
391
392  },
393
394  eventTracking: function() {
395
396    $('body').on('click', '.track-event', function(e) {
397      if ($(e.target).is('a')) {
398        e.preventDefault();
399        var href = $(this).attr('href'),
400            target = $(this).attr('target');
401      }
402
403      try {
404        dataLayer.push({
405          'event'         : 'TrackEvent',
406          'eventCategory' : $(this).data('track-category'),
407          'eventAction'   : $(this).data('track-action'),
408          'eventLabel'    : $(this).data('track-label'),
409          'eventValue'    : ($(this).data('track-value') ? $(this).data('track-value') : 0)
410        });
411      } catch (error) {
412
413      } finally {
414        if ($(e.target).is('a')) {
415          if ($(e.target).data('toggle') != 'tab' && $(e.target).attr('href') !== "#") {
416            if (href) {
417              window.open(href,(!target ? '_self' : target));
418            }
419          }
420        }
421      }
422    });
423  },
424
425  sliderRevolution: function() {
426
427
428    $('.rev_slider').each(function() {
429      var revapi;
430      var revSliderId = '#'+$(this).attr('id');
431
432
433      $(window).load(function() {
434        if ($(revSliderId).revolution == undefined) {
435          revslider_showDoubleJqueryError(revSliderId);
436        } else {
437          revapi = $(revSliderId).show().revolution({
438            sliderType: 'standard',
439            jsFileLocation: '/website/static/slider-revolution/revolution/js/',
440            sliderLayout: $(revSliderId).data('slider-layout'),
441            dottedOverlay: 'none', // none, twoxtwo, twoxtwowhite, threexthree, threexthreewhite
442            delay: 5000,
443            minHeight: $(revSliderId).data('min-height') == '100%' ? $(revSliderId).parent().height() : $(revSliderId).data('min-height'),
444            fullScreenOffsetContainer: $(revSliderId).data('full-screen-offset-container') ? $(revSliderId).data('full-screen-offset-container') : '',
445            navigation: {
446              keyboardNavigation:"off",
447              keyboard_direction: "horizontal",
448              mouseScrollNavigation:"off",
449              mouseScrollReverse: "default",
450              onHoverStop: "off",
451              touch:{
452                touchenabled:"on",
453                swipe_threshold: 75,
454                swipe_min_touches: 1,
455                swipe_direction: "horizontal",
456                drag_block_vertical: false
457              }
458              ,
459              // arrows: {
460              //   style:"zeus",
461              //   enable:true,
462              //   hide_onmobile:true,
463              //   hide_under:600,
464              //   hide_onleave:true,
465              //   hide_delay:200,
466              //   hide_delay_mobile:1200,
467              //   tmp:'<div class="tp-title-wrap">    <div class="tp-arr-imgholder"></div> </div>',
468              //   left: {
469              //     h_align:"left",
470              //     v_align:"center",
471              //     h_offset:30,
472              //     v_offset:0
473              //   },
474              //   right: {
475              //     h_align:"right",
476              //     v_align:"center",
477              //     h_offset:30,
478              //     v_offset:0
479              //   }
480              // }
481              // ,
482              bullets: {
483                enable: $(revSliderId).data('bullets-enable'),
484                // hide_onmobile:true,
485                // hide_under:600,
486                // style:'hermes',
487                hide_onleave: false,
488                // hide_delay:200,
489                // hide_delay_mobile:1200,
490                direction: 'horizontal',
491                h_align: 'right',
492                v_align: 'bottom',
493                h_offset: init.xsScreen ? 30 : 60,
494                v_offset: init.xsScreen ? 30 : 60,
495                space: init.xsScreen ? 5 : 15,
496                // tmp:'<span class="tp-bullet-img-wrap">  <span class="tp-bullet-image"></span></span><span class="tp-bullet-title">{{title}}</span>'
497              }
498            },
499            viewPort: {
500              enable: true,
501              outof: 'wait',
502              visible_area: '80%',
503              presize: true
504            },
505            responsiveLevels:[1590,1200,992,768],
506            visibilityLevels:[1590,1200,992,768],
507            gridwidth:[1560,1170,750,480],
508            gridheight:[600,600,500,400],
509            lazyType:"none",
510            parallax: {
511              type:"mouse",
512              origo:"slidercenter",
513              speed:2000,
514              levels:[2,3,4,5,6,7,12,16,10,50,46,47,48,49,50,55],
515              type:"mouse",
516            },
517            shadow:0,
518            spinner:"off",
519            stopLoop:"off",
520            stopAfterLoops:-1,
521            stopAtSlide:-1,
522            shuffle:"off",
523            autoHeight:"off",
524            hideThumbsOnMobile:"off",
525            hideSliderAtLimit:0,
526            hideCaptionAtLimit:0,
527            hideAllCaptionAtLilmit:0,
528            debugMode:false,
529            fallbacks: {
530              simplifyAll:"off",
531              nextSlideOnWindowFocus:"off",
532              disableFocusListener:false,
533            }
534          });
535
536          revapi.bind('revolution.slide.onloaded', function() {
537            $('#top-slider').css({'min-height': '0'});
538
539            setTimeout(function() {
540              $('#top-slider .logo-icon').addClass('zoom').delay(1000).queue(function(next) {
541                $(this).removeClass('zoom');
542                next();
543              });
544            }, 1500);
545          });
546        }
547      });
548    });
549  },
550
551  cookieNotice: function () {
552    if (localStorage.getItem('pc-cookie-accepted') === null) {
553      // cookie notice is displayed
554      $('body').addClass('cookie-notice-visible');
555    }
556
557    $(document).on('click', '#pc-button button', function () {
558      $('body').removeClass('cookie-notice-visible');
559    });
560  }
561};
562
563$(function () {
564  init.init();
565});

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.