Added theme archvier and changes to blocks

This commit is contained in:
Jeremy Rangel
2025-01-01 18:09:33 -08:00
parent 21b00e1937
commit d928a0e8fd
21 changed files with 342 additions and 158 deletions

View File

@ -21,5 +21,22 @@
*/
/* eslint-disable no-console */
console.log( 'Hello World! (from create-block-lcp-viewport block)' );
/* eslint-enable no-console */
document.addEventListener('DOMContentLoaded', function() {
// Get the element with the id "lcp-header-container"
var headerContainer = document.getElementById('lcp-header-container');
// Check if the element exists
if (headerContainer) {
// Get the height of the header container
var headerHeight = headerContainer.offsetHeight;
// Get the current value of the --lcp--header--height custom property
var currentHeaderHeight = getComputedStyle(document.documentElement).getPropertyValue('--lcp--header--height').trim();
// Compare if the current value is different from the new headerHeight (in px)
if (currentHeaderHeight !== headerHeight + 'px') {
// If they are different, update the --lcp--header--height custom property
document.documentElement.style.setProperty('--lcp--header--height', headerHeight + 'px');
}
}
});