PageSourceSearch

https://www.leoninestudios.com/_assets/3e361dc5d434cdafdd36fc50c041c59b/JavaScript/script.js?1790586617

js leoninestudios.com collected 2026-10-02 10:57:11 UTC 19,536 bytes, 697 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function(event) {
2    console.log('overlay module loaded');
3    ajaxPagination.init();
4    benefits.init();
5    filterJob.init();
6    header.init();
7    imageProtection.init();
8    insightsSlider.init();
9    insightsSliderMobile.init();
10    loadMore.init();
11    overlay.init();
12    overlayVita.init();
13    searchJob.init();
14    slider.init();
15    trailerPopup.init();
16
17    AOS.init({
18        duration: 1200,
19    });
20});
21
22const benefits = (() => {
23        function init(){
24            const titleElements = document.querySelectorAll('.jsc-benefits-title');
25            let maxHeight = 0;
26
27            for (const el of titleElements
28                ) {
29                if (el.offsetHeight > maxHeight) {
30                    maxHeight = el.offsetHeight;
31                }
32            }
33
34            for (const title of titleElements) {
35                title.style.height = maxHeight + 'px';
36            }
37
38        }
39        return{
40            init: init,
41        }
42})();
43
44
45const ajaxPagination = (() => {
46
47    function init(){
48        const newsAjax = document.querySelector('.jsc-news-ajax');
49
50        if(newsAjax !== null){
51            newsAjax.addEventListener('click', () => {
52               _load()
53        })}
54
55        function _load(element){
56            let uri = element.getAttribute('data-ajaxuri');
57            let destination = element.getAttribute('data-ajaxresponsedestclass');
58
59            element.style.display = 'none';
60
61            let ajax = new XMLHttpRequest();
62            ajax.onreadystatechange = function() {
63                if (this.readyState == 4 && this.status == 200) {
64                    let newsHtml = GeneralUtility.createElementFromHTML(this.responseText);
65                    document.querySelector('.' + destination).appendChild(newsHtml);
66                }
67            };
68
69            ajax.open("GET", uri, true);
70            ajax.send();
71        }
72    }
73    return{
74        init: init,
75    }
76})();
77
78
79const filterJob = (() => {
80    function init(){
81        const filterJob = document.querySelector('.jsc-filter-job');
82        if(filterJob !== null){
83            filterJob.addEventListener('change', () => {
84                _filter();
85            })
86        }
87
88        function _filter(element){
89            const searchInput = document.querySelector('.jsc-find-job').value.toUpperCase();
90            const filter = searchInput.toUpperCase();
91            const table = document.querySelector(".jsc-table"),
92                tr = document.querySelector(".jsc-table tbody").rows,
93                selected = document.querySelector(".jsc-filter-job").value.toUpperCase();
94            for (var i = 0; i < tr.length; i++) {
95                var secondCol = tr[i].cells[1].textContent.toUpperCase();
96                if (secondCol.indexOf(selected) > -1 ) {
97                    tr[i].style.display = "";
98                } else {
99                    tr[i].style.display = "none";
100                }
101
102                if (searchInput) {
103                    var firstCol = tr[i].cells[0].textContent.toUpperCase();
104                    var thirdCol = tr[i].cells[2].textContent.toUpperCase();
105                    if ((firstCol.indexOf(filter) > -1 || thirdCol.indexOf(filter) > -1) && secondCol.indexOf(selected) > -1) {
106                        tr[i].style.display = "";
107                    } else {
108                        tr[i].style.display = "none";
109                    }
110                }
111
112            }
113        }
114    }
115    return{
116        init: init,
117    }
118
119
120})();
121
122
123const header = (() => {
124    function init(){
125        const headerHeight = document.querySelector('.jsc-wrapper-header').getBoundingClientRect().height;
126        const headerHeightmobile = document.querySelector('.jsc-wrapper-header-mobile').getBoundingClientRect().height;
127        if(headerHeight !== 0){
128            document.getElementsByTagName("html")[0].setAttribute("style", "scroll-padding-top:" + headerHeight + 'px');
129        } else {
130            document.getElementsByTagName("html")[0].setAttribute("style", "scroll-padding-top:" + headerHeightmobile + 'px');
131        }
132    }
133
134    return{
135        init: init,
136    }
137
138})();
139
140const imageProtection = (() => {
141
142    function init() {
143        const images = document.querySelectorAll('img');
144
145        images.forEach((image) => {
146
147            // Disable right-click
148            image.addEventListener('contextmenu', (event) => {
149                event.preventDefault();
150            });
151
152            // Disable Drag & Drop
153            image.addEventListener('dragstart', (event) => {
154                event.preventDefault();
155            });
156
157        });
158    }
159
160    return {
161        init: init,
162    };
163
164})();
165
166
167const insightsSlider = (() => {
168    async function init(){
169        let swipers = document.querySelectorAll('.jsc-insights');
170
171        swipers.forEach((swiper) => {
172            const swiperId = swiper.getAttribute('id');
173            new Swiper(swiper, {
174                watchSlidesProgress: true,
175                effect: "coverflow",
176                centeredSlides: true,
177                centeredSlidesBounds: true,
178                loop: true,
179                coverflowEffect: {
180                    rotate: 0,
181                    depth: 180,
182                    slideShadows: true,
183                },
184                breakpoints: {
185                    // when window width is >= 480px
186                    640: {
187                        slidesPerView: 2
188                    },
189                    // when window width is >= 640px
190                    1024: {
191                        slidesPerView: 2,
192                        spaceBetween: 50,
193                    },
194                },
195                navigation: {
196                    nextEl: ".insights-navigation-next-" + swiperId,
197                    prevEl: ".insights-navigation-prev-" + swiperId,
198                },
199            });
200        });
201
202        _duplicateSlides();
203        _setTopValue();
204        window.onresize = function () {
205            _setTopValue();
206        }
207
208        swipers.forEach((swiper) => {
209            swiper.swiper.update();
210        });
211
212
213    }
214
215    function _duplicateSlides(){
216        if(document.querySelector('.jsc-insights-wrapper')){
217            const swiperWrapper = document.querySelector('.jsc-insights-wrapper');
218            const slides = Array.from(swiperWrapper.children);
219
220            slides.forEach(slide => {
221                const clone = slide.cloneNode(true);
222                swiperWrapper.appendChild(clone);
223            });
224        }
225    }
226
227    function _setTopValue(){
228
229        if(document.querySelector('.jsc-insights')){
230            let element = document.querySelector('.jsc-insights');
231            let elementHeight = element.offsetHeight;
232
233            if (elementHeight === 0) {
234                setTimeout(this.setTopValue, 100);
235            } else {
236                let halfHeight = elementHeight / 2;
237                let topValue = halfHeight - 45;
238                document.querySelector('.bem-insights__left').style.top = topValue + "px";
239                document.querySelector('.bem-insights__right').style.top = topValue + "px";
240            }
241        }
242    }
243
244    return{
245        init: init,
246    }
247})();
248
249
250const insightsSliderMobile = (() => {
251    function init(){
252        let swipersMobile = document.querySelectorAll('.jsc-insights-mobile');
253        swipersMobile.forEach((swiperMobile) => {
254            const swiperMobileId = swiperMobile.getAttribute('id');
255            new Swiper(swiperMobile, {
256                modules: [EffectCarousel],
257                effect: 'carousel',
258                carouselEffect: {
259                    opacityStep: 0.33,
260                    scaleStep: 0.2,
261                    sideSlides: 2,
262                },
263                grabCursor: true,
264                loop: true,
265                slidesPerView: 'auto',
266                navigation: {
267                    nextEl: ".insights-navigation-next-" + swiperMobileId,
268                    prevEl: ".insights-navigation-prev-" + swiperMobileId,
269                },
270            });
271        });
272
273        _setTopValue();
274
275        window.onresize = function () {
276            _setTopValue();
277        }
278    }
279
280    function _setTopValue(){
281        if(document.querySelector('.jsc-insights-mobile')){
282            let element = document.querySelector('.jsc-insights-mobile');
283            let elementHeight = element.offsetHeight;
284            if (elementHeight === 0) {
285                // Warte eine kurze Zeit und versuche es erneut
286                setTimeout(this.setTopValue, 100);
287            } else {
288                let halfHeight = elementHeight / 2;
289                let topValue = halfHeight - 45;
290                if(document.querySelector('.bem-insights__left--mobile').style.top !== 0){
291                    document.querySelector('.bem-insights__left--mobile').style.top = topValue + "px";
292                }
293                if(document.querySelector('.bem-insights__right--mobile').style.top !== 0){
294                    document.querySelector('.bem-insights__right--mobile').style.top = topValue + "px";
295                }
296            }
297        }
298    }
299
300    return{
301        init: init,
302    }
303
304
305})();
306
307
308const loadMore = (() => {
309    function init(){
310        const loadMore = document.querySelector('.jsc-loadmore');
311        const hide = [...document.querySelectorAll('.jsc-portfolio.d-none')];
312        const wrapper = document.querySelectorAll('.jsc-wrapper');
313
314        wrapper.forEach(function(element){
315            let portfolioChild = element.children;
316            let arr = [].slice.call(portfolioChild);
317            arr.splice(0, 4).forEach(
318                elem => elem.classList.remove('d-none')
319            );
320        });
321
322        if(loadMore !== null){
323        loadMore.addEventListener('click', (element) =>{
324            let portfolioUid = element.getAttribute('data-uid');
325            let portfolioChild = document.querySelector('.jsc-wrapper[data-uid="' + portfolioUid + '"]').children;
326            var arr = [].slice.call(portfolioChild);
327
328            for (let i=0; i < arr.length; i++) {
329
330                if(arr[i].classList.contains('d-none') === true){
331                    arr.splice(i, 4).forEach(
332                        elem => elem.classList.remove('d-none')
333                    );
334                    let lastElement = arr[arr.length - 1];
335                    if(lastElement.classList.contains('d-none') === false){
336                        document.querySelector('.jsc-loadmore[data-uid="' + portfolioUid + '"]').classList.add('d-none');
337                    }
338                    return;
339                }
340            }
341        });
342        }
343
344    }
345
346    return{
347        init: init,
348    }
349
350
351})();
352
353
354const overlay = (() => {
355    const state = {
356        isOpen: false
357    };
358    const overlayEl = document.querySelector('.jsc-overlayMenu');
359    const toggles = document.querySelectorAll('.jsc-overlay-toggle');
360    const body = document.body;
361
362    let scrollPosition = 0;
363
364    function init() {
365
366        if (!overlayEl) return;
367
368        setHeaderHeight();
369        bindEvents();
370
371        window.addEventListener('resize', setHeaderHeight);
372    }
373
374    function bindEvents() {
375        // TOGGLE BUTTONS (Header + Subheader)
376        toggles.forEach(btn => {
377            btn.addEventListener('click', (e) => {
378                e.preventDefault();
379                e.stopPropagation();
380                toggle();
381            });
382        });
383
384        // BACKDROP CLOSE
385        overlayEl.addEventListener('click', (e) => {
386            if (e.target === overlayEl) {
387                close();
388            }
389        });
390
391        // ESC CLOSE
392        document.addEventListener('keydown', (e) => {
393            if (e.key === 'Escape') {
394                close();
395            }
396        });
397
398        // CLOSE ON LINK CLICK (optional but recommended)
399        overlayEl.querySelectorAll('a').forEach(link => {
400            link.addEventListener('click', close);
401        });
402    }
403
404    function open() {
405        setState(true);
406    }
407
408    function close() {
409        setState(false);
410    }
411
412    function toggle() {
413        setState(!state.isOpen);
414    }
415
416    function setState(nextState) {
417
418        if (state.isOpen === nextState) return;
419
420        state.isOpen = nextState;
421        render();
422    }
423
424    function render() {
425
426        if (state.isOpen) {
427            openDOM();
428        } else {
429            closeDOM();
430        }
431
432        updateUI();
433    }
434
435    function openDOM() {
436
437        overlayEl.classList.add('is-open');
438        body.classList.add('is-overlay-open');
439        overlayEl.setAttribute('aria-hidden', 'false');
440        lockScroll();
441    }
442
443    function closeDOM() {
444
445        overlayEl.classList.remove('is-open');
446        body.classList.remove('is-overlay-open');
447        overlayEl.setAttribute('aria-hidden', 'true');
448        unlockScroll();
449    }
450
451    // =========================
452    // UI SYNC (ICONS + ARIA)
453    // =========================
454    function updateUI() {
455
456        // ICON STATE
457        document.querySelectorAll('.jsc-overlay-icon').forEach(icon => {
458
459            icon.classList.remove('fa-bars', 'fa-xmark');
460            icon.classList.add(state.isOpen ? 'fa-xmark' : 'fa-bars');
461        });
462
463        // ARIA STATE
464        toggles.forEach(btn => {
465            btn.setAttribute('aria-expanded', state.isOpen ? 'true' : 'false');
466        });
467    }
468
469    // =========================
470    // SCROLL LOCK (iOS SAFE)
471    // =========================
472    function lockScroll() {
473
474        scrollPosition = window.scrollY;
475
476        body.style.position = 'fixed';
477        body.style.top = `-${scrollPosition}px`;
478        body.style.width = '100%';
479    }
480
481    function unlockScroll() {
482
483        body.style.position = '';
484        body.style.top = '';
485        body.style.width = '';
486
487        window.scrollTo(0, scrollPosition);
488    }
489
490    // =========================
491    // HEADER HEIGHT CSS VAR
492    // =========================
493    function setHeaderHeight() {
494
495        const header = document.querySelector('.jsc-wrapper-header-mobile');
496
497        if (!header) return;
498
499        document.documentElement.style.setProperty(
500            '--header-height',
501            `${header.offsetHeight}px`
502        );
503    }
504
505    return {
506        init,
507        open,
508        close,
509        toggle
510    };
511
512})();
513
514
515const overlayVita = (() => {
516    function init(){
517        const openVita = document.querySelectorAll('.jsc-open-vita');
518
519        if(openVita !== null){
520            openVita.forEach((trigger) => {
521                trigger.addEventListener('click', (event) => {
522                    var overlay = event.currentTarget.nextElementSibling;
523                     _open(overlay);
524                 });
525            });
526        }
527
528        document.addEventListener('click', (e) => {
529            const closeTrigger = e.target.closest('.jsc-close-vita');
530            if(closeTrigger === null)
531                return;
532
533            const overlay = closeTrigger.closest('.' + closeTrigger.getAttribute('data-vitatarget'));
534            if(overlay !== null) {
535                _close(overlay);
536            }
537
538        });
539     }
540
541     function _open(element){
542         element.style.height = '100vh';
543     }
544
545     function _close(element){
546         element.style.height = '0';
547     }
548
549     return{
550         init: init,
551     }
552 })();
553
554
555const searchJob = (() => {
556    function init(){
557        const findJob = document.querySelector('.jsc-find-job');
558        if(findJob !== null){
559            findJob.addEventListener('keyup', (event) =>{
560                const input = document.querySelector('.jsc-find-job');
561                const filter = input.value.toUpperCase();
562                const tr = document.querySelector(".jsc-table tbody").rows;
563                const selected = document.querySelector('.jsc-filter-job').value.toUpperCase();
564                for (var i = 0; i < tr.length; i++) {
565                    const firstCol = tr[i].cells[0].textContent.toUpperCase();
566                    const secondCol = tr[i].cells[1].textContent.toUpperCase();
567                    const thirdCol = tr[i].cells[2].textContent.toUpperCase();
568
569                    if (selected) {
570                        if ((firstCol.indexOf(filter) > -1 || thirdCol.indexOf(filter) > -1) && secondCol.indexOf(selected) > -1) {
571                            tr[i].style.display = "";
572                        } else {
573                            tr[i].style.display = "none";
574                        }
575                    } else {
576                        if (firstCol.indexOf(filter) > -1 || secondCol.indexOf(filter) > -1 || thirdCol.indexOf(filter) > -1) {
577                            tr[i].style.display = "";
578                        } else {
579                            tr[i].style.display = "none";
580                        }
581                    }
582                }
583            })
584        }
585    }
586
587    return{
588        init: init,
589    }
590})();
591
592
593const slider = (() => {
594    function init(){
595        let swiper = new Swiper(".jsc-swiper-bottom", {
596            slidesPerView: 5,
597            spaceBetween: 0,
598            breakpoints: {
599                1024: {
600                    slidesPerView: 4,
601                },
602                768: {
603                    slidesPerView: 3,
604                },
605                640: {
606                    slidesPerView: 2,
607                },
608                320: {
609                    slidesPerView: 1,
610                }
611            },
612            freeMode: true,
613            watchSlidesProgress: true,
614        });
615        let swiperTwo = new Swiper(".jsc-swiper-top", {
616            spaceBetween: 0,
617            height: 400,
618            allowTouchMove: false,
619            navigation: {
620                nextEl: ".swiper-button-next",
621                prevEl: ".swiper-button-prev",
622            },
623            thumbs: {
624                swiper: swiper,
625            },
626        });
627    }
628    return{
629            init: init,
630    }
631
632
633})();
634
635
636const trailerPopup = (() => {
637    function init(){
638        const srcTrailer = document.querySelectorAll('.jsc-srcTrailer');
639        if(srcTrailer !== null){
640            srcTrailer.forEach((trigger) => {
641                trigger.addEventListener('click', () => {
642                    const iframe = trigger.getAttribute('data-overlay-iframe');
643                    const overlay = document.querySelector('.jsc-trailerOverlay');
644
645                    if(overlay){
646                        document.querySelector('.jsc-video-ratio').innerHTML = iframe;
647                        _open(overlay);
648                    }
649                })
650            });
651        }
652
653        const closeTrailerOverlay = document.querySelectorAll('.jsc-closeTrailerOverlay');
654        if(closeTrailerOverlay !== null){
655            closeTrailerOverlay.forEach((trigger) => {
656                trigger.addEventListener('click', () => {
657                    const overlay = document.querySelector('.jsc-trailerOverlay');
658                    if(overlay)
659                    {
660                        _close(overlay);
661                    }
662                });
663            });
664
665        }
666
667    }
668
669    function _open(element){
670        element.style.height = '100vh';
671    }
672
673    function _close(element){
674        element.style.height = '0';
675    }
676    return{
677        init: init,
678    }
679
680
681})();
682
683
684const generalUtility = (() => {
685
686    function createElementFromHTML(){
687        var div = document.createElement('div');
688        div.innerHTML = htmlString.trim();
689
690        return div.firstChild;
691    }
692
693    return{
694        createElementFromHTML: createElementFromHTML,
695    }
696
697})();

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.