// All functions ------------------ function initTheroof() { $('head').append(''); "use strict"; $(".loader-holder").fadeOut(500, function() { $("#main").animate({ opacity: "1" }, 500); }); $(".style-select").niceSelect(); // lightGallery------------------ function lightGalleryInit() { $(".image-popup").lightGallery({ selector: "this", cssEasing: "cubic-bezier(0.25, 0, 0.25, 1)", download: false, counter: false }); var o = $(".lightgallery"), p = o.data("looped"); o.lightGallery({ selector: ".lightgallery a.popup-image", cssEasing: "cubic-bezier(0.25, 0, 0.25, 1)", download: false, loop: false, counter: false }); $('#html5-videos').lightGallery({ selector: 'this', counter: false, download: false, zoom: false }); } lightGalleryInit(); // tabs ------------------ $(".tabs-menu a").on("click", function(a) { a.preventDefault(); $(this).parent().addClass("current"); $(this).parent().siblings().removeClass("current"); var b = $(this).attr("href"); $(this).parents(".tabs-act").find(".tab-content").not(b).css("display", "none"); $(b).fadeIn(); }); // accordion ------------------ $(".accordion-lite-header").on("click", function() { $(this).parent(".accordion-lite-container").find(".accordion-lite_content").slideToggle(400); $(this).toggleClass("acc_open"); }); //scroll animation------------------ $(".piechart-holder").appear(function() { $(this).find(".chart").each(function() { var a = $(".piechart-holder").data("skcolor"); var b = $(".piechart-holder").data("trcolor"); $(".chart").easyPieChart({ barColor: a, trackColor: b, scaleColor: "#9ACFB7", size: "120", lineWidth: "30", lineCap: "butt", onStep: function(a, b, c) { $(this.el).find(".percent").text(Math.round(c)); } }); }); }); $(".skillbar-box").appear(function() { $(this).find("div.skillbar-bg").each(function() { $(this).find(".custom-skillbar").delay(600).animate({ width: $(this).attr("data-percent") }, 1500); }); }); $(".stats").appear(function() { $(".num").countTo(); }); // isotope------------------ function n() { if ($(".gallery-items").length) { var $grid = $(".gallery-items").isotope({ singleMode: true, columnWidth: ".grid-sizer, .grid-sizer-second, .grid-sizer-three", itemSelector: ".gallery-item, .gallery-item-second, .gallery-item-three" }); $grid.imagesLoaded(function() { $grid.isotope("layout"); }); $(".gallery-filters").on("click", "a.gallery-filter", function(b) { b.preventDefault(); var c = $(this).attr("data-filter"), d = $(this).text(); if ($(".gallery-items").hasClass('sf_true')) { setTimeout(function() { $grid.isotope({ filter: c }); }, 500); $('html, body').animate({ scrollTop: $("#scroll-folio").offset().top - 80 }, 400); } else { $grid.isotope({ filter: c }); } $(".gallery-filters a").removeClass("gallery-filter-active"); $(this).addClass("gallery-filter-active"); }); var gat = $(".gallery-filter-active").text(); } $(".gallery-items").isotope("on", "layoutComplete", function(a, b) { var b = a.length; $(".num-album").html(b); }); var b = $(".gallery-item").length; $(".all-album , .num-album").html(b); } n(); $(".show-hidden-filters").on("click", function() { $(this).toggleClass("shf_btn_active"); $(".hidden-filter").toggleClass("vis_hiddenfilter"); }); // Other functions ------------------ var n = $(".bg"); n.each(function(a) { if ($(this).attr("data-bg")) $(this).css("background-image", "url(" + $(this).data("bg") + ")"); }); $(".fix-bar").scrollToFixed({ minWidth: 1064, marginTop: 90, removeOffsets: true, limit: function() { var a = $(".limit-box").offset().top - $(".fix-bar").outerHeight(true) + 36; return a; } }); if ($(".fixed-bar").outerHeight(true) < $(".post-container").outerHeight(true)) { $(".fixed-bar").addClass("fixbar-action"); $(".fixbar-action").scrollToFixed({ minWidth: 1064, marginTop: function() { var a = $(window).height() - $(".fixed-bar").outerHeight(true) - 120; if (a >= 0) return 20; return a; }, removeOffsets: true, limit: function() { var a = $(".limit-box").offset().top - $(".fixed-bar").outerHeight(); return a; } }); } else $(".fixed-bar").removeClass("fixbar-action"); function o() { $("form[name=cart]").jAutoCalc("destroy"); $("form[name=cart]").jAutoCalc({ keyEventsFire: true, decimalPlaces: 2, emptyAsZero: true }); } o(); $(".rage-slider").ionRangeSlider(); $(".shop-price").ionRangeSlider({ keyboard: true, prefix: "$" }); var maxL = 90; $(".dbig p").each(function(i, div) { var text = $(div).text(); if (text.length > maxL) { var begin = text.substr(0, maxL), end = text.substr(maxL); $(div).html(begin).append($('