-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating agent bottom #238
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
@bstopp review comment incorporated. Please re-review. |
const displayedElement = document.querySelector('.floatingagent'); | ||
|
||
const heroElement = document.querySelector('.hero-wrapper'); | ||
|
||
const observer = new IntersectionObserver((entries) => { | ||
entries.forEach((entry) => { | ||
if (entry.isIntersecting) { | ||
displayedElement.style.display = 'none'; | ||
} else { | ||
displayedElement.style.display = 'flex'; | ||
} | ||
}); | ||
}, { | ||
threshold: [0], | ||
}); | ||
|
||
observer.observe(heroElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this move to inside the decorate
function, or will that break it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely thats right. and that will ensure that the observer is only created where the decorate function is executed.
thanks.
Co-authored-by: Bryan Stopp <[email protected]>
margin-right: 5%; | ||
} | ||
|
||
@media (max-width: 600px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you flip this? always start with mobile view as the default, then it's min-width
on up. I realize that will probably have pretty significant changes to the styling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected.
The floating agent footer should toggle visibility based on the hero visibility.
Fix #160
Test URLs: