; (function ($) {

    "use strict";
    var portFolioFilter = function () {

        var $grid = $('.tf-portfolio-wrap .grid').isotope({
            itemSelector: '.grid-item',
            layoutMode: 'fitRows'
        });


          $('.filter-btn').on('click', function() {
            var filterValue = $(this).data('filter');
            $(".filter-btn").removeClass("active");
            $(this).addClass("active");
            $grid.isotope({ filter: filterValue });
          });

    }

    var portfolioFilterSt10 = function () {
        $(".nav-tabs li").click(function () { 
            $(".nav-tabs li").removeClass("active");
            $(this).addClass("active");
            var value = $(this).attr('data-filter');
            if(value == "all")
            {
                
                $('.filter').show('1000');
            }
            else
            {
              
                $(".filter").not('.'+value).hide('3000');
                $('.filter').filter('.'+value).show('3000');
                
            }
        });
    }


    $(window).on('elementor/frontend/init', function () {
        elementorFrontend.hooks.addAction('frontend/element_ready/tf-porfolio2.default', portFolioFilter);
        elementorFrontend.hooks.addAction('frontend/element_ready/tf-porfolio2.default', portfolioFilterSt10);
    });

}) (jQuery);
