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

Feature/image cta #31

Merged
merged 12 commits into from
Dec 4, 2023
Merged

Feature/image cta #31

merged 12 commits into from
Dec 4, 2023

Conversation

kailasnadh790
Copy link
Collaborator

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):

Issue: #7

Test URLs:

Copy link

aem-code-sync bot commented Nov 30, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

Copy link

aem-code-sync bot commented Nov 30, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

aem-code-sync bot commented Nov 30, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

aem-code-sync bot commented Nov 30, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

aem-code-sync bot commented Nov 30, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

aem-code-sync bot commented Nov 30, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

aem-code-sync bot commented Nov 30, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

aem-code-sync bot commented Dec 1, 2023

Page Scores Audits Google
/cigaradvisor/drafts/Kailas/image-cta PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

tmaret
tmaret previously approved these changes Dec 1, 2023
Copy link
Collaborator

@bstopp bstopp left a comment

Choose a reason for hiding this comment

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

I'd like to get picture element to pre-save the space for the image, which will be lazy loaded. Without this we'll end up with CLS issues if the block is marked as finished, but then the image loads after other, subsequent, blocks.

This can be done with two steps:

  1. Set the picture to be relative position, then absolute position the image within it. Example CSS
  2. Calculate the width-to-height ratio. Then add this as padding (bottom or top). This creates the space in which the Image will fit when rendered. Example JS.
    1. This step should also set the max-width based on the original image's width. This way the image doesn't grow larger than desired, which can result in pixelation.

This is an example I've used to do this same approach for the free-form images in long form pages:

Copy link
Collaborator Author

@kailasnadh790 kailasnadh790 left a comment

Choose a reason for hiding this comment

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

changes applied

@kailasnadh790 kailasnadh790 requested a review from bstopp December 4, 2023 17:27
@bstopp bstopp merged commit a331621 into main Dec 4, 2023
2 checks passed
@bstopp bstopp deleted the feature/image-cta branch December 4, 2023 18:50
@bstopp bstopp linked an issue Dec 19, 2023 that may be closed by this pull request
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.

CTA Image
3 participants