lumecss
Version:
LumeCss is a modern, lightweight, and flexible CSS library designed for building fast and responsive user interfaces. Built with SCSS and TypeScript, LumeCss provides utility-first classes, customizable themes, and reusable components to speed up your dev
1 lines • 16.4 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LumeCSS=t():e.LumeCSS=t()}(this,(()=>(()=>{"use strict";var e={120:()=>{const e=document.querySelectorAll('[class*="xs:"]'),t=document.querySelectorAll('[class*="sm:"]'),o=document.querySelectorAll('[class*="md:"]'),n=document.querySelectorAll('[class*="lg:"]'),r=document.querySelectorAll('[class*="xl:"]');function s(){const e=window.innerWidth;return e<480?"xs:":e<720?"sm:":e<960?"md:":e<1200?"lg:":"xl:"}function l(){function l(e,t){e.forEach((e=>{Array.from(e.classList).forEach((o=>{s()===t?o.startsWith(s())&&o.endsWith("!")&&e.classList.replace(o,o.slice(0,-1)):s()!==t&&o.startsWith(t)&&(o.endsWith("!")||e.classList.replace(o,`${o}!`))}))}))}s(),l(e,"xs:"),l(t,"sm:"),l(o,"md:"),l(n,"lg:"),l(r,"xl:")}l(),window.addEventListener("resize",l)},219:()=>{const e=[];["scroll-fade-up","scroll-fade-down","scroll-fade-left","scroll-fade-right","scroll-fade-up-right","scroll-fade-up-left","scroll-fade-down-right","scroll-fade-down-left","scroll-flip-left","scroll-flip-right","scroll-flip-up","scroll-flip-down","scroll-zoom-in","scroll-zoom-in-up","scroll-zoom-in-down","scroll-zoom-in-left","scroll-zoom-in-right","scroll-zoom-out","scroll-zoom-out-up","scroll-zoom-out-down","scroll-zoom-out-left","scroll-zoom-out-right"].forEach((t=>{document.querySelectorAll(`.${t}`).forEach((t=>e.push(t)))})),window.addEventListener("load",(()=>{e.forEach((e=>{const t=e.getBoundingClientRect().top<.8*window.innerHeight,o=null==e?void 0:e.getAttribute("data-scroll-delay"),n=o?parseFloat(o):null;if(t){if(n)return void setTimeout((()=>e.classList.add("in-view")),n);e.classList.add("in-view")}}))}));let t=window.scrollY;const o=new IntersectionObserver(((e,o)=>{const n=window.scrollY,r=n>t;t=n,e.forEach((e=>{const t=e.target,o=null==t?void 0:t.getAttribute("data-scroll-delay"),n=o?parseFloat(o):null;if(e.isIntersecting&&r){if(n)return void setTimeout((()=>t.classList.add("in-view")),n);t.classList.add("in-view")}else if(!e.isIntersecting&&!r){if(n)return void setTimeout((()=>t.classList.remove("in-view")),n);t.classList.remove("in-view")}}))}),{threshold:.2});e.forEach((e=>o.observe(e)))},248:()=>{const e=document.querySelectorAll('[data-toggle="modal"]');Array.from(e).forEach((e=>{const t=e=>{const t=e.querySelector(".modal-content");e.classList.contains("active")&&(document.body.classList.remove("disabled-scrolling"),t?(t.classList.remove("active"),setTimeout((()=>e.classList.remove("active")),300)):e.classList.remove("active"))};e.addEventListener("click",(o=>{if(o.preventDefault(),(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement)&&(e.classList.contains("disabled")||e.disabled))return;const n=e.getAttribute("data-target");if(!n)return;const r=document.querySelector(n);if(!r)return;const s=r.querySelector(".modal-dialog");r.addEventListener("click",(e=>{const o=e.target;if(o.classList.contains("modal")||o.classList.contains("modal-dialog"))if("static"!==r.getAttribute("data-backdrop"))t(r);else{if(!s)return;(n=s).classList.add("shaking"),setTimeout((()=>n.classList.remove("shaking")),2e3)}var n}));const l=r.querySelectorAll('[data-dismiss="modal"]');Array.from(l).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),t(r)}))})),(e=>{const t=e.querySelector(".modal-content");e.classList.contains("active")||(e.classList.add("active"),document.body.classList.add("disabled-scrolling"),t&&setTimeout((()=>t.classList.add("active")),300))})(r)}))}))},298:()=>{const e=document.querySelectorAll('*[data-tooltip="tooltip"]');Array.from(e).forEach((e=>{const t=e.getAttribute("data-tooltip-title");if(!t)return;const o=document.createElement("style");o.innerHTML=`\n [data-tooltip="tooltip"][data-tooltip-title="${t}"]::after {\n content: "${t}" !important;\n }\n `,document.head.appendChild(o)}))},447:()=>{const e=document.querySelectorAll(".alert");Array.from(e).forEach((e=>{const t=e.querySelector('button[data-remove="alert"]');if(!t)return;let o=!0;e.className.includes("@")&&(o=!1),t.addEventListener("click",(t=>{t.preventDefault(),function(e,t){t?e.remove():(e.classList.add("removing"),setTimeout((()=>e.remove()),300))}(e,o)}))}))},483:()=>{const e=document.querySelectorAll(".navbar");function t(e,t){e.classList.remove("active"),t.classList.remove("collapsed")}Array.from(e).forEach((e=>{const o=e.querySelector(".navbar-toggle"),n=e.querySelector(".navbar-collapse");o&&n&&(o.addEventListener("click",(()=>{n.classList.contains("collapsed")?t(o,n):function(e,t){e.classList.add("active"),t.classList.add("collapsed")}(o,n)})),"static"!==n.getAttribute("data-backdrop")&&document.addEventListener("click",(r=>{e.contains(r.target)||n.classList.contains("collapsed")&&t(o,n)})),window.addEventListener("resize",(()=>{n.classList.contains("collapsed")&&t(o,n)})))}))},529:()=>{document.querySelectorAll('a[href^="#"]').forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault();const o=e.getAttribute("href");if(o&&"#"!==o){const e=document.querySelector(o);e&&e.scrollIntoView({behavior:"smooth"})}}))}))},694:()=>{const e=document.querySelectorAll(".toast");function t(e,t){t?e.remove():(e.classList.add("removing"),setTimeout((()=>e.remove()),300))}Array.from(e).forEach((e=>{const o=e.querySelector('button[data-remove="toast"]');if(!o)return;let n=!0;e.className.includes("@")&&(n=!1);const r=e.getAttribute("data-toast-duration"),s=!(!r||isNaN(+r))&&+r;s&&function(e,o,n){const r=e.querySelector(".toast-expiry-bar");let s=null;if(r){let e=0;s=setInterval((()=>{e+=10,r.style.width=100-100*e/o+"%"}),10)}setTimeout((()=>{t(e,n),s&&clearInterval(s)}),o)}(e,s,n),o.addEventListener("click",(o=>{o.preventDefault(),t(e,n)}))}))},704:()=>{const e=document.querySelectorAll('*[data-toggle="offcanvas"]'),t=Array.from(e),o=Array.from(document.querySelectorAll(".offcanvas"));function n(e,t){const o=e.querySelector(".offcanvas-content.show");o?(o.classList.remove("show"),setTimeout((()=>e.classList.remove("show")),300)):e.classList.remove("show"),t||document.body.classList.remove("disabled-scrolling")}t.forEach((e=>{const t=e.getAttribute("data-target");if(!t)return;const o=document.querySelector(t);if(!o)return;const r="true"===o.getAttribute("data-scroll");e.addEventListener("click",(t=>{t.preventDefault(),(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement)&&(e.classList.contains("disabled")||e.disabled)||(o.classList.contains("show")?n(o,r):function(e,t){const o=e.querySelector(".offcanvas-content");e.classList.add("show"),o&&setTimeout((()=>o.classList.add("show")),300),t||document.body.classList.add("disabled-scrolling")}(o,r))})),Array.from(o.querySelectorAll('*[data-dismiss="offcanvas"]')).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),n(o,r)}))})),"static"!==o.getAttribute("data-backdrop")&&document.addEventListener("click",(t=>{e===t.target||o.contains(t.target)||o.classList.contains("show")&&n(o,r)}))})),o.forEach((e=>{const t="true"===e.getAttribute("data-scroll");e.addEventListener("click",(o=>{"static"!==e.getAttribute("data-backdrop")&&e===o.target&&n(e,t)}))}))},764:()=>{const e=document.querySelectorAll(".dropdown");function t(e,t,o,n,r){e.classList.add("collapsed"),"x"===r?o.style.width="0":o.style.height="0",t&&t.classList.add("active"),setTimeout((()=>{"x"===r?o.style.width=`${n}px`:o.style.height=`${n}px`}),10)}function o(e,t,o,n){"x"===n?o.style.width="0":o.style.height="0",t&&t.classList.remove("active"),e.classList.remove("collapsed")}Array.from(e).forEach((e=>{const n=!!e&&"true"===e.getAttribute("data-close-previous"),r=e.querySelector(".dropdown-toggle"),s=e.querySelector(".dropdown-menu");if(r&&s){const l=r.getAttribute("data-dropdown-trigger")||"click",c=r.querySelector(".btn-arrow");let a,i;e.classList.contains("dropdown-left")||e.classList.contains("dropdown-right")?(i="x",a=s.offsetWidth):(i="y",a=s.offsetHeight);let d=!1;r.addEventListener("click",(l=>{l.preventDefault(),r.classList.contains("disabled")||r.disabled||(e.classList.contains("collapsed")?o(e,c,s,i):(n&&function(){const e=document.querySelectorAll(".dropdown.collapsed");Array.from(e).forEach((e=>{const t=e.querySelector(".dropdown-menu"),n=e.querySelector(".btn-arrow");if(!t)return;let r;r=e.classList.contains("dropdown-left")||e.classList.contains("dropdown-right")?"x":"y",o(e,n,t,r)}))}(),t(e,c,s,a,i),d=!1))})),"hover-click"===l&&(r.addEventListener("mouseenter",(()=>{e.classList.contains("collapsed")||r.classList.contains("disabled")||r.disabled||(t(e,c,s,a,i),d=!0)})),r.addEventListener("mouseleave",(()=>{e.classList.contains("collapsed")&&d&&o(e,c,s,i)})))}}))},814:(e,t,o)=>{o.r(t)},843:()=>{const e=document.querySelectorAll(".accordion");function t(e,t,o){e.classList.remove("collapsed"),t.style.height="0",o&&o.classList.remove("active")}Array.from(e),e.forEach((e=>{const o=document.querySelectorAll(".accordion-header"),n=Array.from(o),r="true"===(null==e?void 0:e.getAttribute("data-allow-multiple"));n.length>1&&n.forEach((o=>{o.addEventListener("click",(n=>{const s=n.target.closest(".accordion-item");let l=null;if(!s)return;if(l=s.querySelector(".accordion-collapse"),!l)return;const c=o.querySelector(".accordion-header-button"),a=l.querySelector(".accordion-body");s.classList.contains("collapsed")?t(s,l,c):(r||function(e){const o=e.querySelectorAll(".accordion-item.collapsed"),n=Array.from(o);n.length<1||n.forEach((e=>{const o=e.querySelector(".accordion-collapse");if(!o)return;const n=e.querySelector(".accordion-header-button");t(e,o,n)}))}(e),function(e,t,o,n){e.classList.add("collapsed"),n&&(t.style.height=`${n.offsetHeight}px`),o&&o.classList.add("active")}(s,l,c,a))}))}))}))},851:()=>{const e=Array.from(document.querySelectorAll(".carousel"));let t=0,o=0;function n(e,t,o){let n=null,r=null;const s=e.length;if(s<=0)return{previousIndex:null,currentIndex:null};for(let t=0;t<e.length;t++)if(e[t].classList.contains("active")){n=t;break}return null===n?{previousIndex:null,currentIndex:null}:t?("forward"===t?n+1>=s?(r=n,n=0):(r=n,n++):"backward"===t&&(n<=0?(r=n,n=s-1):(r=n,n--)),{previousIndex:r,currentIndex:n}):null!=o?(r=n,n=o,{previousIndex:r,currentIndex:n}):{previousIndex:null,currentIndex:null}}function r(e,t,o,n,r){if(null==o||null==n)return;!function(e,t,o){e[t].classList.contains("active")&&(e[t].classList.remove("active"),e[o].classList.add("active"))}(t,o,n),function(e,t,o){const n=Array.from(e.querySelectorAll(".carousel-indicator"));n.length<1||(n[t].classList.remove("active"),n[o].classList.add("active"))}(e,o,n);const s=e.classList.contains("carousel-slide"),l=e.classList.contains("infinity");if(s){if(l)return void function(e,t,o,n,r){const s=e.querySelector(".carousel-inner");s&&(function(e,t){t.forEach((e=>e.style.display="none"));const o=Array.from(e.querySelectorAll(".temporary-item"));o.length<1||o.forEach((e=>e.remove()))}(s,t),function(e,t,o,n,r){const s=window.getComputedStyle(e).transition;e.style.transition="none","forward"===t?(function(e,t,o,n){if(t.length<1)return;const r=t[o].cloneNode(!0);r.style.display="flex",r.classList.add("temporary-item"),e.appendChild(r);const s=t[n].cloneNode(!0);s.style.display="flex",s.classList.add("temporary-item"),e.appendChild(s)}(e,o,n,r),e.style.left="0",setTimeout((()=>{e.style.transition=s,e.style.left="-100%"}),10)):"backward"===t&&(function(e,t,o,n){if(t.length<1)return;const r=t[n].cloneNode(!0);r.style.display="flex",r.classList.add("temporary-item"),e.appendChild(r);const s=t[o].cloneNode(!0);s.style.display="flex",s.classList.add("temporary-item"),e.appendChild(s)}(e,o,n,r),e.style.left="-100%",setTimeout((()=>{e.style.transition=s,e.style.left="0"}),10))}(s,r,t,o,n))}(e,t,o,n,r);!function(e,t){const o=e.querySelector(".carousel-inner");o&&(o.style.left=`-${100*t}%`)}(e,n)}}function s(e,t,o){return t-o>e?"forward":o-t>e?"backward":null}e.forEach((e=>{const l=Array.from(document.querySelectorAll(".carousel-item")),c=e.classList.contains("carousel-fade");l.length<1||(function(e){let t=!1;e.forEach(((e,o)=>{e.classList.contains("active")&&(t=!0)})),t||e[0].classList.add("active")}(l),function(e,t){let o=!1;const n=e.querySelector(".carousel-indicators");n&&t.forEach(((e,t)=>{const r=document.createElement("span");r.classList.add("carousel-indicator"),r.setAttribute("data-carousel-slide-index",`${t}`),e.classList.contains("active")&&!o&&(r.classList.add("active"),o=!0),n.appendChild(r)}))}(e,l),function(e){e.forEach((e=>{const t=e.querySelector(".carousel-img");if(!t)return;const o=t.getAttribute("src")?t.getAttribute("src"):null;o&&(e.style.backgroundImage=`url(${o})`)}))}(l),c||function(e,t){const o=e.querySelector(".carousel-inner");if(o)for(let e=0;e<t.length;e++)if(t[e].classList.contains("active")){let t=window.getComputedStyle(o).transition;return o.style.transition="none",o.style.left=`-${100*e}%`,void setTimeout((()=>{o.style.transition=t}),100)}}(e,l),function(e,l,c){let a=!1,i=null,d=null;const u=e.querySelector(".carousel-control-prev"),f=e.querySelector(".carousel-control-next"),m=Array.from(e.querySelectorAll(".carousel-indicator")),v=()=>{c||(a=!0,setTimeout((()=>{a=!1}),500))};u&&u.addEventListener("click",(t=>{if(t.preventDefault(),a)return;const{previousIndex:o,currentIndex:s}=n(l,"backward",null);i=o,d=s,null!=i&&null!=d&&r(e,l,i,d,"backward"),v()})),f&&f.addEventListener("click",(t=>{if(t.preventDefault(),a)return;const{previousIndex:o,currentIndex:s}=n(l,"forward",null);i=o,d=s,null!=i&&null!=d&&r(e,l,i,d,"forward"),v()})),m.length>0&&m.forEach(((t,o)=>{t.addEventListener("click",(t=>{if(t.preventDefault(),a)return;const{previousIndex:s,currentIndex:c}=n(l,null,o);i=s,d=c,null!=i&&null!=d&&r(e,l,i,d,function(e,t){return t>e?"forward":"backward"}(i,d)),v()}))})),e.addEventListener("touchstart",(e=>{if(e.preventDefault(),a)return;const o=e.touches[0];t=o.clientX})),e.addEventListener("touchend",(c=>{if(c.preventDefault(),a)return;const u=c.changedTouches[0];o=u.clientX;const f=s(e.offsetWidth/3,t,o);if(!f)return;const{previousIndex:m,currentIndex:v}=n(l,f,null);i=m,d=v,r(e,l,i,d,f)})),e.addEventListener("mousedown",(c=>{if(c.preventDefault(),a)return;t=c.clientX;const u=c=>{o=c.clientX;const a=s(e.offsetWidth/3,t,o);if(!a)return;const{previousIndex:f,currentIndex:m}=n(l,a,null);i=f,d=m,r(e,l,i,d,a),document.removeEventListener("mouseup",u)};document.addEventListener("mouseup",u)}));const p=e.hasAttribute("data-carousel-move-interval")?parseInt(e.getAttribute("data-carousel-move-interval")):null;if(null!=p){let t=!1;setInterval((()=>{if(a||t)return;const{previousIndex:o,currentIndex:s}=n(l,"forward",null);i=o,d=s,null!=i&&null!=d&&r(e,l,i,d,"forward"),v()}),p),e.addEventListener("mouseenter",(e=>{t=!0})),e.addEventListener("touchstart",(e=>{t=!0})),e.addEventListener("mouseleave",(e=>{setTimeout((()=>{t=!1}),p)})),e.addEventListener("touchend",(e=>{setTimeout((()=>{t=!1}),p)}))}}(e,l,c))}))},867:()=>{Array.from(document.querySelectorAll(".breadcrumb")).forEach((e=>{const t=e.getAttribute("data-breadcrumb-divider");let o;const n=Array.from(e.querySelectorAll(".breadcrumb-item"));t&&0!==n.length&&(o=[".jpg",".jpeg",".png",".gif",".bmp",".svg"].some((e=>t.toLowerCase().endsWith(e)||t.toLowerCase().startsWith("http"))),n.forEach(((e,n)=>{const r=document.createElement("style");r.textContent+=o?`\n .breadcrumb-item:nth-child(${n+1})::before {\n background-image: url('${t}') !important;\n content: '' !important;\n width: 10px !important;\n height: 10px !important;\n margin-right: 0.75rem;\n }\n `:`\n .breadcrumb-item:nth-child(${n+1})::before {\n content: '${t}' !important;\n }\n `,document.head.appendChild(r)})))}))}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),o(814),o(120),o(764),o(298),o(843),o(447),o(694),o(248),o(704),o(867),o(851),o(483),o(529),o(219)})(),n})()));