Skip to content

Commit 9a1f399

Browse files
committed
remove filter to improve performance
1 parent 38245bd commit 9a1f399

40 files changed

+8
-11
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ Put your images into `src/public/images/`.
133133
134134
Compress image:
135135
```shell
136-
cd /PATH/TO/IMAGE_FOLDER
137-
for i in `ls`; do
138-
gm convert -size 1280x1280 $i -resize 1280x1280 /DIST/FOLDER/$i
136+
src=PATH/TO/INPUT/IMAGES
137+
dst=PATH/TO/OUTPUT/IMAGES
138+
for i in `ls $src`; do
139+
gm convert -size 1280x1280 $src/$i -resize 1280x1280 $dst/normal/$i
140+
gm convert $dst/normal/$i -blur 0x4 $dst/blur/$i
139141
done
140142
```
141143

src/config-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import configJson from './config/config.json';
66
/**
77
* The pictures location, we place pictures at public/images
88
*/
9-
const images = fs.readdirSync(path.resolve(__dirname, 'public/images'))
9+
const images = fs.readdirSync(path.resolve(__dirname, 'public/images/normal'))
1010
.filter((f) => f.indexOf('.jpg') !== -1 || f.indexOf('.png') !== -1)
11-
.map((f) => `/images/${f}`);
11+
.map((f) => `/images/normal/${f}`);
1212

1313
/**
1414
* Parsed questions

src/frontend/src/components/slideshow/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function PicSlider({ curImage, images }) {
1919
<div key={image}
2020
className={`${styles.blur} ${image === curImage ? styles.visible : styles.hidden}`}
2121
style={{
22-
backgroundImage: `url("${image}")`,
22+
backgroundImage: `url("${image.replace('normal', 'blur')}")`,
2323
display: activeIndices.includes(index) ? 'block' : 'none'
2424
}}
2525
>

src/frontend/src/components/slideshow/slideshow.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
background-repeat: no-repeat;
3030
background-size: cover;
3131
z-index: 1;
32-
-webkit-filter: blur(5px);
33-
-moz-filter: blur(5px);
34-
-o-filter: blur(5px);
35-
-ms-filter: blur(5px);
36-
filter: blur(5px);
3732
}
3833

3934
@media (max-width: 480px) {

src/public/images/CEL_0131.jpg

-133 KB
Binary file not shown.

src/public/images/CEL_0229.jpg

-230 KB
Binary file not shown.

src/public/images/a1-1280.jpg

-190 KB
Binary file not shown.

src/public/images/a2-1280.jpg

-245 KB
Binary file not shown.

src/public/images/b1-1280.jpg

-316 KB
Binary file not shown.

src/public/images/b2-1280.jpg

-146 KB
Binary file not shown.

0 commit comments

Comments
 (0)