$.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"); } }; $.fn.auto_category = function() { let body = $("body"); if (isFrontEnv()) { this.each(function() { $(this).addClass("hide").find("a").wrapAll("
").parent().wrapAll("
").parent().insertAfter(this).find("a").wrap("
").each(function() { $(this).text($(this).text().trim()).attr("data-text", $(this).text()); if (location.href.indexOf(this.href) > -1) { setTimeout(()=>{ $(this).addClass("category-current"); }, 100); } }); }); if (!body.hasClass("front")) { setTimeout(a => { body.addClass("front"); }, 100); } } else { body.addClass("make"); } }; $(a => { $("#nyebanner").sub_banner("fadeInDown"); });