Add parallax effect to masthead - #116
Conversation
- Update `_sass/layout/_masthead.scss` to use `background-attachment: fixed` for screens 768px and wider. - Implement an optimized JavaScript-driven parallax effect in `assets/js/app.js` for screens where fixed background attachment is not applied. - Ensure the effect is only active on pages containing a `.masthead` element. - Optimize performance by caching DOM elements and moving expensive checks outside the scroll listener. Co-authored-by: brettfxio <105930054+brettfxio@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This change adds a parallax effect to the masthead for any page with a masthead image. It uses a hybrid approach:
background-attachment: fixedis applied toheader.mastheadfor screens 768px and wider, providing a smooth, native effect where supported.assets/js/app.jsdynamically adjusts the background position for smaller screens or where the CSS-only effect is disabled.The implementation was optimized to avoid unnecessary layout reflows and only runs on pages with a masthead.
PR created automatically by Jules for task 5688058831080564667 started by @brettfxio