TIF_E41201756/static/assets/home/js/soft-design-system.min.js

15 lines
5.4 KiB
JavaScript

// =========================================================
// Soft UI Design System - v1.0.9
// =========================================================
// Product Page: https://www.creative-tim.com/product/soft-ui-design-system
// Copyright 2023 Creative Tim (https://www.creative-tim.com)
// Licensed under MIT (https://github.com/creativetimofficial/soft-ui-dashboard/blob/main/LICENSE)
// Coded by www.creative-tim.com
// =========================================================
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
var popoverTriggerList=[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')),popoverList=popoverTriggerList.map(function(e){return new bootstrap.Popover(e)}),tooltipTriggerList=[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')),tooltipList=tooltipTriggerList.map(function(e){return new bootstrap.Tooltip(e)});function setAttributes(t,o){Object.keys(o).forEach(function(e){t.setAttribute(e,o[e])})}var popoverList=(popoverTriggerList=[].slice.call(document.querySelectorAll('[data-toggle="popover"]'))).map(function(e){return new bootstrap.Popover(e)}),tooltipList=(tooltipTriggerList=[].slice.call(document.querySelectorAll('[data-toggle="tooltip"]'))).map(function(e){return new bootstrap.Tooltip(e)}),total=document.querySelectorAll(".nav-pills");function getEventTarget(e){return(e=e||window.event).target||e.srcElement}function copyCode(e){var t,o=window.getSelection(),n=document.createRange(),l=e.nextElementSibling;n.selectNodeContents(l),o.removeAllRanges(),o.addRange(n),document.execCommand("copy");window.getSelection().removeAllRanges(),e.parentElement.querySelector(".alert")||((t=document.createElement("div")).classList.add("alert","alert-success","position-absolute","top-0","border-0","text-white","w-25","end-0","start-0","mt-2","mx-auto","py-2"),t.style.transform="translate3d(0px, 0px, 0px)",t.style.opacity="0",t.style.transition=".35s ease",setTimeout(function(){t.style.transform="translate3d(0px, 20px, 0px)",t.style.setProperty("opacity","1","important")},100),t.innerHTML="Code successfully copied!",e.parentElement.appendChild(t),setTimeout(function(){t.style.transform="translate3d(0px, 0px, 0px)",t.style.setProperty("opacity","0","important")},2e3),setTimeout(function(){e.parentElement.querySelector(".alert").remove()},2500))}total.forEach(function(r,e){var i=document.createElement("div"),t=r.querySelector("li:first-child .nav-link").cloneNode();t.innerHTML="-",i.classList.add("moving-tab","position-absolute","nav-link"),i.appendChild(t),r.appendChild(i),r.getElementsByTagName("li").length;i.style.padding="0px",i.style.width=r.querySelector("li:nth-child(1)").offsetWidth+"px",i.style.transform="translate3d(0px, 0px, 0px)",i.style.transition=".5s ease",r.onmouseover=function(e){let l=getEventTarget(e).closest("li");if(l){let o=Array.from(l.closest("ul").children),n=o.indexOf(l)+1;r.querySelector("li:nth-child("+n+") .nav-link").onclick=function(){i=r.querySelector(".moving-tab");let e=0;if(r.classList.contains("flex-column")){for(var t=1;t<=o.indexOf(l);t++)e+=r.querySelector("li:nth-child("+t+")").offsetHeight;i.style.transform="translate3d(0px,"+e+"px, 0px)",i.style.height=r.querySelector("li:nth-child("+t+")").offsetHeight}else{for(t=1;t<=o.indexOf(l);t++)e+=r.querySelector("li:nth-child("+t+")").offsetWidth;i.style.transform="translate3d("+e+"px, 0px, 0px)",i.style.width=r.querySelector("li:nth-child("+n+")").offsetWidth+"px"}}}}}),window.addEventListener("resize",function(e){total.forEach(function(t,e){t.querySelector(".moving-tab").remove();var o=document.createElement("div"),n=t.querySelector(".nav-link.active").cloneNode(),l=(n.innerHTML="-",o.classList.add("moving-tab","position-absolute","nav-link"),o.appendChild(n),t.appendChild(o),o.style.padding="0px",o.style.transition=".5s ease",t.querySelector(".nav-link.active").parentElement);if(l){var r=Array.from(l.closest("ul").children),n=r.indexOf(l)+1;let e=0;if(t.classList.contains("flex-column")){for(var i=1;i<=r.indexOf(l);i++)e+=t.querySelector("li:nth-child("+i+")").offsetHeight;o.style.transform="translate3d(0px,"+e+"px, 0px)",o.style.width=t.querySelector("li:nth-child("+n+")").offsetWidth+"px",o.style.height=t.querySelector("li:nth-child("+i+")").offsetHeight}else{for(i=1;i<=r.indexOf(l);i++)e+=t.querySelector("li:nth-child("+i+")").offsetWidth;o.style.transform="translate3d("+e+"px, 0px, 0px)",o.style.width=t.querySelector("li:nth-child("+n+")").offsetWidth+"px"}}}),window.innerWidth<991?total.forEach(function(e,t){e.classList.contains("flex-column")||e.classList.add("flex-column","on-resize")}):total.forEach(function(e,t){e.classList.contains("on-resize")&&e.classList.remove("flex-column","on-resize")})});var getParent=function(e,t){for(;e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null};function debounce(o,n,l){var r;return function(){var e=this,t=arguments;clearTimeout(r),r=setTimeout(function(){r=null,l||o.apply(e,t)},n),l&&!r&&o.apply(e,t)}}document.addEventListener("click",function(e){var t=getParent(e.target,".input-group");if(e.target.classList.contains("form-control")){for(var o=document.querySelectorAll(".input-group.focused"),n=0;n<o.length;n++)o[n].classList.remove("focused");t.classList.add("focused")}if((o=document.querySelectorAll(".input-group.focused"))&&e.target!=t&&e.target.parentNode!=t)for(n=0;n<o.length;n++)o[n].classList.remove("focused")},!1);
//# sourceMappingURL=_site_kit_free/assets/js/kit-free.js.map