Skip to content

Commit 0bbd3b0

Browse files
landing: optimize image payload for issue #10 (#20)
Replace oversized exported PNG assets with resized descriptive image files and WebP variants, update CSS/HTML references, and lazy-load below-the-fold visuals to cut homepage transfer size. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 82839c1 commit 0bbd3b0

40 files changed

Lines changed: 122 additions & 42 deletions

.github/copilot-instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ This is a **static marketing website** for RocketPy (rocketpy.org) - an open-sou
2424
- **Color scheme**: Dark blue/space theme with gradients (`rgba(33, 35, 50, 0.65)`, `rgba(3, 11, 40, 1)`)
2525

2626
### Image Assets
27-
- Background images referenced in CSS (e.g., `url("../images/Default Background.png")`)
28-
- Images use cryptic names from design tool exports (`v35_22.png`, `v73_37.png`)
29-
- Favicon and logo files in `images/` directory
27+
- Background images are referenced in CSS using optimized assets (e.g., `url("../images/hero-background.png")`)
28+
- Section illustrations use descriptive filenames (e.g., `hero-logo-illustration.png`, `community-visual.png`)
29+
- Favicon and logo files are in `images/` directory
3030

3131
## Development Workflow
3232

about.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<meta property="og:url" content="https://rocketpy.org/about.html" />
1818
<meta
1919
property="og:image"
20-
content="https://rocketpy.org/images/logo-white.png"
20+
content="https://rocketpy.org/images/rocketpy-logo-white.png"
2121
/>
2222
<meta name="twitter:card" content="summary_large_image" />
2323
<meta name="twitter:title" content="RocketPy Team - About" />
@@ -27,7 +27,7 @@
2727
/>
2828
<meta
2929
name="twitter:image"
30-
content="https://rocketpy.org/images/logo-white.png"
30+
content="https://rocketpy.org/images/rocketpy-logo-white.png"
3131
/>
3232
<link rel="icon" href="./images/favicon.ico" type="image/x-icon" />
3333
<link rel="manifest" href="./manifest.json" />

css/main.css

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88
--icon-bg: rgba(20, 25, 45, 0.8);
99
--space-section: clamp(3rem, 7vw, 5.5rem);
1010
--space-content: clamp(1rem, 2.6vw, 1.8rem);
11+
--hero-background-image: url("../images/hero-background.png");
12+
}
13+
14+
@supports (
15+
background-image:
16+
image-set(url("../images/hero-background.webp") type("image/webp"))
17+
) {
18+
:root {
19+
--hero-background-image: image-set(
20+
url("../images/hero-background.webp") type("image/webp"),
21+
url("../images/hero-background.png") type("image/png")
22+
);
23+
}
1124
}
1225

1326
* {
@@ -22,8 +35,9 @@ body {
2235
rgba(3, 11, 40, 0.94) 0%,
2336
rgba(3, 11, 40, 0.99) 100%
2437
),
25-
url("../images/Default Background.png");
38+
var(--hero-background-image);
2639
background-position: center;
40+
background-repeat: no-repeat;
2741
background-size: cover;
2842
color: var(--text-primary);
2943
font-family: "Ruda", sans-serif;
@@ -96,7 +110,12 @@ body::before {
96110
}
97111

98112
.brand-logo {
99-
background: url("../images/v33_6.png") no-repeat center center / contain;
113+
background: url("../images/rocketpy-logo-white.png") no-repeat center center /
114+
contain;
115+
background-image: image-set(
116+
url("../images/rocketpy-logo-white.webp") type("image/webp"),
117+
url("../images/rocketpy-logo-white.png") type("image/png")
118+
);
100119
display: block;
101120
height: 48px;
102121
width: 220px;
@@ -135,7 +154,11 @@ body::before {
135154
}
136155

137156
.simulate-icon {
138-
background: url("../images/v33_9.png") no-repeat center center / contain;
157+
background: url("../images/launch-icon.png") no-repeat center center / contain;
158+
background-image: image-set(
159+
url("../images/launch-icon.webp") type("image/webp"),
160+
url("../images/launch-icon.png") type("image/png")
161+
);
139162
display: inline-block;
140163
height: 14px;
141164
width: 14px;
@@ -253,44 +276,32 @@ body::before {
253276
.hero-logo-graphic,
254277
.environment-graphic,
255278
.predictions-graphic {
256-
background-position: center;
257-
background-repeat: no-repeat;
258-
background-size: contain;
259-
height: 290px;
279+
display: block;
260280
margin: 0 auto;
261281
max-width: 330px;
262282
width: 100%;
263283
}
264284

265-
.hero-logo-graphic {
266-
background-image: url("../images/v35_22.png");
267-
}
268-
269-
.environment-graphic {
270-
background-image: url("../images/v40_94.png");
271-
}
272-
273-
.predictions-graphic {
274-
background-image: url("../images/v36_82.png");
275-
}
276-
277285
.hero-plot-graphic,
278286
.community-graphic {
279-
background-position: center;
280-
background-repeat: no-repeat;
281-
background-size: contain;
287+
display: block;
288+
}
289+
290+
.section-graphic {
291+
display: block;
292+
height: auto;
293+
object-fit: contain;
294+
width: 100%;
282295
}
283296

284297
.hero-plot-graphic {
285-
background-image: url("../images/Group 5.png");
286298
height: 190px;
287299
margin-top: var(--space-content);
288300
max-width: 320px;
301+
width: 100%;
289302
}
290303

291304
.community-graphic {
292-
background-image: url("../images/v73_37.png");
293-
height: 220px;
294305
max-width: 360px;
295306
width: 100%;
296307
}
@@ -338,7 +349,11 @@ body::before {
338349
}
339350

340351
.footer-logo {
341-
background-image: url("../images/v33_7.png");
352+
background-image: url("../images/rocketpy-logo-white.png");
353+
background-image: image-set(
354+
url("../images/rocketpy-logo-white.webp") type("image/webp"),
355+
url("../images/rocketpy-logo-white.png") type("image/png")
356+
);
342357
background-position: left center;
343358
background-repeat: no-repeat;
344359
background-size: contain;

images/Default Background.png

-8.5 MB
Binary file not shown.

images/Group 2.png

-16.6 KB
Binary file not shown.

images/Group 5.png

-55.5 KB
Binary file not shown.

images/Group 6.png

-44.9 KB
Binary file not shown.

images/Vector.png

-5.04 KB
Binary file not shown.

images/community-visual.png

55.2 KB
Loading

images/community-visual.webp

8.85 KB
Loading

0 commit comments

Comments
 (0)