Theme Files Update

This commit is contained in:
GitHub Action 2023-11-04 13:07:47 +00:00
parent fd8f00f27a
commit 3eabdaf2b4
12 changed files with 98 additions and 9 deletions

View file

@ -1,7 +1,3 @@
/**
* Utils
*/
// Throttle
//
const throttle = (callback, limit) => {
@ -63,6 +59,23 @@ const toggleMobileMenu = () => {
}
}
// Social Share Toggle
//
let shareMenuVisible = false;
const shareMobileMenu = () => {
let shareMenu = document.getElementById('share-links');
if (shareMenuVisible == false) {
shareMenu.style.animationName = 'bounceInRight';
shareMenu.style.webkitAnimationName = 'bounceInRight';
shareMenu.style.display = 'block';
shareMenuVisible = true;
} else {
shareMenu.style.animationName = 'bounceOutRight';
shareMenu.style.webkitAnimationName = 'bounceOutRight'
shareMenuVisible = false;
}
}
// Featured Image Toggle
//
const showImg = () => {
@ -82,6 +95,7 @@ const toggleToc = () => {
if (header !== null) {
listen('#menu-btn', "click", toggleMobileMenu);
listen('#share-btn', "click", shareMobileMenu);
listen('#toc-btn', "click", toggleToc);
listen('#img-btn', "click", showImg);
listen('.bg-img', "click", hideImg);
@ -98,5 +112,8 @@ if (header !== null) {
if (mobileMenuVisible == true) {
toggleMobileMenu();
}
if (shareMenuVisible == true) {
shareMobileMenu();
}
}, 250));
}