Skip to content
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

Merged
merged 14 commits into from
Jun 8, 2024
Merged

Floating agent bottom #238

merged 14 commits into from
Jun 8, 2024

Conversation

RitwikSrivastava
Copy link
Collaborator

The floating agent footer should toggle visibility based on the hero visibility.

Fix #160

Test URLs:

Copy link

aem-code-sync bot commented May 27, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented May 27, 2024

Page Scores Audits Google
/drafts/ritsriva/nancy1 PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent May 27, 2024 09:23 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent May 27, 2024 09:23 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent May 27, 2024 09:41 Inactive
@RitwikSrivastava RitwikSrivastava requested a review from bstopp May 27, 2024 09:44
blocks/floatingagent/floatingagent.js Outdated Show resolved Hide resolved
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent May 29, 2024 06:25 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent May 29, 2024 06:26 Inactive
@RitwikSrivastava RitwikSrivastava requested a review from bstopp May 29, 2024 06:26
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent May 31, 2024 15:04 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent June 3, 2024 08:12 Inactive
@RitwikSrivastava RitwikSrivastava requested a review from bstopp June 3, 2024 08:12
@RitwikSrivastava
Copy link
Collaborator Author

@bstopp review comment incorporated. Please re-review.

@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent June 4, 2024 05:53 Inactive
blocks/floatingagent/floatingagent.js Outdated Show resolved Hide resolved
Comment on lines 52 to 68
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);
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent June 4, 2024 14:15 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent June 4, 2024 14:19 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent June 4, 2024 14:21 Inactive
margin-right: 5%;
}

@media (max-width: 600px) {
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.

@aem-code-sync aem-code-sync bot temporarily deployed to floatingagent June 5, 2024 05:25 Inactive
@RitwikSrivastava RitwikSrivastava merged commit 9153bac into main Jun 8, 2024
2 checks passed
@bstopp bstopp deleted the floatingagent branch June 17, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent Template - Floating Footer
2 participants