init commit

This commit is contained in:
2025-02-27 10:23:21 +00:00
commit 50ac909260
43 changed files with 44192 additions and 0 deletions

38
assets/js/custom.js Normal file
View File

@@ -0,0 +1,38 @@
jQuery(function ($) {
// Getting links from a page and turning them into a scroll-spy bespoke menu
// FIXME when page loads with #... in url, the scroll spy gets messed up.
let links;
links = document.querySelectorAll("#one, #two, #three")
let url = window.location.href;
let innerContent = "";
links.forEach(link => {
let fullUrl = url + "#" + link.id;
innerContent += "<li><a href=\"" + fullUrl + " \" class=''>" + link.attributes.name.value + "</a></li>"
});
console.log(innerContent)
let menu;
menu = document.getElementById("menu-test-scroll-spy");
menu.innerHTML = innerContent
// Activate Scrollspy
$('.entry-content').scrollspy({
target: '#nav_menu-4'
});
// Refresh Scrollspy
$('[data-spy="scroll"]').each(function () {
$(this).scrollspy("refresh");
});
});

4
assets/js/editor.js Normal file
View File

@@ -0,0 +1,4 @@
wp.domReady ( function() {
wp.blocks.unregisterBlockStyle( 'core/button', 'outline');
wp.blocks.unregisterBlockStyle( 'core/button', 'fill');
});