Skip to content

Commit 9c8a9b8

Browse files
Add blur filter
1 parent 5acd55c commit 9c8a9b8

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Launch the latest build of [Reference8](https://reference8.com) in your browser.
99
- [x] Toggle fullscreen.
1010
- [x] Select photo or drag and drop to upload.
1111
- [x] Drag and drop to replace photo.
12+
- [x] Add other filters: blur, etc.
1213
- [ ] Menus should close without user needing to manually close them.
13-
- [ ] Add other filters: blur, etc.
1414

1515
If you'd like to help out, please take a look at the Contributing section below.
1616

public/blur.jpg

44.7 KB
Loading

src/app/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ body {
5858
filter: contrast(140%);
5959
}
6060

61+
.gaussian-blur {
62+
filter: blur(5px);
63+
}
64+
6165
.grid-overlay {
6266
max-height: calc(100vh - 48px);
6367
}

src/app/page.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const imageFiltersConst = [
4343
{ id: 0, name: "Original", thumbnail: "/original.jpg", },
4444
{ id: 1, name: "Grayscale", thumbnail: "/grayscale.jpg", },
4545
{ id: 2, name: "High Contrast", thumbnail: "high-contrast.jpg", },
46+
{ id: 3, name: "Blur", thumbnail: "blur.jpg", },
4647
];
4748

4849

@@ -54,7 +55,7 @@ export default function Home() {
5455
const [aboutMenuOpen, setAboutMenuOpen] = useState(false);
5556

5657
const [gridMode, setGridMode] = useState(0);
57-
const [imageFilters, setImageFilters] = useState([true, false, false]);
58+
const [imageFilters, setImageFilters] = useState([true, false, false, false]);
5859

5960
const [gridModeMenuOpen, setGridModeMenuOpen] = useState(false);
6061
const [imageFiltersMenuOpen, setImageFiltersMenuOpen] = useState(false);

src/components/ImageCanvas.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function filterClassFromId(filterId) {
1212
return "grayscale";
1313
case 2:
1414
return "high-contrast";
15+
case 3:
16+
return "gaussian-blur";
1517
}
1618
}
1719

0 commit comments

Comments
 (0)