PageSourceSearch

https://artel-srl.com/a_data/zerif.js

js artel-srl.com collected 2026-10-09 01:45:31 UTC 22,979 bytes, 744 lines download raw bytes

1/* =================================
2
3 LOADER
4
5 =================================== */
6
7// makes sure the whole site is loaded
8
9jQuery(window).load(function() {
10
11    // will first fade out the loading animation
12
13    jQuery(".status").fadeOut();
14
15    // will fade out the whole DIV that covers the website.
16
17    jQuery(".preloader").delay(1000).fadeOut("slow");
18
19
20    jQuery('.carousel').carousel('pause');
21
22    // Focus styles for menus.
23    jQuery( '.navbar-collapse' ).find( 'a' ).on( 'focus blur', function() {
24        jQuery( this ).parents().toggleClass( 'link-focus' );
25    });
26
27});
28
29/*** DROPDOWN FOR MOBILE MENU */
30var callback_mobile_dropdown = function () {
31
32    var navLi = jQuery('#site-navigation li');
33
34    navLi.each(function(){
35        if ( jQuery(this).find('ul').length > 0 && !jQuery(this).hasClass('has_children') ){
36            jQuery(this).addClass('has_children');
37            jQuery(this).find('a').first().after('<p class="dropdownmenu"></p>');
38        }
39    });
40    jQuery('.dropdownmenu').click(function(){
41        if( jQuery(this).parent('li').hasClass('this-open') ){
42            jQuery(this).parent('li').removeClass('this-open');
43        }else{
44            jQuery(this).parent('li').addClass('this-open');
45        }
46    });
47
48    navLi.find('a').click(function(){
49        jQuery('.navbar-toggle').addClass('collapsed');
50        jQuery('.collapse').removeClass('in');
51    });
52
53};
54jQuery(document).ready(callback_mobile_dropdown);
55
56jQuery(document).ready(function() {
57    var current_height = jQuery('.header .container').height();
58    jQuery('.header').css('min-height',current_height);
59
60});
61
62
63/* show/hide reCaptcha */
64jQuery(document).ready(function() {
65
66    var thisOpen = false;
67    jQuery('.contact-form .form-control').each(function(){
68        if ( jQuery(this).val().length > 0 ){
69            thisOpen = true;
70            jQuery('.zerif-g-recaptcha').css('display','block').delay(1000).css('opacity','1');
71            return false;
72        }
73    });
74    if ( thisOpen == false && (typeof jQuery('.contact-form textarea').val() != 'undefined') && (jQuery('.contact-form textarea').val().length > 0) ) {
75        thisOpen = true;
76        jQuery('.zerif-g-recaptcha').css('display','block').delay(1000).css('opacity','1');
77    }
78    jQuery('.contact-form input, .contact-form textarea').focus(function(){
79        if ( !jQuery('.zerif-g-recaptcha').hasClass('recaptcha-display') ) {
80            jQuery('.zerif-g-recaptcha').css('display','block').delay(1000).css('opacity','1');
81        }
82    });
83
84});
85
86/* =================================
87
88 ===  Bootstrap Fix              ====
89
90 =================================== */
91
92if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
93
94    var msViewportStyle = document.createElement('style')
95
96    msViewportStyle.appendChild(
97
98        document.createTextNode(
99
100            '@-ms-viewport{width:auto!important}'
101
102        )
103
104    )
105
106    document.querySelector('head').appendChild(msViewportStyle)
107
108}
109
110/* =================================
111
112 ===  STICKY NAV                 ====
113
114 =================================== */
115
116
117
118jQuery(document).ready(function() {
119
120
121
122    // Sticky Header - http://jqueryfordesigners.com/fixed-floating-elements/
123
124    var top = jQuery('#main-nav').offset().top - parseFloat(jQuery('#main-nav').css('margin-top').replace(/auto/, 0));
125
126
127
128    jQuery(window).scroll(function (event) {
129
130        // what the y position of the scroll is
131
132        var y = jQuery(this).scrollTop();
133
134
135
136        // whether that's below the form
137
138        if (y >= top) {
139
140            // if so, ad the fixed class
141
142            jQuery('#main-nav').addClass('fixed');
143
144        } else {
145
146            // otherwise remove it
147
148            jQuery('#main-nav').removeClass('fixed');
149
150        }
151
152    });
153
154});
155
156
157/*=================================
158
159 ===  SMOOTH SCROLL             ====
160
161 =================================== */
162
163jQuery(document).ready(function(){
164    jQuery('#site-navigation a[href*=#]:not([href=#]), header.header a[href*=#]:not([href=#])').bind('click',function () {
165        var headerHeight;
166        var hash    = this.hash;
167        var idName  = hash.substring(1);    // get id name
168        var alink   = this;                 // this button pressed
169        // check if there is a section that had same id as the button pressed
170        if ( jQuery('section [id*=' + idName + ']').length > 0 && jQuery(window).width() >= 751 ){
171            jQuery('.current').removeClass('current');
172            jQuery(alink).parent('li').addClass('current');
173        }else{
174            jQuery('.current').removeClass('current');
175        }
176        if ( jQuery(window).width() >= 751 ) {
177            headerHeight = jQuery('#main-nav').height();
178        } else {
179            headerHeight = 0;
180        }
181        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
182            var target = jQuery(this.hash);
183            target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
184            if (target.length) {
185                jQuery('html,body').animate({
186                    scrollTop: target.offset().top - headerHeight + 10
187                }, 1200);
188                return false;
189            }
190        }
191    });
192});
193
194jQuery(document).ready(function(){
195    var headerHeight;
196    jQuery('.current').removeClass('current');
197    jQuery('#site-navigation a[href$="' + window.location.hash + '"]').parent('li').addClass('current');
198    if ( jQuery(window).width() >= 751 ) {
199        headerHeight = jQuery('#main-nav').height();
200    } else {
201        headerHeight = 0;
202    }
203    if (location.pathname.replace(/^\//,'') == window.location.pathname.replace(/^\//,'') && location.hostname == window.location.hostname) {
204        var target = jQuery(window.location.hash);
205        if (target.length) {
206            jQuery('html,body').animate({
207                scrollTop: target.offset().top - headerHeight + 10
208            }, 1200);
209            return false;
210        }
211    }
212});
213
214/* TOP NAVIGATION MENU SELECTED ITEMS */
215
216function zerif_lite_scrolled() {
217
218    if ( jQuery(window).width() >= 751 ) {
219
220        var zerif_scrollTop = jQuery(window).scrollTop();       // cursor position
221        var headerHeight = jQuery('#main-nav').outerHeight();   // header height
222        var isInOneSection = 'no';                              // used for checking if the cursor is in one section or not
223
224        // for all sections check if the cursor is inside a section
225        jQuery("section").each( function() {
226            var thisID = '#' + jQuery(this).attr('id');           // section id
227            var zerif_offset = jQuery(this).offset().top;         // distance between top and our section
228            var thisHeight  = jQuery(this).outerHeight();         // section height
229            var thisBegin   = zerif_offset - headerHeight;                      // where the section begins
230            var thisEnd     = zerif_offset + thisHeight - headerHeight;         // where the section ends
231
232            // if position of the cursor is inside of the this section
233            if ( zerif_scrollTop >= thisBegin && zerif_scrollTop <= thisEnd ) {
234                isInOneSection = 'yes';
235                jQuery('.current').removeClass('current');
236                jQuery('#site-navigation a[href$="' + thisID + '"]').parent('li').addClass('current');    // find the menu button with the same ID section
237                return false;
238            }
239            if (isInOneSection == 'no') {
240                jQuery('.current').removeClass('current');
241            }
242        });
243    }
244}
245jQuery(window).on('scroll',zerif_lite_scrolled);
246
247/* ================================
248
249 ===  PARALLAX                  ====
250
251 ================================= */
252
253jQuery(document).ready(function(){
254
255    var jQuerywindow = jQuery(window);
256
257    jQuery('div[data-type="background"], header[data-type="background"], section[data-type="background"]').each(function(){
258
259        var jQuerybgobj = jQuery(this);
260
261        jQuery(window).scroll(function() {
262
263            var yPos = -(jQuerywindow.scrollTop() / jQuerybgobj.data('speed'));
264
265            var coords = '50% '+ yPos + 'px';
266
267            jQuerybgobj.css({
268
269                backgroundPosition: coords
270
271            });
272
273        });
274
275    });
276
277});
278
279
280
281/* ================================
282
283 ===  KNOB                      ====
284
285 ================================= */
286
287jQuery(function() {
288
289    jQuery(".skill1").knob({
290
291        'max':100,
292
293        'width': 64,
294
295        'readOnly':true,
296
297        'inputColor':' #FFFFFF ',
298
299        'bgColor':' #222222 ',
300
301        'fgColor':' #e96656 '
302
303    });
304
305    jQuery(".skill2").knob({
306
307        'max':100,
308
309        'width': 64,
310
311        'readOnly':true,
312
313        'inputColor':' #FFFFFF ',
314
315        'bgColor':' #222222 ',
316
317        'fgColor':' #34d293 '
318
319    });
320
321    jQuery(".skill3").knob({
322
323        'max': 100,
324
325        'width': 64,
326
327        'readOnly': true,
328
329        'inputColor':' #FFFFFF ',
330
331        'bgColor':' #222222 ',
332
333        'fgColor':' #3ab0e2 '
334
335    });
336
337    jQuery(".skill4").knob({
338
339        'max': 100,
340
341        'width': 64,
342
343        'readOnly': true,
344
345        'inputColor':' #FFFFFF ',
346
347        'bgColor':' #222222 ',
348
349        'fgColor':' #E7AC44 '
350
351    });
352
353});
354
355
356
357/* ======================================
358
359 ============ MOBILE NAV =============== */
360
361jQuery('.navbar-toggle').on('click', function () {
362
363    jQuery(this).toggleClass('active');
364
365});
366
367
368/* SETS THE HEADER HEIGHT */
369jQuery(window).load(function(){
370    setminHeightHeader();
371});
372jQuery(window).resize(function() {
373    setminHeightHeader();
374});
375function setminHeightHeader()
376{
377    jQuery('#main-nav').css('min-height','75px');
378    jQuery('.header').css('min-height','75px');
379    var minHeight = parseInt( jQuery('#main-nav').height() );
380    jQuery('#main-nav').css('min-height',minHeight);
381    jQuery('.header').css('min-height',minHeight);
382}
383/* - */
384
385
386/* STICKY FOOTER */
387jQuery(window).load(fixFooterBottom);
388jQuery(window).resize(fixFooterBottom);
389
390function fixFooterBottom(){
391
392    var header      = jQuery('header.header');
393    var footer      = jQuery('footer#footer');
394    var content     = jQuery('.site-content > .container');
395
396    content.css('min-height', '1px');
397
398    var headerHeight  = header.outerHeight();
399    var footerHeight  = footer.outerHeight();
400    var contentHeight = content.outerHeight();
401    var windowHeight  = jQuery(window).height();
402
403    var totalHeight = headerHeight + footerHeight + contentHeight;
404
405    if (totalHeight<windowHeight){
406        content.css('min-height', windowHeight - headerHeight - footerHeight );
407    }else{
408        content.css('min-height','1px');
409    }
410}
411
412
413/*** CENTERED MENU */
414var callback_menu_align = function () {
415
416    var headerWrap    = jQuery('.header');
417    var navWrap     = jQuery('#site-navigation');
418    var logoWrap    = jQuery('.responsive-logo');
419    var containerWrap   = jQuery('.container');
420    var classToAdd    = 'menu-align-center';
421
422    if ( headerWrap.hasClass(classToAdd) )
423    {
424        headerWrap.removeClass(classToAdd);
425    }
426    var logoWidth     = logoWrap.outerWidth();
427    var menuWidth     = navWrap.outerWidth();
428    var containerWidth  = containerWrap.width();
429
430    if ( menuWidth + logoWidth > containerWidth ) {
431        headerWrap.addClass(classToAdd);
432    }
433    else
434    {
435        if ( headerWrap.hasClass(classToAdd) )
436        {
437            headerWrap.removeClass(classToAdd);
438        }
439    }
440}
441jQuery(window).load(callback_menu_align);
442jQuery(window).resize(callback_menu_align);
443
444var isMobile = {
445    Android: function() {
446        return navigator.userAgent.match(/Android/i);
447    },
448    BlackBerry: function() {
449        return navigator.userAgent.match(/BlackBerry/i);
450    },
451    iOS: function() {
452        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
453    },
454    Opera: function() {
455        return navigator.userAgent.match(/Opera Mini/i);
456    },
457    Windows: function() {
458        return navigator.userAgent.match(/IEMobile/i);
459    },
460    any: function() {
461        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
462    }
463};
464
465/* Rollover on mobile devices */
466if( isMobile.any() ) {
467
468    /* Our team section */
469    jQuery('.team-member').on('click', function(){
470        jQuery('.team-member-open').removeClass('team-member-open');
471        jQuery(this).addClass('team-member-open');
472        event.stopPropagation();
473    });
474    jQuery("html").click(function() {
475        jQuery('.team-member-open').removeClass('team-member-open');
476    });
477
478    /* Portfolio section */
479    jQuery(document).ready(function(){
480        jQuery('.cbp-rfgrid li').prepend('<p class="cbp-rfgrid-tr"></p>');
481    });
482    jQuery('.cbp-rfgrid li').on('click', function(){
483        if ( !jQuery(this).hasClass('cbp-rfgrid-open') ){
484            jQuery('.cbp-rfgrid-tr').css('display','block');
485            jQuery('.cbp-rfgrid-open').removeClass('cbp-rfgrid-open');
486
487            jQuery(this).addClass('cbp-rfgrid-open');
488            jQuery(this).find('.cbp-rfgrid-tr').css('display','none');
489            event.stopPropagation();
490        }
491    });
492    jQuery("html").click(function() {
493        jQuery('.cbp-rfgrid-tr').css('display','block');
494        jQuery('.cbp-rfgrid-open').removeClass('cbp-rfgrid-open');
495    });
496
497}
498
499/* latest news */
500jQuery(window).load(zerif_home_latest_news);
501jQuery(window).resize(zerif_home_latest_news);
502function zerif_home_latest_news(){
503    if( jQuery( '#carousel-homepage-latestnews').length > 0 ) {
504        jQuery( '#carousel-homepage-latestnews div.item' ).height('auto');
505        if( isMobile.any() || (!isMobile.any() && jQuery('.container').outerWidth()>768) ) {
506
507            if( jQuery( '#carousel-homepage-latestnews div.item' ).length < 2 ) {
508                jQuery( '#carousel-homepage-latestnews > a' ).css('display','none');
509            }
510            var maxheight = 0;
511            jQuery( '#carousel-homepage-latestnews div.item' ).each(function(){
512                if( jQuery(this).height() > maxheight ) {
513                    maxheight = jQuery(this).height();
514                }
515            });
516            jQuery( '#carousel-homepage-latestnews div.item' ).height(maxheight);
517        }
518    }
519}
520
521/* fix for IE9 placeholders */
522
523jQuery(document).ready(function(){
524
525    if (document.createElement("input").placeholder == undefined) {
526
527        jQuery('.contact-form input, .contact-form textarea').focus(function () {
528            if ( (jQuery(this).attr('placeholder') != '') && (jQuery(this).val() == jQuery(this).attr('placeholder')) ) {
529                jQuery(this).val('').removeClass('zerif-hasPlaceholder');
530            }
531        }).blur(function () {
532            if ( (jQuery(this).attr('placeholder') != '') && (jQuery(this).val() == '' || (jQuery(this).val() == jQuery(this).attr('placeholder')))) {
533                jQuery(this).val(jQuery(this).attr('placeholder')).addClass('zerif-hasPlaceholder');
534            }
535        });
536
537        jQuery('.contact-form input').blur();
538        jQuery('.contact-form textarea').blur();
539
540        jQuery('form.contact-form').submit(function () {
541            jQuery(this).find('.zerif-hasPlaceholder').each(function() { jQuery(this).val(''); });
542        });
543    }
544});
545
546/* Header section */
547jQuery(window).load(parallax_effect);
548jQuery(window).resize(parallax_effect);
549
550function parallax_effect(){
551
552    if( jQuery('#parallax_move').length>0 ) {
553        var scene = document.getElementById('parallax_move');
554        var window_width = jQuery(window).outerWidth();
555        jQuery('#parallax_move').css({
556            'width':            window_width + 120,
557            'margin-left':      -60,
558            'margin-top':       -60,
559            'position':         'absolute',
560        });
561        var h = jQuery('header#home').outerHeight();
562        jQuery('#parallax_move').children().each(function(){
563            jQuery(this).css({
564                'height': h+100,
565            });
566        });
567        if( !isMobile.any() ) {
568            var parallax = new Parallax(scene);
569        } else {
570            jQuery('#parallax_move').css({
571                'z-index': '0',
572            });
573            jQuery('#parallax_move .layer').css({
574                'position': 'absolute',
575                'top': '0',
576                'left': '0',
577                'z-index': '1',
578            });
579        }
580    }
581
582}
583
584
585/* testimonial Masonry style */
586var window_width_old;
587var exist_class = false;
588jQuery(document).ready(function(){
589    if( jQuery('.testimonial-masonry').length>0 ){
590        exist_class = true;
591        window_width_old = jQuery('.container').outerWidth();
592        if( window_width_old < 970 ) {
593            jQuery('.testimonial-masonry').zerifgridpinterest({columns: 1,selector: '.widget_zerif_testim-widget'});
594        } else {
595            jQuery('.testimonial-masonry').zerifgridpinterest({columns: 3,selector: '.widget_zerif_testim-widget'});
596        }
597    }
598});
599
600jQuery(window).resize(function() {
601    if( window_width_old != jQuery('.container').outerWidth() && exist_class === true ){
602        window_width_old = jQuery('.container').outerWidth();
603        if( window_width_old < 970 ) {
604            jQuery('.testimonial-masonry').zerifgridpinterest({columns: 1,selector: '.widget_zerif_testim-widget'});
605        } else {
606            jQuery('.testimonial-masonry').zerifgridpinterest({columns: 3,selector: '.widget_zerif_testim-widget'});
607        }
608    }
609});
610
611;(function ($, window, document, undefined) {
612    var defaults = {
613        columns:                3,
614        selector:               'div',
615        excludeParentClass:     '',
616    };
617    function ZerifGridPinterest(element, options) {
618        this.element    = element;
619        this.options    = $.extend({}, defaults, options);
620        this.defaults   = defaults;
621        this.init();
622    }
623    ZerifGridPinterest.prototype.init = function () {
624        var self            = this,
625            $container      = $(this.element);
626        $select_options = $(this.element).children();
627        self.make_magic( $container, $select_options );
628    };
629    ZerifGridPinterest.prototype.make_magic = function (container) {
630        var self            = this;
631        $container      = $(container),
632            columns_height  = [],
633            prefix          = 'zerif',
634            unique_class    = prefix + '_grid_' + self.make_unique();
635        local_class     = prefix + '_grid';
636        var classname;
637        var substr_index    = this.element.className.indexOf(prefix+'_grid_');
638        if( substr_index>-1 ) {
639            classname = this.element.className.substr( 0, this.element.className.length-unique_class.length-local_class.length-2 );
640        } else {
641            classname = this.element.className;
642        }
643        var my_id;
644        if( this.element.id == '' ) {
645            my_id = prefix+'_id_' + self.make_unique();
646        } else {
647            my_id = this.element.id;
648        }
649        $container.after('<div id="' + my_id + '" class="' + classname + ' ' + local_class + ' ' + unique_class + '"></div>');
650        var i;
651        for(i=1; i<=this.options.columns; i++){
652            columns_height.push(0);
653            var first_cols = '';
654            var last_cols = '';
655            if( i%self.options.columns == 1 ) { first_cols = prefix + '_grid_first'; }
656            if( i%self.options.columns == 0 ) { first_cols = prefix + '_grid_last'; }
657            $('.'+unique_class).append('<div class="' + prefix + '_grid_col_' + this.options.columns +' ' + prefix + '_grid_column_' + i +' ' + first_cols + ' ' + last_cols + '"></div>');
658        }
659        if( this.element.className.indexOf(local_class)<0 ){
660            $container.children(this.options.selector).each(function(index){
661                var min = Math.min.apply(null,columns_height);
662                var this_index = columns_height.indexOf(min)+1;
663                $(this).attr(prefix+'grid-attr','this-'+index).appendTo('.'+unique_class +' .' + prefix + '_grid_column_'+this_index);
664                columns_height[this_index-1] = $('.'+unique_class +' .' + prefix + '_grid_column_'+this_index).height();
665            });
666        } else {
667            var no_boxes = $container.find(this.options.selector).length;
668            var i;
669            for( i=0; i<no_boxes; i++ ){
670                var min = Math.min.apply(null,columns_height);
671                var this_index = columns_height.indexOf(min)+1;
672                $('#'+this.element.id).find('['+prefix+'grid-attr="this-'+i+'"]').appendTo('.'+unique_class +' .' + prefix + '_grid_column_'+this_index);
673                columns_height[this_index-1] = $('.'+unique_class +' .' + prefix + '_grid_column_'+this_index).height();
674            }
675        }
676        $container.remove();
677    }
678    ZerifGridPinterest.prototype.make_unique = function () {
679        var text = "";
680        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
681        for( var i=0; i<10; i++ )
682            text += possible.charAt(Math.floor(Math.random() * possible.length));
683        return text;
684    }
685    $.fn.zerifgridpinterest = function (options) {
686        return this.each(function () {
687            var value = '';
688            if (!$.data(this, value)) {
689                $.data(this, value, new ZerifGridPinterest(this, options) );
690            }
691        });
692    }
693})(jQuery);
694
695
696/* mobile background fix */
697var initHeight  = 0,
698    initWidth   = 0;
699var initViewMode,
700    onlyInit = true; 
701jQuery( document ).ready( function() { 
702    initViewMode = type_view();
703    mobile_bg_fix();
704} );
705jQuery( window ).resize( mobile_bg_fix );
706
707function mobile_bg_fix() {
708    if( isMobile.any() && jQuery( 'body.custom-background' ) ){
709        var viewMode = type_view();
710        if ( initViewMode != viewMode || onlyInit == true ) {
711            jQuery( '.mobile-bg-fix-img' ).css( {
712                'width' : window.innerWidth,
713                'height': window.innerHeight + 100
714            } );
715            initViewMode = viewMode;
716            if ( onlyInit == true ) { 
717                onlyInit = false; 
718                bodyClass   = jQuery( 'body.custom-background' );
719                imgURL      = bodyClass.css( 'background-image' );
720                imgSize     = bodyClass.css( 'background-size' );
721                imgPosition = bodyClass.css( 'background-position' );
722                imgRepeat   = bodyClass.css( 'background-repeat' );
723                jQuery( '#mobilebgfix' ).addClass( 'mobile-bg-fix-wrap' ).find( '.mobile-bg-fix-img' ).css( {
724                    'background-size':      imgSize,
725                    'background-position':  imgPosition,
726                    'background-repeat':    imgRepeat,
727                    'background-image':     imgURL
728                    } );
729            }
730        }
731    }
732}
733
734function type_view() {
735    var initHeight  = window.innerHeight;
736    var initWidth   = window.innerWidth;
737    if ( initWidth <= initHeight ) {
738        return 'portrait';
739    }
740    return 'landscape';
741}
742
743
744

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.