Skip to content
This repository was archived by the owner on Aug 30, 2020. It is now read-only.

Commit 603e15d

Browse files
committed
add lazy image
1 parent 9cc7898 commit 603e15d

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

Diff for: client/components/LazyImage/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ LazyImage.defaultProps = {
5555
width: '100%',
5656
};
5757

58-
export default LazyImage;
58+
export default LazyImage;

Diff for: client/components/LazyImage/styles.scss

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.fadeIn {
2+
opacity: 0;
3+
4+
&:not([src]) {
5+
visibility: hidden;
6+
}
7+
8+
&.initial,
9+
&.loaded,
10+
&.error {
11+
opacity: 1;
12+
}
13+
}

Diff for: client/routes/Home/components/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ function Home() {
8888
);
8989
}
9090

91-
export default Home;
91+
export default Home;

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"unfetch": "^4.1.0",
8787
"url-loader": "1.1.2",
8888
"url-polyfill": "^1.1.7",
89+
"vanilla-lazyload": "11.0.6",
8990
"webpack": "4.29.6",
9091
"webpack-dev-server": "3.8.0",
9192
"webpack-manifest-plugin": "2.0.4",

Diff for: yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -11877,6 +11877,11 @@ value-equal@^0.4.0:
1187711877
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
1187811878
integrity sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==
1187911879

11880+
11881+
version "11.0.6"
11882+
resolved "https://registry.yarnpkg.com/vanilla-lazyload/-/vanilla-lazyload-11.0.6.tgz#76a13ece6c256d5f6451bc0687038c485441ca11"
11883+
integrity sha512-mEOSXyF0W/9mGuqTWFIEaqiVqPD10EBTur0tRKmPC0Z/a0r4LWB6c/4D24nmhGtnEDiDGtK2rUIyl8P3PJhUOw==
11884+
1188011885
vary@^1.1.2, vary@~1.1.2:
1188111886
version "1.1.2"
1188211887
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"

0 commit comments

Comments
 (0)