3 lines
6.3 KiB
JavaScript
3 lines
6.3 KiB
JavaScript
"use strict";function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(o),!0).forEach(function(e){_defineProperty(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var docReady=function(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):setTimeout(e,1)},resize=function(e){return window.addEventListener("resize",e)},isIterableArray=function(e){return Array.isArray(e)&&!!e.length},camelize=function(e){var t=e.replace(/[-_\s.]+(.)?/g,function(e,t){return t?t.toUpperCase():""});return"".concat(t.substr(0,1).toLowerCase()).concat(t.substr(1))},getData=function(t,o){try{return JSON.parse(t.dataset[camelize(o)])}catch(e){return t.dataset[camelize(o)]}},hexToRgb=function(e){var t=0===e.indexOf("#")?e.substring(1):e,o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,o,n){return t+t+o+o+n+n}));return o?[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]:null},rgbaColor=function(e,t){var o=1<arguments.length&&void 0!==t?t:.5;return"rgba(".concat(hexToRgb(0<arguments.length&&void 0!==e?e:"#fff"),", ").concat(o,")")},colors={primary:"#0057FF",secondary:"#748194",success:"#00d27a",info:"#27bcfd",warning:"#f5803e",danger:"#e63757",light:"#f9fafd",dark:"#000"},grays={white:"#fff",100:"#f9fafd",200:"#edf2f9",300:"#d8e2ef",400:"#b6c1d2",500:"#9da9bb",600:"#748194",700:"#5e6e82",800:"#4d5969",900:"#344050",1e3:"#232e3c",1100:"#0b1727",black:"#000"},hasClass=function(e,t){return e.classList.value.includes(t)},addClass=function(e,t){e.classList.add(t)},getOffset=function(e){var t=e.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,n=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+n,left:t.left+o}},isScrolledIntoView=function(e){for(var t=e.offsetTop,o=e.offsetLeft,n=e.offsetWidth,a=e.offsetHeight;e.offsetParent;)t+=(e=e.offsetParent).offsetTop,o+=e.offsetLeft;return{all:t>=window.pageYOffset&&o>=window.pageXOffset&&t+a<=window.pageYOffset+window.innerHeight&&o+n<=window.pageXOffset+window.innerWidth,partial:t<window.pageYOffset+window.innerHeight&&o<window.pageXOffset+window.innerWidth&&t+a>window.pageYOffset&&o+n>window.pageXOffset}},breakpoints={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1540},getBreakpoint=function(e){var t,o=e&&e.classList.value;return o&&(t=breakpoints[o.split(" ").filter(function(e){return e.includes("navbar-expand-")}).pop().split("-").pop()]),t},setCookie=function(e,t,o){var n=new Date;n.setTime(n.getTime()+o),document.cookie="".concat(e,"=").concat(t,";expires=").concat(n.toUTCString())},getCookie=function(e){var t=document.cookie.match("(^|;) ?".concat(e,"=([^;]*)(;|$)"));return t?t[2]:t},settings={tinymce:{theme:"oxide"},chart:{borderColor:"rgba(255, 255, 255, 0.8)"}},newChart=function(e,t){var o=e.getContext("2d");return new window.Chart(o,t)},getItemFromStore=function(t,o,e){var n=2<arguments.length&&void 0!==e?e:localStorage;try{return JSON.parse(n.getItem(t))||o}catch(e){return n.getItem(t)||o}},setItemToStore=function(e,t,o){return(2<arguments.length&&void 0!==o?o:localStorage).setItem(e,t)},getStoreSpace=function(e){var t=0<arguments.length&&void 0!==e?e:localStorage;return parseFloat((escape(encodeURIComponent(JSON.stringify(t))).length/1048576).toFixed(2))},utils={docReady:docReady,resize:resize,isIterableArray:isIterableArray,camelize:camelize,getData:getData,hasClass:hasClass,addClass:addClass,hexToRgb:hexToRgb,rgbaColor:rgbaColor,colors:colors,grays:grays,getOffset:getOffset,isScrolledIntoView:isScrolledIntoView,getBreakpoint:getBreakpoint,setCookie:setCookie,getCookie:getCookie,newChart:newChart,settings:settings,getItemFromStore:getItemFromStore,setItemToStore:setItemToStore,getStoreSpace:getStoreSpace},detectorInit=function(){var e=window.is,t=document.querySelector("html");e.opera()&&addClass(t,"opera"),e.mobile()&&addClass(t,"mobile"),e.firefox()&&addClass(t,"firefox"),e.safari()&&addClass(t,"safari"),e.ios()&&addClass(t,"ios"),e.iphone()&&addClass(t,"iphone"),e.ipad()&&addClass(t,"ipad"),e.ie()&&addClass(t,"ie"),e.edge()&&addClass(t,"edge"),e.chrome()&&addClass(t,"chrome"),e.mac()&&addClass(t,"osx"),e.windows()&&addClass(t,"windows"),navigator.userAgent.match("CriOS")&&addClass(t,"chrome")},navbarInit=function(){var t,o,n,e,a,r,s,i,c,d,l,f,u="[data-navbar-on-scroll]",g=".navbar-collapse",p=".navbar-toggler",w="collapsed",b="scroll",m="show.bs.collapse",h="hide.bs.collapse",y="hidden.bs.collapse",C=document.querySelector(u);C&&(t=window.innerHeight,o=document.documentElement,n=C.querySelector(g),e=_objectSpread(_objectSpread({},utils.colors),utils.grays),a=utils.getData(C,"navbar-light-on-scroll"),s=e[r=Object.keys(e).includes(a)?a:"light"],i="bg-".concat(r),c="shadow-transition",d=utils.hexToRgb(s),l=window.getComputedStyle(C).backgroundImage,f="background-color 0.35s ease",C.style.backgroundImage="none",window.addEventListener(b,function(){var e=o.scrollTop/t*5;1<=e&&(e=1),C.style.backgroundColor="rgba(".concat(d[0],", ").concat(d[1],", ").concat(d[2],", ").concat(e,")"),C.style.backgroundImage=0<e||utils.hasClass(n,"show")?l:"none",0<e||utils.hasClass(n,"show")?C.classList.add(c):C.classList.remove(c)}),utils.resize(function(){var e=utils.getBreakpoint(C);window.innerWidth>e?(C.style.backgroundImage=o.scrollTop?l:"none",C.style.transition="none"):utils.hasClass(C.querySelector(p),w)||(C.classList.add(i),C.classList.add(c),C.style.backgroundImage=l),window.innerWidth<=e&&(C.style.transition=utils.hasClass(n,"show")?f:"none")}),n.addEventListener(m,function(){C.classList.add(i),C.classList.add(c),C.style.backgroundImage=l,C.style.transition=f}),n.addEventListener(h,function(){C.classList.remove(i),C.classList.remove(c),o.scrollTop||(C.style.backgroundImage="none")}),n.addEventListener(y,function(){C.style.transition="none"}))};docReady(navbarInit),docReady(detectorInit);
|
|
//# sourceMappingURL=theme.min.js.map
|