Skip to content

Commit 88b4776

Browse files
authored
Uses webp for home images (#4935)
Uses webp for home page images, saving 200+kb. ## PR Type <!-- Please uncomment one ore more that apply to this PR --> Feature
1 parent dbd51f9 commit 88b4776

8 files changed

Lines changed: 23 additions & 23 deletions

File tree

85.1 KB
Loading
22.2 KB
Loading
26.4 KB
Loading
27.4 KB
Loading
25 KB
Loading
25.7 KB
Loading

apps/pwabuilder/src/script/components/community-hub.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class CommunityHub extends LitElement {
1717

1818
static get styles() {
1919
return [
20-
css`
20+
css`
2121
#community-panel {
2222
display: flex;
2323
align-items: flex-start;
@@ -34,7 +34,7 @@ export class CommunityHub extends LitElement {
3434
justify-content: center;
3535
}
3636
37-
#community-photo img {
37+
#community-photo img {
3838
width: 500px;
3939
height: auto;
4040
}
@@ -65,7 +65,7 @@ export class CommunityHub extends LitElement {
6565
6666
/* < 480px */
6767
${smallBreakPoint(css`
68-
#community-photo img {
68+
#community-photo img {
6969
display: none;
7070
}
7171
#community-panel {
@@ -82,7 +82,7 @@ export class CommunityHub extends LitElement {
8282
8383
/* 480px - 639px */
8484
${mediumBreakPoint(css`
85-
#community-photo img {
85+
#community-photo img {
8686
display: none;
8787
}
8888
#success-panel {
@@ -103,11 +103,11 @@ export class CommunityHub extends LitElement {
103103
}
104104
`)}
105105
106-
106+
107107
108108
/* 640px - 1023px */
109109
${largeBreakPoint(css`
110-
#community-photo img {
110+
#community-photo img {
111111
max-width: 18em;
112112
height: auto;
113113
}
@@ -120,7 +120,7 @@ export class CommunityHub extends LitElement {
120120
`)}
121121
122122
@media (min-width: 640px) and (max-width: 850px) {
123-
#community-photo img {
123+
#community-photo img {
124124
display: none;
125125
}
126126
#success-panel {
@@ -129,23 +129,23 @@ export class CommunityHub extends LitElement {
129129
}
130130
}
131131
132-
133-
132+
133+
134134
135135
/*1024px - 1365px*/
136136
${xLargeBreakPoint(css`
137-
137+
138138
`)}
139139
140140
@media (min-width: 1024px) and (max-width: 1160px) {
141-
#community-photo img {
141+
#community-photo img {
142142
width: 380px;
143143
}
144144
}
145145
146146
/* > 1920px */
147147
${xxxLargeBreakPoint(css`
148-
#community-photo img {
148+
#community-photo img {
149149
width: 569px;
150150
height: auto;
151151
}
@@ -167,7 +167,7 @@ export class CommunityHub extends LitElement {
167167
return html`
168168
<div id="community-panel">
169169
<div id="community-photo">
170-
<img src="/assets/new/community-image.png" alt="social hub image" role="img"/>
170+
<img src="/assets/new/community-image.webp" alt="social hub image" role="img"/>
171171
</div>
172172
<div id="community-content">
173173
<h2>Join our community</h2>

apps/pwabuilder/src/script/components/success-stories.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class SuccessStories extends LitElement {
1818

1919
static get styles() {
2020
return [
21-
css`
21+
css`
2222
#success-panel::before {
2323
content: "";
2424
}
@@ -27,7 +27,7 @@ export class SuccessStories extends LitElement {
2727
flex-direction: column;
2828
align-items: center;
2929
justify-content: center;
30-
background-image: url(/assets/new/successBG_1920.png);
30+
background-image: url(/assets/new/successBG_1920.webp);
3131
background-repeat: no-repeat;
3232
background-size: cover;
3333
background-position: right;
@@ -55,7 +55,7 @@ export class SuccessStories extends LitElement {
5555
/* < 480px */
5656
${smallBreakPoint(css`
5757
#success-panel {
58-
background-image: url(/assets/new/successBG_320.png);
58+
background-image: url(/assets/new/successBG_320.webp);
5959
padding: 2em 1em;
6060
}
6161
#success-panel h2 {
@@ -65,7 +65,7 @@ export class SuccessStories extends LitElement {
6565
font-size: 1.75em;
6666
margin-bottom: .5em;
6767
}
68-
68+
6969
#success-cards {
7070
display: flex;
7171
flex-direction: column;
@@ -79,7 +79,7 @@ export class SuccessStories extends LitElement {
7979
/* 480px - 639px */
8080
${mediumBreakPoint(css`
8181
#success-panel {
82-
background-image: url(/assets/new/successBG_480.png);
82+
background-image: url(/assets/new/successBG_480.webp);
8383
padding: 1em;
8484
padding-bottom: 2em;
8585
}
@@ -90,7 +90,7 @@ export class SuccessStories extends LitElement {
9090
padding-left: 5px;
9191
margin-bottom: .5em;
9292
}
93-
93+
9494
#success-cards {
9595
display: flex;
9696
flex-direction: column;
@@ -104,7 +104,7 @@ export class SuccessStories extends LitElement {
104104
/* 640px - 1023px */
105105
${largeBreakPoint(css`
106106
#success-panel {
107-
background-image: url(/assets/new/successBG_1024.png);
107+
background-image: url(/assets/new/successBG_1024.webp);
108108
padding-left: 2em;
109109
}
110110
#success-panel h2 {
@@ -114,7 +114,7 @@ export class SuccessStories extends LitElement {
114114
115115
@media (min-width: 640px) and (max-width: 850px) {
116116
#success-panel {
117-
background-image: url(/assets/new/successBG_480.png);
117+
background-image: url(/assets/new/successBG_480.webp);
118118
padding: 1em;
119119
padding-bottom: 2em;
120120
}
@@ -123,7 +123,7 @@ export class SuccessStories extends LitElement {
123123
text-align: center;
124124
width: 100%;
125125
}
126-
126+
127127
#success-cards {
128128
display: flex;
129129
flex-direction: column;
@@ -133,7 +133,7 @@ export class SuccessStories extends LitElement {
133133
align-self: center;
134134
}
135135
}
136-
136+
137137
138138
/*1024px - 1365px*/
139139
${xLargeBreakPoint(css`

0 commit comments

Comments
 (0)