-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Bolt: Optimize background image rendering in home8 sections #77
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
Changes from all commits
0b26260
f626f4d
6ae4d46
0791ade
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,12 +16,11 @@ export default function Section4({ sponsors }: Readonly<Section4Props>) { | |
| id="sponsors" | ||
| className="brands8-section-area sp8" | ||
| style={{ | ||
| backgroundImage: "url(/assets/img/bg/header-bg20.png)", | ||
| backgroundRepeat: "no-repeat", | ||
| backgroundSize: "cover", | ||
| backgroundPosition: "center", | ||
| position: "relative", | ||
| }} | ||
| > | ||
| {/* ⚡ Bolt Optimization: Replaced CSS backgroundImage with Next.js Image for automatic WebP conversion, resizing, and lazy loading. Expected impact: Faster LCP and reduced payload. */} | ||
| <Image src="/assets/img/bg/header-bg20.png" alt="Background Texture" fill style={{ objectFit: "cover", zIndex: -1 }} /> | ||
|
Comment on lines
18
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve maintainability and separation of concerns, it's recommended to move inline styles to CSS classes. Both the For example, you could define these classes in a relevant .section-with-background {
position: relative;
}
.section-background-image {
object-fit: cover;
z-index: -1;
}Then you can apply them using the |
||
| <Image src="/assets/img/elements/layer1.png" className="layer1" alt="" fill priority /> | ||
| <div className="container"> | ||
| {!hasSponsors && ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,12 +74,11 @@ export default function Section5({ year, speakers, totalSpeakers }: Readonly<Sec | |
| <div | ||
| className="team8-section-rea sp1" | ||
| style={{ | ||
| backgroundImage: "url(/assets/img/bg/header-bg20.png)", | ||
| backgroundRepeat: "no-repeat", | ||
| backgroundSize: "cover", | ||
| backgroundPosition: "center", | ||
| position: "relative", | ||
| }} | ||
| > | ||
| {/* ⚡ Bolt Optimization: Replaced CSS backgroundImage with Next.js Image for automatic WebP conversion, resizing, and lazy loading. Expected impact: Faster LCP and reduced payload. */} | ||
| <Image src="/assets/img/bg/header-bg20.png" alt="Background Texture" fill style={{ objectFit: "cover", zIndex: -1 }} /> | ||
|
Comment on lines
76
to
+81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve maintainability and separation of concerns, it's recommended to move inline styles to CSS classes. Both the For example, you could define these classes in a relevant .section-with-background {
position: relative;
}
.section-background-image {
object-fit: cover;
z-index: -1;
}Then you can apply them using the |
||
| <div className="container"> | ||
| <div className="row"> | ||
| <div className="col-lg-5"> | ||
|
|
||
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.
To improve maintainability and separation of concerns, it's recommended to move inline styles to CSS classes. Both the
position: relativeon the container and theobjectFit/zIndexon theImagecould be moved to classes in a shared stylesheet. This is especially beneficial since this background setup is duplicated across multiple sections.For example, you could define these classes in a relevant
.scssfile:Then you can apply them using the
classNameprop, which keeps the JSX cleaner and makes the styles reusable.