Skip to content

Commit 4e27f93

Browse files
committed
feat (lazysizes): improves initial page load performance
Adds lazy loading for images to improve initial page load time. Also sets `decoding="async"` attribute to images with `fetchpriority="high"` to further enhance perceived performance.
1 parent 8e45bde commit 4e27f93

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<picture>
22
%%data-location%%
33
%%sources%%
4-
<img %%src%% fetchpriority="high" %%attributes%%>
4+
<img %%src%% fetchpriority="high" decoding="async" %%attributes%%>
55
</picture>
6-
<figcaption>%%caption%%</figcaption>
6+
<figcaption>%%caption%%</figcaption>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<picture>
22
%%data-location%%
33
%%sources%%
4-
<img %%src%% fetchpriority="high" %%attributes%%>
4+
<img %%src%% fetchpriority="high" decoding="async" %%attributes%%>
55
</picture>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"license": "GPL-2.0",
1818
"dependencies": {
1919
"@fontsource/poppins": "^5.0.5",
20+
"lazysizes": "^5.3.2",
2021
"oneloop.js": "^5.2.1"
2122
},
2223
"devDependencies": {

src/js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'lazysizes'
12
import './classes/ScrollDirection'
23
import './classes/ButtonSeoClick'
34
import './classes/Header'

yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,7 @@ __metadata:
22722272
imagemin-jpegtran: "npm:^7.0.0"
22732273
imagemin-optipng: "npm:^8.0.0"
22742274
imagemin-svgo: "npm:^10.0.1"
2275+
lazysizes: "npm:^5.3.2"
22752276
mini-css-extract-plugin: "npm:^1.5.0"
22762277
oneloop.js: "npm:^5.2.1"
22772278
postcss: "npm:^8.4.24"
@@ -6703,6 +6704,13 @@ __metadata:
67036704
languageName: node
67046705
linkType: hard
67056706

6707+
"lazysizes@npm:^5.3.2":
6708+
version: 5.3.2
6709+
resolution: "lazysizes@npm:5.3.2"
6710+
checksum: 10/15dfa1cc8bf8c3a4393014d411f161cb1df96ab0888a0776ba4dc34d45c6ba9c5d2b2eca22683c14dfeee552c67173cb9a512d640d3424d9910c0246e15c4edc
6711+
languageName: node
6712+
linkType: hard
6713+
67066714
"levn@npm:^0.4.1":
67076715
version: 0.4.1
67086716
resolution: "levn@npm:0.4.1"

0 commit comments

Comments
 (0)