mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-24 08:45:07 +01:00
add pre-push hook
This commit is contained in:
parent
de5d80ad37
commit
15b173ead8
4
.husky/pre-push
Executable file
4
.husky/pre-push
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
yarn build && git add . && git commit --amend --no-edit
|
@ -1,7 +1 @@
|
||||
(function(){var __webpack_modules__={"./assets/js/menu.js":
|
||||
/*!***************************!*\
|
||||
!*** ./assets/js/menu.js ***!
|
||||
\***************************/function(){eval('var container = document.querySelector(".container");\nvar menu = document.querySelector(".menu");\nvar mobileMenuTrigger = document.querySelector(".menu-trigger");\nvar desktopMenu = document.querySelector(".menu__inner--desktop");\nvar desktopMenuTrigger = document.querySelector(".menu__sub-inner-more-trigger");\nvar menuMore = document.querySelector(".menu__sub-inner-more");\nvar mobileQuery = getComputedStyle(document.body).getPropertyValue("--phoneWidth");\n\nvar isMobile = function isMobile() {\n return window.matchMedia(mobileQuery).matches;\n};\n\nvar isMobileMenu = function isMobileMenu() {\n mobileMenuTrigger && mobileMenuTrigger.classList.toggle("hidden", !isMobile());\n menu && menu.classList.toggle("hidden", isMobile());\n menuMore && menuMore.classList.toggle("hidden", !isMobile());\n}; // Common\n\n\nmenu && menu.addEventListener("click", function (e) {\n return e.stopPropagation();\n});\nmenuMore && menuMore.addEventListener("click", function (e) {\n return e.stopPropagation();\n});\nisMobileMenu();\ndocument.body.addEventListener("click", function () {\n if (!isMobile() && menuMore && !menuMore.classList.contains("hidden")) {\n menuMore.classList.add("hidden");\n } else if (isMobile() && !menu.classList.contains("hidden")) {\n menu.classList.add("hidden");\n }\n});\nwindow.addEventListener("resize", isMobileMenu); // Mobile menu\n\nmobileMenuTrigger && mobileMenuTrigger.addEventListener("click", function (e) {\n e.stopPropagation();\n menu && menu.classList.toggle("hidden");\n}); // Desktop menu\n\ndesktopMenuTrigger && desktopMenuTrigger.addEventListener("click", function (e) {\n e.stopPropagation();\n menuMore && menuMore.classList.toggle("hidden");\n\n if (menuMore && menuMore.getBoundingClientRect().right > container.getBoundingClientRect().right) {\n menuMore.style.left = "auto";\n menuMore.style.right = 0;\n }\n});\n\n//# sourceURL=webpack://hello-friend/./assets/js/menu.js?')},"./assets/js/theme.js":
|
||||
/*!****************************!*\
|
||||
!*** ./assets/js/theme.js ***!
|
||||
\****************************/function(){eval('// Toggle theme\nvar getTheme = window.localStorage && window.localStorage.getItem("theme");\nvar themeToggle = document.querySelector(".theme-toggle");\nvar isDark = getTheme === "dark";\n\nif (getTheme !== null) {\n document.body.classList.toggle("dark-theme", isDark);\n}\n\nthemeToggle.addEventListener("click", function () {\n document.body.classList.toggle("dark-theme");\n window.localStorage && window.localStorage.setItem("theme", document.body.classList.contains("dark-theme") ? "dark" : "light");\n});\n\n//# sourceURL=webpack://hello-friend/./assets/js/theme.js?')}};__webpack_modules__["./assets/js/menu.js"]();var __webpack_exports__={};__webpack_modules__["./assets/js/theme.js"]()})();
|
||||
!function(){var e,t,n,o,i,d,c,s,r,a,l;e=document.querySelector(".container"),t=document.querySelector(".menu"),n=document.querySelector(".menu-trigger"),document.querySelector(".menu__inner--desktop"),o=document.querySelector(".menu__sub-inner-more-trigger"),i=document.querySelector(".menu__sub-inner-more"),d=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),c=function(){return window.matchMedia(d).matches},s=function(){n&&n.classList.toggle("hidden",!c()),t&&t.classList.toggle("hidden",c()),i&&i.classList.toggle("hidden",!c())},t&&t.addEventListener("click",(function(e){return e.stopPropagation()})),i&&i.addEventListener("click",(function(e){return e.stopPropagation()})),s(),document.body.addEventListener("click",(function(){c()||!i||i.classList.contains("hidden")?c()&&!t.classList.contains("hidden")&&t.classList.add("hidden"):i.classList.add("hidden")})),window.addEventListener("resize",s),n&&n.addEventListener("click",(function(e){e.stopPropagation(),t&&t.classList.toggle("hidden")})),o&&o.addEventListener("click",(function(t){t.stopPropagation(),i&&i.classList.toggle("hidden"),i&&i.getBoundingClientRect().right>e.getBoundingClientRect().right&&(i.style.left="auto",i.style.right=0)})),r=window.localStorage&&window.localStorage.getItem("theme"),a=document.querySelector(".theme-toggle"),l="dark"===r,null!==r&&document.body.classList.toggle("dark-theme",l),a.addEventListener("click",(function(){document.body.classList.toggle("dark-theme"),window.localStorage&&window.localStorage.setItem("theme",document.body.classList.contains("dark-theme")?"dark":"light")}))}();
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user