Add debian contribution
This commit is contained in:
parent
deabcecf4b
commit
6c22d0811e
92 changed files with 7039 additions and 9 deletions
1
themes/hello-friend-ng-clone/assets/js/main.js
Normal file
1
themes/hello-friend-ng-clone/assets/js/main.js
Normal file
|
@ -0,0 +1 @@
|
|||
// Some code could be here ...
|
22
themes/hello-friend-ng-clone/assets/js/menu.js
Normal file
22
themes/hello-friend-ng-clone/assets/js/menu.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Mobile menu
|
||||
|
||||
const menuTrigger = document.querySelector(".menu-trigger");
|
||||
const menu = document.querySelector(".menu");
|
||||
const mobileQuery = getComputedStyle(document.body).getPropertyValue(
|
||||
"--phoneWidth"
|
||||
);
|
||||
const isMobile = () => window.matchMedia(mobileQuery).matches;
|
||||
const isMobileMenu = () => {
|
||||
menuTrigger && menuTrigger.classList.toggle("hidden", !isMobile());
|
||||
menu && menu.classList.toggle("hidden", isMobile());
|
||||
};
|
||||
|
||||
isMobileMenu();
|
||||
|
||||
menuTrigger &&
|
||||
menuTrigger.addEventListener(
|
||||
"click",
|
||||
() => menu && menu.classList.toggle("hidden")
|
||||
);
|
||||
|
||||
window.addEventListener("resize", isMobileMenu);
|
163
themes/hello-friend-ng-clone/assets/js/prism.js
Normal file
163
themes/hello-friend-ng-clone/assets/js/prism.js
Normal file
File diff suppressed because one or more lines are too long
25
themes/hello-friend-ng-clone/assets/js/theme.js
Normal file
25
themes/hello-friend-ng-clone/assets/js/theme.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Toggle theme
|
||||
|
||||
const theme = window.localStorage && window.localStorage.getItem("theme");
|
||||
const themeToggle = document.querySelector(".theme-toggle");
|
||||
const isDark = theme === "dark";
|
||||
var metaThemeColor = document.querySelector("meta[name=theme-color]");
|
||||
|
||||
if (theme !== null) {
|
||||
document.body.classList.toggle("dark-theme", isDark);
|
||||
isDark
|
||||
? metaThemeColor.setAttribute("content", "#252627")
|
||||
: metaThemeColor.setAttribute("content", "#fafafa");
|
||||
}
|
||||
|
||||
themeToggle.addEventListener("click", () => {
|
||||
document.body.classList.toggle("dark-theme");
|
||||
window.localStorage &&
|
||||
window.localStorage.setItem(
|
||||
"theme",
|
||||
document.body.classList.contains("dark-theme") ? "dark" : "light"
|
||||
);
|
||||
document.body.classList.contains("dark-theme")
|
||||
? metaThemeColor.setAttribute("content", "#252627")
|
||||
: metaThemeColor.setAttribute("content", "#fafafa");
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue