$.fn.sub_banner = function(effect) { let body = $("body"); if (isFrontEnv()) { this.each(function() { $(this).addClass("banner_text_effect"); let slide = $(this).find(".swiper-slide"); if(slide.length == 1) { $(this).addClass("no-prev-next"); } slide.first().addClass("swiper-slide-active"); $(this).addClass(effect || "fadeIn"); $(this).find(".text-white").each(function() { let text = $(this).text(); text = text.trim(); let text_array = text.split(""); let html = text_array.join(""); html = "" + html + ""; $(this).html(html); }); $(this).find("span").each(function() { if (Math.random() > 0.3) { $(this).css("animation-delay", (0.3 + Math.random()) + "s"); } }); }); if (!body.hasClass("front")) { setTimeout(a => { body.addClass("front"); }, 100); } } else { body.addClass("make"); } }; $(a => { $("#bannerwer").sub_banner("fadeInDown"); });