Refactor CSS comments and improve observer configuration in spring.js for clarity

This commit is contained in:
CodeDevMLH
2026-02-24 19:24:38 +01:00
parent 306b0c5e6e
commit ad4fb7964b
2 changed files with 8 additions and 6 deletions

View File

@@ -51,7 +51,11 @@ function toggleSpring() {
}
const observer = new MutationObserver(toggleSpring);
observer.observe(document.body, { childList: true, subtree: true, attributes: true });
observer.observe(document.body, {
childList: true,
subtree: true,
attributes: true
});
function createPollen(container) {
@@ -145,7 +149,7 @@ function createGrass(container) {
const x = Math.random() * w;
const h = 20 + Math.random() * 50;
const cY = hSVG - h;
const bend = x + (Math.random() * 40 - 20);
const bend = x + (Math.random() * 15 - 7.5); // curvature
const color = Math.random() > 0.5 ? '#4caf50' : '#45a049';
const width = 1 + Math.random() * 2;
const path = `<path d="M ${x} ${hSVG} Q ${bend} ${cY+20} ${bend} ${cY}" stroke="${color}" stroke-width="${width}" fill="none"/>`;
@@ -428,7 +432,6 @@ function createLadybugGif(container) {
bug.style.animation = `spring-crawl 2s ease-in-out infinite`;
// Target the Ladybug to walk on the ground visually (aligning properly with the CSS/SVG grass size)
alignY.style.transform = `translateY(calc(100vh - 5px - 30px))`;
mirror.appendChild(bug);