PageSourceSearch

https://www.netinventors.de/fileadmin/app/netinventors/js/core.js?1599649874

js netinventors.de collected 2026-10-05 03:47:30 UTC 13,980 bytes, 426 lines download raw bytes

1// Console Log Helper
2if (!window.console) console = {log: function() {}};
3jQuery(document).ready(function() {
4    /* Redirect, if we are not on the root page */
5    if ('true' === $('body').attr('data-redirect')) {
6        var $currentPath = window.location.pathname.substring(1);
7        $(location).attr('href', '/#' + $currentPath.replace(/^\/+|\/+$/g, ''));
8    }
9
10    /* Redirect */
11
12    onePageNav.init("a[data-target=content]", ".pHeader", -32);
13
14    contentModal.init("a[data-target=modal], a[data-target=node]", function (frwrk) {
15        onePageNav.clickEventTriggered = true;
16        addCloseButton($(this), frwrk);
17        var hash = $(this).attr('href').replace(/^\/+|\/+$/g, '');
18        history.pushState('', 'one-pager', '#' + hash);
19    });
20
21    function addCloseButton(element, frwrk){
22        var node = $(element.data('node'));
23        // Add close Button
24        node.find('.csc-header.csc-header-n1')
25            .append('<div class="closeNode"><i class="fa fa-times-circle"></i></div>');
26
27        // FadeIn NodeContent
28        node.slideDown('fast');
29
30        //ScrollTo NotePos
31        var nodePos = node.offset().top;
32        TweenMax.to($(window), 1, {
33            scrollTo:{
34                y: nodePos - 150,
35                autoKill: true
36            },
37            onComplete: function () {
38                onePageNav.clickEventTriggered = false;
39            },
40            ease: Power3.easeOut
41        });
42
43        // Add Close Click Function
44        $('.closeNode').click(function() {
45            node.slideUp('slow', function () {
46                node.html('');
47                node.css('display', 'block');
48            });
49        });
50    }
51
52    // ShowCase
53    netinventors.showCase('nav.pageTeaser ul', {
54        'itemSelector': 'li',
55        //'layoutMode': 'fitRows',
56        'filter': '.page-1',
57        'masonry': {
58            'columnWidth': 267,
59            'gutter': 24
60        }
61    });
62
63
64    // ScrollMagic
65    // init ScrollMagic controller
66    var controller = new ScrollMagic.Controller();
67    var heroHeight = $('section#pid-1').height();
68
69
70    //
71    //// scale header and move logo
72    //
73    //var header = new ScrollMagic.Scene({ triggerElement: "#pid-1", duration: heroHeight, triggerHook: 'onLeave' })
74    //    // animate color and top border in relation to scroll position
75    //    .setTween(new TimelineMax().add([
76    //        TweenMax.to(".pHeader", 1, {backgroundColor:"rgba(0,0,0,0.9)", ease: Linear.easeNone}),
77    //        TweenMax.to("#sideBar", 1, {backgroundColor:"rgba(0,0,0,0.9)", ease: Linear.easeNone}),
78    //        //TweenMax.to(".pHeader .holder", 1, { height:60, ease: Linear.easeNone }),
79    //        //TweenMax.to(".logo.main", 1, { top:10, ease: Linear.easeNone })
80    //    ]))
81    //
82    //    //.addIndicators()
83    //    .addTo(controller);
84
85    // animate Hero
86    var animateHero = new ScrollMagic.Scene({
87            triggerElement: "section#pid-1",
88            duration: heroHeight,
89            triggerHook: 'onLeave'
90        })
91        .setTween(new TimelineMax().add([
92            TweenMax.to("section#pid-1 #c80", 1, { opacity:0.1,y:100,ease: Linear.easeNone }),
93            TweenMax.to(".device.macBook", 1, { y:-300,ease: Linear.easeNone })
94        ]))
95        //.addIndicators({name: "test", colorEnd: "#FF0000"})
96        .addTo(controller);
97
98    // Elevator
99    var elevator = new ScrollMagic.Scene({
100        triggerElement: "section#pid-1",
101        duration: heroHeight,
102        triggerHook: 'onLeave'
103        })
104        .setTween(new TimelineMax().add([
105            TweenMax.fromTo("#elevator", 1, {opacity:0,y:-50},{opacity:1,y:0}),
106
107        ]))
108        //.addIndicators({name: "test", colorEnd: "#FF0000"})
109        .addTo(controller);
110
111    // ShowOffCounter
112    var showOffCounter = new ScrollMagic.Scene({triggerElement: "section#pid-5",reverse:false,offset: -100})
113        .on('enter', function (event) {
114            counter.init("[data-special=counter]");
115        })
116
117        //.addIndicators({name: "ShowOFF", colorEnd: "#FF0000"})
118        .addTo(controller);
119
120    // ClientsFadeIn
121    //var clientsHeight = $('section#pid-7').height();
122    //var clientsFadeIn = new ScrollMagic.Scene({
123    //        triggerElement: "section#pid-7",
124    //        duration: 400,
125    //        triggerHook: 'onEnter',
126    //        offset:-100
127    //    })
128    //    .setTween(new TimelineMax().add([
129    //        TweenMax.staggerFrom("section#pid-7 .item", 2, {opacity:0,delay:0.5}, 0.2)
130    //    ]))
131    //
132    //    .addIndicators({name: "clientsFadeIn", colorEnd: "#FF0000"})
133    //    .addTo(controller);
134
135    // Animate H1 Headlines
136    $('section.page').each(function(index, element) {
137        if (onePageNav.clickEventTriggered) {
138            return;
139        }
140
141        var $element = $(element),
142            elementHeight = $element.height(),
143            animateHeadlines = new ScrollMagic.Scene({
144                    triggerElement: $element,
145                    duration: 200,
146                    triggerHook: 'onEnter',
147                    offset: 0
148                })
149
150                //.on('enter', function (event) {
151                //    console.log('Hallo');
152                //})
153
154                .setTween(new TimelineMax().add([
155                    TweenMax.fromTo($element.find('h2'), 1, {opacity:0}
155,{y:0,opacity:1})
156                ]))
157
158                //.addIndicators({name: "test", colorEnd: "#FF0000"}),
159                .addTo(controller);
160    });
161
162    // Update Navi and pushState on Scroll
163    // dependencies: ScrollMagic
164    // TODO: Refactor in OnePageNav.JS
165    $('section.page').each(function(index, element) {
166        var $element = $(element),
167            elementHeight = $element.height(),
168            triggerSection = new ScrollMagic.Scene({
169                    triggerElement: $element,
170                    duration: elementHeight,
171                    triggerHook: 'onLeave',
172                    offset: -200
173                })
174                .addTo(controller)
175                //.addIndicators({name: "Trigger", colorEnd: "#FF0000"})
176                .on('enter', function (event) {
177                    // get current page
178                    var currentPage = $element.attr('data-rel');
179
180                    // console.log(currentPage);
181
182                    // remove cur from other items
183                    $('a[data-rel]').removeClass('cur');
184
185                    // set cur for current item
186                    $('a[data-rel="' + currentPage + '"]').addClass('cur');
187
188                    //console.log(onePageNav.clickEventTriggered);
189                    if (onePageNav.clickEventTriggered) {
190                        return true;
191                    }
192
193                    // get current link from item and set push state
194                    var hash = $('a[data-rel="' + currentPage + '"]').attr('href');
195                    if (hash) {
196                        hash = hash.replace(/^\/+|\/+$/g, '');
197                        history.pushState('', 'one-pager' , '#' + hash);
198                    //} else {
199                        //hash = '';
200                        //console.log('Sorry, no target link item found - perhaps we are on the root page?');
201                        //history.pushState('', hash, '/');
202                    }
203                });
204    });
205
206    //$('section.page').each(function(index, element) {
207    //    var $element = $(element),
208    //        elementHeight = $element.height(),
209    //        animateSection = new ScrollMagic.Scene({triggerElement: $element, duration: elementHeight, triggerHook: 'onLeave', offset: 100 })
210    //
211    //            .setTween(new TimelineMax().add([
212    //                TweenMax.to($element.find('.cElement'), 1, {opacity:0.1,y:100,ease: Linear.easeNone})
213    //            ]))
214    //
215    //            .addTo(controller)
216    //            .addIndicators({name: "test", colorEnd: "#FF0000"});
217    //});
218
219    // NEWS
220
221    $('.news a').click(function (event) {
222        event.preventDefault();
223
224        var $this = $(this),
225            url   = $this.attr('href');
226
227        if (-1 === url.indexOf('?')) {
228            url += '?';
229        } else {
230            url += '&';
231        }
232
233        var newsList = $('#c8');
234        var context = $("#newsDetail");
235
236        onePageNav.clickEventTriggered = true;
237
238        context.slideUp('fast', loadContent);
239
240        $('.newsLoader').remove();
241
242        $this.closest('.article').find('.csc-header').append('<div class="newsLoader">LOADING...</div>');
243
244        $('.newsLoader').fadeIn('normal');
245
246        function loadContent() {
247            $.get(url + 'type=5000', function (xhr) {
248                context.html(xhr.content);
249                showNewContent();
250                var hash = $this.attr('href').replace(/^\/+|\/+$/g, '');
251                history.pushState('', 'one-pager' , '#' + hash);
252                scrollToTarget(context, -100, function () {
253                    onePageNav.clickEventTriggered = false;
254                });
255                addCloseLink();
256            });
257        }
258
259        function addCloseLink(){
260            $('.news.news-single .csc-header').append('<div class="closeNode"><i class="fa fa-times-circle"></i></div>');
261            $('.news.news-single .closeNode').click(function() {
262                context.slideUp('fast', function () {
263                    context.html('');
264                    context.css('display', 'block');
265                });
266                onePageNav.clickEventTriggered = true;
267                history.pushState('', 'one-pager' , '#news');
268                scrollToTarget(newsList, -100, function () {
269                    onePageNav.clickEventTriggered = false;
270                });
271            });
272        }
273
274        function scrollToTarget(target, offset, callback){
275            var posy = target.offset().top;
276
277            if (offset === undefined) {
278                offset = 0;
279            }
280
281            TweenMax.to($(window), 1, {
282                scrollTo:{
283                    y: posy + offset,
284                    autoKill: true
285                },
286                onComplete: function () {
287                    if ('function' === typeof callback) {
288                        callback.call();
289                    }
290                },
291                ease:Power3.easeOut
292            });
293        }
294
295        function showNewContent() {
296            context.slideDown('normal', hideLoader());
297        }
298
299        function hideLoader() {
300            $('.newsLoader').fadeOut('normal');
301        }
302
303        return false;
304    });
305
306
307    // Loader
308    var images = $('img');
309    var totalElements = images.length;
310    var count = 0;
311    var indicator = $('.indicator');
312
313    //console.log('Loader: Total Elements : ' + totalElements);
314
315    images.each(function() {
316        var img = new Image();
317        img.onload = function() {
318            //console.log($(this).attr('src') + ' - done!');
319            count ++;
320            //console.log(count + 'von'  + totalElements );
321            //$('.indicator').css(
322            //    'width',
323            //    parseInt(count * (100 / totalElements)) + '%'
324            //);
325            var indicatorPosPercentage = parseInt(count * (100 / totalElements)) + '%';
326            TweenMax.to(indicator, 2, { css:{ width: indicatorPosPercentage },ease: Circ.easeOut });
327        };
328        img.src = $(this).attr('src');
329    });
330
331    ///// LOADER FINISH ////
332
333
334    // ResponsiveNav
335    function toggleAB(){
336        var el = this; // `this` is the "button" Element Obj reference`
337        return [
338            function() {
339                console.log('close');
340                //TweenMax.to("#mainWrap", .25, { right:0,ease: Sine.easeOut});
341                TweenMax.to("#sideBar", .25, { autoAlpha:0,ease: Sine.easeOut});
342
343
344            },
345            function() {
346                console.log('Open');
347
348                //TweenMax.to("#mainWrap", .25, { right:260,ease: Sine.easeOut});
349                //TweenMax.to("#sideBar", .25, { autoAlpha:1,ease: Sine.easeOut});
350                TweenMax.fromTo("#sideBar", .25, {y:'-=20px'},{autoAlpha:1,y:'+=20',ease: Sine.easeOut});
351
352            }
353        ][el.tog^=1]();
354    }
355
356    $("#toggleNav a").click(function( event ) {
357        event.preventDefault();
358        toggleAB();
359    });
360
361
362    //ssm.addState({
363    //    id: 'mobile',
364    //    query: '(min-width: 767px)',
365    //    onEnter: function(){
366    //        console.log('enter mobile');
367    //    }
368    //});
369
370    var elevator = new Audio('/fileadmin/app/netinventors/res/music/elevator.mp3');
371    var ding     = new Audio('/fileadmin/app/netinventors/res/music/ding.mp3');
372
373    $('#elevator').bind('click', function (event) {
374        TweenMax.to(window, 4, {
375            scrollTo:{y:0},
376            onStart: function(){
377                elevator.currentTime = 1;
378                elevator.play();
379            },
380            onComplete: function(){
381                elevator.pause();
382                ding.currentTime = 0;
383                ding.play();
384            },
385            ease:Power2.easeOut
386        });
387    });
388
389
390    (function($) {
391        //LightBox
392        jQuery("a[data-action=openLightBox]").fancybox({
393            openEffect: 'fade',
394            nextEffect: 'fade',
395            prevEffect: 'fade',
396            maxWidth:   '1024',
397            helpers : {
398                title: {
399                    type: 'inside'
400                }
401            },
402            beforeShow : function() {
403                var alt = this.element.find('img').attr('alt');
404                //this.inner.find('img').attr('alt', alt);
405                this.title = alt;
406            }
407        });
408
409        //initNIAccordion(
410        //    "section[data-toggle=true]",
411        //    ".csc-header",
412        //    ".csc-header + div"
413        //);
414    })(jQuery);
415});
416
417
418///* niAccordion */
419//function initNIAccordion(param1, param2, param3){
420//    $(param1).accordion({
421//        'speed': 600,
422//        'closeOthers': false,
423//        'tabs': param2,
424//        'panes': param3
425//    })
426//}

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.