hand-detection/assets/scripts/main.min.js

1 line
12 KiB
JavaScript
Raw Normal View History

2024-05-29 03:18:12 +00:00
!function(e){"use strict";var t={};NProgress.start(),e(document).ready(function(){return t.module.init(),t.plugin.init(),e('[data-toggle="tooltip"]').length&&e('[data-toggle="tooltip"]').tooltip(),!1}),e(window).bind("load",function(){return t.plugin.isotope.init(),t.func.resizeNotice(),NProgress.done(),!1}),e(window).on("resize",function(){return t.func.resizeNotice(),t.func.getChart(),!1}),e(".js__full_screen").on("click",function(){e(document).fullScreen(!0)}),t.module={init:function(){return t.module.accordion(),t.module.card(),t.module.css(e(".js__width"),"width"),t.module.dropDown("js__drop_down",!1),t.module.logout(),t.module.menu(),t.module.tab(".js__tab","li"),t.module.toggle(),t.module.todo(),!1},accordion:function(){return e(".js__accordion").each(function(){var t=e(this);t.find(".js__control").on("click",function(o){if(o.preventDefault(),e(this).parent().hasClass("active"))e(this).parent().removeClass("active"),e(this).next().stop().slideUp(400);else{var r=e(this);t.find(".active").children(".js__content").stop().slideUp(400),t.find(".active").removeClass("active"),e(this).parent().addClass("active"),e(this).next(".js__content").slideDown(400,function(){t.parents(".main-menu").length&&e(".main-menu .content").mCustomScrollbar("scrollTo",r,{timeout:0,scrollInertia:200})})}})}),!1},card:function(){return e(".js__card").each(function(){var t=e(this);t.on("click",".js__card_minus",function(){t.toggleClass("card-closed"),t.find(".js__card_content").stop().slideToggle(400)}),t.on("click",".js__card_remove",function(){t.slideUp(400)})}),!1},css:function(t,o,r){return r||(r=o),t.each(function(){var t=e(this).data(r);if(t){var a={};a[o]=t,e(this).css(a)}}),!1},dropDown:function(t,o){var r=e("."+t);return r.each(function(){var t=e(this);t.on("click",".js__drop_down_button",function(a){return a.preventDefault(),(e(window).width()<1025||0==o)&&(t.hasClass("active")?t.removeClass("active"):(r.removeClass("active"),t.addClass("active"))),!1})}),e("html").on("click",function(o){var r=e(o.target);r.hasClass(t)||r.parents("."+t).length||e("."+t+".active").removeClass("active")}),!1},logout:function(){e(".js__logout").on("click",function(e){return e.preventDefault(),swal({title:"Logout?",text:"Are you sure you want to logout?",type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, I'm out!",cancelButtonText:"No, stay plx!",closeOnConfirm:!1,closeOnCancel:!0,confirmButtonColor:"#f60e0e"},function(e){e&&swal({title:"Logout success",text:"See you later!",type:"success",confirmButtonColor:"#304ffe"})}),!1})},menu:function(){return e(".js__menu_mobile").on("click",function(){e("html").toggleClass("menu-active"),e(window).trigger("resize")}),e(".js__menu_close").on("click",function(){e("html").removeClass("menu-active")}),e("body").on("click",function(t){if(e("html.menu-active").length&&e(window).width()<800){var o=e(t.target);o.hasClass("main-menu")||o.hasClass("js__menu_mobile")||o.parents(".main-menu").length||o.parents(".js__menu_mobile").length||e("html").removeClass("menu-active")}}),!1},tab:function(t,o){return e(".js__tab").each(function(){var t=e(this);t.on("click",".js__tab_control",function(r){var a=e(this).data("target");if(r.preventDefault(),t.find(".js__tab_content").removeClass("js__active"),t.find(".js__tab_control").removeClass("js__active"),e(this).addClass("js__active"),a)e(a).addClass("js__active");else{var n;n=o?e(this).parents(o).first().index():e(this).index(),t.find(".js__tab_content").eq(n).addClass("js__active")}return!1})}),!1},todo:function(){return e(".js__todo_widget").each(function(){var t=(e(this),e(this).find(".js__todo_list")),o=e(this).find(".js__todo_value"),r=e(this).find(".js__todo_button");r.on("click",function(){if(""!=o.val()){var e=Math.floor(1e8*Math.random()+1);t.append('<div class="todo-item"><div class="checkbox"><input type="checkbox" id="todo-'+e+'"><label for="todo-'+e+'">'+o.val()+"</label></div></div>"),o.val("")}else alert("You must enter task name.");return!1})}),!1},toggle:function(){return e(".js__toggle_open").on("click",function(t){return t.pr