@@ -211,6 +278,32 @@
Acknowledgments
});
document.querySelector('.hamburger-container').appendChild(clone);
});
+
+ function updateCSSVariables() {
+ const demo = document.getElementById('demo');
+ const hamburgerPaddingX = document.getElementById('hamburger-padding-x').value;
+ const hamburgerPaddingY = document.getElementById('hamburger-padding-y').value;
+ const hamburgerLayerWidth = document.getElementById('hamburger-layer-width').value;
+ const hamburgerLayerHeight = document.getElementById('hamburger-layer-height').value;
+ const hamburgerLayerSpacing = document.getElementById('hamburger-layer-spacing').value;
+ const hamburgerLayerColor = document.getElementById('hamburger-layer-color').value;
+ const hamburgerLayerBorderRadius = document.getElementById('hamburger-layer-border-radius').value;
+ const hamburgerHoverOpacity = document.getElementById('hamburger-hover-opacity').value;
+ const hamburgerActiveLayerColor = document.getElementById('hamburger-active-layer-color').value;
+ const hamburgerActiveHoverOpacity = document.getElementById('hamburger-active-hover-opacity').value;
+ const hamburgerCheckbox = document.getElementById('hamburger-checkbox').checked;
+ demo.style.setProperty('--hamburger-padding-x', `${hamburgerPaddingX}px`);
+ demo.style.setProperty('--hamburger-padding-y', `${hamburgerPaddingY}px`);
+ demo.style.setProperty('--hamburger-layer-width', `${hamburgerLayerWidth}px`);
+ demo.style.setProperty('--hamburger-layer-height', `${hamburgerLayerHeight}px`);
+ demo.style.setProperty('--hamburger-layer-spacing', `${hamburgerLayerSpacing}px`);
+ demo.style.setProperty('--hamburger-layer-color', hamburgerLayerColor);
+ demo.style.setProperty('--hamburger-layer-border-radius', `${hamburgerLayerBorderRadius}px`);
+ demo.style.setProperty('--hamburger-hover-opacity', hamburgerHoverOpacity);
+ demo.style.setProperty('--hamburger-active-layer-color', hamburgerActiveLayerColor);
+ demo.style.setProperty('--hamburger-active-hover-opacity', hamburgerActiveHoverOpacity);
+ demo.classList.toggle('is-active', hamburgerCheckbox);
+ }